* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

.menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.menu-content {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    max-width: 900px;
    padding: 40px;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
}

.menu-left {
    flex: 1;
}

.menu-title {
    font-size: 72px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(247, 147, 26, 0.6), 0 4px 20px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.menu-title-btc {
    color: #f7931a;
    margin-right: 8px;
}

.menu-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin-top: 16px;
    letter-spacing: 1px;
}

.enter-btn {
    margin-top: 32px;
    padding: 16px 48px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #f7931a, #e67e22);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.4);
}

.enter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(247, 147, 26, 0.6);
}

.enter-btn:active {
    transform: scale(0.97);
}

.menu-right {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(247, 147, 26, 0.2);
    border-radius: 16px;
    padding: 32px 40px;
    text-align: right;
    min-width: 200px;
}

.menu-btc-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 600;
}

.menu-btc-price {
    color: #f7931a;
    font-size: 36px;
    font-weight: 800;
    margin-top: 4px;
    line-height: 1;
}

.menu-btc-change {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .menu-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    .menu-title {
        font-size: 52px;
    }
    .menu-right {
        text-align: center;
        width: 100%;
    }
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chart-container {
    position: absolute;
    top: 8px;
    left: 45%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 6px 10px 4px;
    border-radius: 10px;
    border: 1px solid rgba(247, 147, 26, 0.2);
    cursor: grab;
    width: 200px;
}

.chart-container.dragging {
    cursor: grabbing;
    user-select: none;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.chart-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-price {
    color: #f7931a;
    font-size: 11px;
    font-weight: 700;
}

#chartCanvas {
    width: 100%;
    height: 60px;
    display: block;
    border-radius: 4px;
}

.columns-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
    pointer-events: none;
}

.column {
    flex: 1;
    height: 100%;
    position: relative;
    pointer-events: none;
}

.column + .column {
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.column-left {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-container {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(calc(-50% - 60px));
    text-align: center;
}

.score-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.score-value {
    font-size: 72px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 30px rgba(247, 147, 26, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5);
    line-height: 1;
    margin-top: 5px;
    transition: transform 0.1s ease;
}

.score-pop {
    animation: scorePop 0.3s ease;
}

@keyframes scorePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.coin-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2;
    left: -60px;
}

.coin-wrapper:active img {
    transform: scale(0.92);
}

.coin-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.08s ease;
    pointer-events: none;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 30px rgba(247, 147, 26, 0.4));
}

#shatterCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.click-hint {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(calc(-50% - 60px));
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulseHint 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.click-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.floating-point {
    position: absolute;
    font-size: 32px;
    font-weight: 800;
    color: #f7931a;
    text-shadow: 0 0 20px rgba(247, 147, 26, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10;
    animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - 20px)) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 80px)) scale(1);
    }
}

.powerup {
    position: absolute;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s;
}

.powerup.hidden {
    display: none;
}

.bubble {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(100, 180, 255, 0.3), rgba(0, 80, 200, 0.15));
    border: 2px solid rgba(100, 180, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bubbleFloat 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(50, 150, 255, 0.2), inset 0 0 20px rgba(50, 150, 255, 0.1);
}

.bubble-fire {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.bubble-fire.active {
    opacity: 1;
    animation: blueFire 0.6s ease-in-out infinite;
}

@keyframes blueFire {
    0%, 100% {
        box-shadow:
            0 0 15px 5px rgba(50, 150, 255, 0.6),
            0 0 30px 10px rgba(0, 100, 255, 0.3),
            0 0 45px 15px rgba(0, 50, 200, 0.15);
    }
    50% {
        box-shadow:
            0 0 20px 8px rgba(50, 150, 255, 0.8),
            0 0 40px 15px rgba(0, 100, 255, 0.5),
            0 0 60px 25px rgba(0, 50, 200, 0.25);
    }
}

@keyframes fireBorders {
    0% { clip-path: inset(0 0 0 0); }
    25% { clip-path: inset(2px 0 0 0); }
    50% { clip-path: inset(0 2px 0 0); }
    75% { clip-path: inset(0 0 2px 0); }
    100% { clip-path: inset(0 0 0 2px); }
}

.bubble-fire.active::before,
.bubble-fire.active::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: conic-gradient(from 0deg, transparent, #3399ff, transparent, #0066ff, transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: fireSpin 1s linear infinite;
}

.bubble-fire.active::after {
    animation: fireSpin 1s linear infinite reverse;
    background: conic-gradient(from 180deg, transparent, #66bbff, transparent, #0044cc, transparent) border-box;
}

@keyframes fireSpin {
    to { transform: rotate(360deg); }
}

.x2-text {
    font-size: 28px;
    font-weight: 900;
    color: #66bbff;
    text-shadow:
        0 0 10px rgba(50, 150, 255, 0.8),
        0 0 20px rgba(50, 150, 255, 0.4),
        0 0 40px rgba(0, 100, 255, 0.2);
    z-index: 1;
    transition: text-shadow 0.3s, color 0.3s;
}

.x2-text.active {
    color: #88ddff;
    text-shadow:
        0 0 15px rgba(50, 150, 255, 1),
        0 0 30px rgba(50, 150, 255, 0.7),
        0 0 50px rgba(0, 100, 255, 0.4),
        0 0 80px rgba(0, 50, 200, 0.2);
    animation: x2Pulse 0.5s ease-in-out infinite;
}

@keyframes x2Pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.x2-text.collected {
    position: fixed;
    bottom: 16px;
    left: 16px;
    font-size: 18px;
    z-index: 30;
    animation: none;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.multiplier-bar {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 30;
    pointer-events: none;
}

.menu-save {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 3;
}

.menu-save-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.menu-input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 13px;
    width: 120px;
    outline: none;
    font-family: monospace;
    letter-spacing: 2px;
}

.menu-input::placeholder {
    color: rgba(255,255,255,0.3);
    letter-spacing: 0;
}

.menu-save-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #f7931a, #e67e22);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s;
}

.menu-save-btn:hover {
    transform: scale(1.05);
}

.menu-save-btn:active {
    transform: scale(0.95);
}

.save-btn {
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(247,147,26,0.4);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    color: #f7931a;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, border-color 0.2s;
}

.save-btn:hover {
    transform: scale(1.1);
    border-color: #f7931a;
}

.save-btn:active {
    transform: scale(0.93);
}

.save-toast {
    position: fixed;
    bottom: 60px;
    right: 12px;
    z-index: 101;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(247,147,26,0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 2px;
    max-width: 260px;
    word-break: break-all;
    text-align: center;
    animation: toastIn 0.3s ease;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.column-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: auto;
    padding-bottom: 80px;
    gap: 8px;
}

.upgrade-box {
    position: relative;
    width: auto;
    min-width: 210px;
    border-radius: 12px;
    overflow: hidden;
    transition: opacity 0.5s ease, filter 0.5s ease;
    opacity: 0.2;
    filter: brightness(0.25);
    pointer-events: none;
    display: inline-block;
}

.upgrade-box.visible {
    opacity: 1;
    filter: brightness(1);
    pointer-events: auto;
}

.upgrade-box.intermediate {
    opacity: 0.5;
    filter: brightness(0.5);
    pointer-events: none;
}

.upgrade-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139, 195, 74, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(76, 175, 80, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(27, 94, 32, 0.35) 0%, transparent 40%),
        repeating-linear-gradient(
            45deg,
            rgba(76, 175, 80, 0.08) 0px,
            rgba(76, 175, 80, 0.08) 8px,
            rgba(139, 195, 74, 0.12) 8px,
            rgba(139, 195, 74, 0.12) 16px
        ),
        linear-gradient(160deg, #1b5e20, #2e7d32 30%, #388e3c 50%, #2e7d32 70%, #1b5e20);
    border-radius: inherit;
    border: 2px solid rgba(139, 195, 74, 0.3);
}

.upgrade-inner {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    gap: 6px;
}

.upgrade-title {
    font-size: 16px;
    font-weight: 900;
    color: #000;
    text-shadow: none;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
}

.upgrade-img-wrap {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upgrade-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.75;
    cursor: pointer;
    transition: transform 0.2s;
}

.upgrade-img:hover {
    transform: scale(1.08);
}

.upgrade-img:active {
    transform: scale(0.95);
}

.upgrade-price {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
}

/* Trader workspace */
.trader-workspace {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 55%;
    max-width: 660px;
    min-width: 340px;
    z-index: 5;
    pointer-events: none;
    border: 1px solid rgba(247, 147, 26, 0.12);
    border-radius: 12px;
    padding: 12px;
    transition: opacity 0.4s ease;
    overflow: hidden;
    min-height: 100px;
}

.trader-workspace::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('fondo/fondo3.png') center/cover no-repeat;
    opacity: 1;
    z-index: 0;
    border-radius: inherit;
}

.trader-workspace::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    z-index: 0;
    border-radius: inherit;
}

.trader-workspace.hidden {
    opacity: 0;
    pointer-events: none;
}

.trader-scene {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 80px;
}

.trader-pcs {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 80px;
}

.trader-pc {
    position: absolute;
    width: 90px;
    height: 50px;
    margin: 2px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 6px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.1);
}

.trader-pc-chart {
    width: 100%;
    height: 100%;
    display: block;
}

/* Orbit animation */
.orbit-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: auto;
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.9;
    cursor: pointer;
}

.x2-active {
    font-size: 16px;
    font-weight: 900;
    color: #66bbff;
    text-shadow: 0 0 10px rgba(50, 150, 255, 0.6), 0 0 20px rgba(50, 150, 255, 0.3);
}

.x2-active.hidden {
    display: none;
}

@media (max-width: 1024px) {
    .trader-workspace {
        width: 70%;
    }
    .trader-pc {
        width: 80px;
        height: 44px;
    }
    .score-value {
        font-size: 56px;
    }
}

@media (max-width: 768px) {
    .coin-wrapper {
        width: 170px;
        height: 170px;
        left: 0;
    }
    .score-value {
        font-size: 40px;
    }
    .score-container {
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
    }
    .click-hint {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
    }
    .floating-point {
        font-size: 20px;
    }
    .upgrade-box {
        min-width: 130px;
    }
    .upgrade-inner {
        padding: 5px 8px;
        gap: 4px;
    }
    .upgrade-img-wrap {
        width: 36px;
        height: 36px;
    }
    .upgrade-title {
        font-size: 12px;
    }
    .upgrade-price {
        font-size: 9px;
    }
    .column-right {
        padding-bottom: 50px;
        gap: 5px;
    }
    .column-left {
        flex: 5;
    }
    .column-center {
        flex: 0.5;
    }
    .column-right {
        flex: 3.7;
        align-items: center;
        padding-bottom: 30px;
        gap: 3px;
    }
    .trader-workspace {
        width: 88%;
        top: 15%;
        padding: 6px;
        min-width: unset;
    }
    .trader-pc {
        width: 65px;
        height: 36px;
    }
    .chart-container {
        width: 140px;
        left: 42%;
    }
    #chartCanvas {
        height: 40px;
    }
    .menu-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }
    .menu-title {
        font-size: 36px;
    }
    .menu-right {
        text-align: center;
        width: 100%;
        padding: 16px 20px;
        min-width: auto;
    }
    .menu-btc-price {
        font-size: 24px;
    }
    .menu-save {
        bottom: 10px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .menu-save-row {
        justify-content: center;
    }
    .menu-input {
        width: 100px;
        font-size: 11px;
    }
    .menu-save-btn {
        font-size: 10px;
        padding: 6px 10px;
    }
    .save-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
        bottom: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .coin-wrapper {
        width: 120px;
        height: 120px;
        left: 0;
    }
    .score-value {
        font-size: 28px;
    }
    .score-label {
        font-size: 9px;
        letter-spacing: 2px;
    }
    .score-container {
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }
    .click-hint {
        display: none;
    }
    .floating-point {
        font-size: 16px;
    }
    .upgrade-box {
        min-width: 100px;
    }
    .upgrade-inner {
        padding: 3px 6px;
        gap: 3px;
    }
    .upgrade-img-wrap {
        width: 28px;
        height: 28px;
    }
    .upgrade-title {
        font-size: 10px;
    }
    .upgrade-price {
        font-size: 8px;
    }
    .column {
        flex: 1;
    }
    .column-left {
        flex: 6;
    }
    .column-center {
        flex: 0.3;
    }
    .column-right {
        flex: 3.7;
        align-items: center;
        padding-bottom: 30px;
        gap: 3px;
    }
    .trader-workspace {
        width: 96%;
        top: 12%;
        padding: 4px;
        min-width: unset;
        border-radius: 8px;
    }
    .trader-pc {
        width: 55px;
        height: 30px;
        margin: 1px;
        border-radius: 2px;
    }
    .trader-scene {
        min-height: 50px;
    }
    .trader-pcs {
        min-height: 50px;
    }
    .chart-container {
        width: 100px;
        left: 30%;
        top: 3px;
        padding: 3px 6px 2px;
    }
    #chartCanvas {
        height: 30px;
    }
    .chart-price {
        font-size: 8px;
    }
    .chart-label {
        font-size: 6px;
    }
    .chart-header {
        margin-bottom: 1px;
    }
    .bubble {
        width: 50px;
        height: 50px;
    }
    .x2-text {
        font-size: 16px;
    }
    .menu-title {
        font-size: 26px;
    }
    .menu-subtitle {
        font-size: 11px;
        margin-top: 10px;
    }
    .enter-btn {
        padding: 10px 24px;
        font-size: 15px;
        margin-top: 20px;
    }
    .menu-content {
        padding: 16px;
        gap: 14px;
    }
    .menu-right {
        padding: 12px 14px;
        min-width: auto;
        width: 100%;
    }
    .menu-btc-price {
        font-size: 20px;
    }
    .menu-btc-change {
        font-size: 12px;
    }
    .menu-save {
        bottom: 8px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .menu-save-row {
        justify-content: center;
    }
    .menu-input {
        width: 90px;
        font-size: 10px;
        padding: 4px 8px;
    }
    .menu-save-btn {
        font-size: 9px;
        padding: 4px 8px;
    }
    .save-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
        bottom: 6px;
        right: 6px;
    }
    .multiplier-bar {
        bottom: 6px;
        left: 6px;
    }
    .x2-active {
        font-size: 13px;
    }
    .orbit-clone {
        width: 28px;
        height: 28px;
    }
    .powerup {
        transform: scale(0.7);
        transform-origin: bottom center;
    }
}
