/* ══════════════════════════════════════
   MOBILE-FIRST RESPONSIVE — CAPACITOR READY
   v3.0.2 - Isolated & Juiced
   Strategy: Strict scoping to avoid menu/game bleed.
══════════════════════════════════════ */

:root {
  --card-w: 108px;
  --card-h: 150px;
  --slot-w: 108px;
  --slot-h: 158px;
  --hand-card-w: 95px;
  --hand-card-h: 130px;
  --field-gap: 5px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ── GLOBAL MOBILE UI (NON-GAMEPLAY) ── */
@media (max-width: 600px) {
    .screen {
        padding-top: calc(var(--safe-top) + 10px);
        padding-bottom: var(--safe-bottom);
    }

    /* Fix Menu Buttons */

    #menu-screen .menu-btn {
        width: 90% !important;
        margin: 8px auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 12px 20px !important;
        border-radius: 8px !important;
        font-size: 1rem !important;
        height: auto !important;
        min-height: 50px !important;
    }

    #menu-screen .btn-gold {
        background: linear-gradient(to right, var(--gold), #b8860b) !important;
        color: #000 !important;
        font-weight: 900 !important;
    }

    #menu-screen .btn-ghost {
        background: rgba(255,255,255,0.05) !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
        width: 90% !important;
        height: auto !important;
        border-radius: 8px !important;
    }

    .phase-banner {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.5);
        background: linear-gradient(to right, transparent, rgba(212,175,55,0.9), transparent);
        color: #000;
        font-family: 'Bebas Neue', sans-serif;
        font-size: 3rem;
        letter-spacing: 10px;
        padding: 20px 0;
        width: 150vw;
        text-align: center;
        z-index: 5000;
        opacity: 0;
        pointer-events: none;
        animation: phase-banner-anim 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
        backdrop-filter: blur(10px);
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }

    @keyframes phase-banner-anim {
        0% { transform: translate(-50%, -50%) scaleX(0); opacity: 0; }
        20% { transform: translate(-50%, -50%) scaleX(1); opacity: 1; }
        80% { transform: translate(-50%, -50%) scaleX(1); opacity: 1; }
        100% { transform: translate(-50%, -50%) scaleX(0); opacity: 0; }
    }

    /* ── GAMEPLAY SCREEN — the fixed fullscreen container ── */
    #game-screen {
        position: fixed !important;
        inset: 0 !important;
        overflow: hidden !important;
        height: 100dvh !important;
        background: radial-gradient(ellipse at 50% 50%, #1a1a22 0%, #050508 100%);
    }

    /* Game header hidden on mobile */
    #game-screen #hdr { display: none !important; }

    /* #board is NOT fixed — fixed children need a non-fixed ancestor */
    #board {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        pointer-events: none !important;
        overflow: visible !important;
        transform: none !important;
        background: transparent !important;
    }

    /* Territory strip — trap zones flank territory card */
    #territory-strip {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 2px 6px !important;
        gap: 6px !important;
        flex-shrink: 0;
    }
    #territory-strip::before {
        top: 50%;
        left: 5%;
        right: 5%;
        height: 1px;
        box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
    }
    #territory-center-wrap {
        transform: scale(0.88);
        transform-origin: center center;
        flex-shrink: 0;
    }
    .territory-card { width: 260px !important; height: 72px !important; }
    .territory-card.empty { width: 260px !important; height: 72px !important; }

    /* Show terr-sides as trap zone columns */
    .terr-side {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 56px !important;
        flex-shrink: 0 !important;
    }

    /* Trap zones inside territory strip — NOT fixed positioned, flow inline */
    #territory-strip .trap-zone-wrap {
        position: relative !important;
        top: auto !important; right: auto !important;
        bottom: auto !important; left: auto !important;
        z-index: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 3px !important;
        pointer-events: auto !important;
    }
    /* Use IDs to beat #game-screen #opp-trap-zone (specificity 200) */
    #territory-strip #opp-trap-zone,
    #territory-strip #p-trap-zone {
        width: 52px !important;
        height: 64px !important;
        border-radius: 5px !important;
    }
    #territory-strip .trap-zone-label {
        font-size: .38rem !important;
        letter-spacing: 1px !important;
        opacity: .55 !important;
    }
    #territory-strip .face-down-card {
        width: 36px !important;
        height: 50px !important;
        font-size: .85rem !important;
    }
    #territory-strip .face-down-card::after {
        font-size: .38rem !important;
        letter-spacing: 0.5px !important;
    }

    /* Territory environment glows on #game-screen (safe to use bg on fixed element) */
    #game-screen.env-trappers  { background: radial-gradient(ellipse at 50% 50%, rgba(255,59,59,0.14) 0%, #050508 70%); }
    #game-screen.env-hustlers  { background: radial-gradient(ellipse at 50% 50%, rgba(0,255,135,0.12) 0%, #050508 70%); }
    #game-screen.env-cartel    { background: radial-gradient(ellipse at 50% 50%, rgba(206,147,216,0.14) 0%, #050508 70%); }
    #game-screen.env-ogs       { background: radial-gradient(ellipse at 50% 50%, rgba(212,175,55,0.14) 0%, #050508 70%); }
    #game-screen.env-jakuza    { background: radial-gradient(ellipse at 50% 50%, rgba(220,20,60,0.14) 0%, #050508 70%); }
    #game-screen.env-mang      { background: radial-gradient(ellipse at 50% 50%, rgba(123,45,139,0.14) 0%, #050508 70%); }
    #game-screen.env-vercetti  { background: radial-gradient(ellipse at 50% 50%, rgba(74,144,217,0.14) 0%, #050508 70%); }
    #game-screen.env-sadboyz   { background: radial-gradient(ellipse at 50% 50%, rgba(196,166,184,0.14) 0%, #050508 70%); }
    #game-screen.env-earth     { background: radial-gradient(ellipse at 50% 50%, rgba(46,139,122,0.14) 0%, #050508 70%); }
    #game-screen.env-yonkers   { background: radial-gradient(ellipse at 50% 50%, rgba(232,117,42,0.14) 0%, #050508 70%); }
    #game-screen.env-tweaker   { background: radial-gradient(ellipse at 50% 50%, rgba(173,190,24,0.14) 0%, #050508 70%); }

    /* Territory name watermark — center divider */
    #game-screen::after {
        content: attr(data-territory);
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-family: 'Bebas Neue', sans-serif;
        font-size: 1.1rem;
        letter-spacing: 8px;
        color: rgba(255,255,255,0.05);
        white-space: nowrap;
        pointer-events: none;
        z-index: 2;
    }

    /* Glowing center line */
    #game-screen::before {
        content: '';
        position: fixed;
        top: 50%;
        left: 5%;
        right: 5%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
        pointer-events: none;
        z-index: 2;
    }

    /* ── BATTLEFIELD — fixed, fills center between HUDs ── */
    #bf {
        position: fixed !important;
        top: 68px;
        bottom: 210px;
        left: 0;
        right: 0;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        pointer-events: auto !important;
        overflow: visible !important;
        background: transparent !important;
        perspective: 1400px;
        z-index: 5;
        padding: 0;
    }

    /* Opponent field row — tilts face towards player */
    .field-row.opp-row {
        display: flex !important;
        justify-content: center !important;
        gap: var(--field-gap) !important;
        padding: 0 12px !important;
        transform: scale(0.70) perspective(900px) rotateX(-20deg) !important;
        transform-origin: center top;
        transform-style: preserve-3d;
    }

    /* Player field row — tilts face up towards player */
    .field-row.p-row {
        display: flex !important;
        justify-content: center !important;
        gap: var(--field-gap) !important;
        padding: 0 12px !important;
        transform: scale(0.70) perspective(900px) rotateX(-16deg) !important;
        transform-origin: center bottom;
        transform-style: preserve-3d;
    }

    /* Stadium Arc — gentle curve to prevent edge clipping */
    .field-row .slot { transition: transform 0.4s ease; transform-style: preserve-3d; flex-shrink: 0; }
    .opp-row .slot:nth-child(1) { transform: rotateY(14deg) translateZ(-12px); }
    .opp-row .slot:nth-child(2) { transform: rotateY(6deg)  translateZ(-5px); }
    .opp-row .slot:nth-child(3) { transform: translateZ(8px); }
    .opp-row .slot:nth-child(4) { transform: rotateY(-6deg) translateZ(-5px); }
    .opp-row .slot:nth-child(5) { transform: rotateY(-14deg) translateZ(-12px); }
    .p-row .slot:nth-child(1)   { transform: rotateY(14deg) translateZ(-12px); }
    .p-row .slot:nth-child(2)   { transform: rotateY(6deg)  translateZ(-5px); }
    .p-row .slot:nth-child(3)   { transform: translateZ(8px); }
    .p-row .slot:nth-child(4)   { transform: rotateY(-6deg) translateZ(-5px); }
    .p-row .slot:nth-child(5)   { transform: rotateY(-14deg) translateZ(-12px); }

    /* ── OPPONENT HUD — fixed to very top ── */
    #game-screen .pstrip {
        position: fixed !important;
        background: rgba(10,10,15,0.92) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-radius: 16px !important;
        padding: 6px 12px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        z-index: 200;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.6) !important;
        margin: 0 !important;
    }

    #game-screen .pstrip.opp {
        top: calc(var(--safe-top, 0px) + 8px);
        left: 10px;
        border-left: 3px solid var(--red) !important;
        flex-direction: row !important;
    }

    /* Opponent hand backs: float beside their HUD */
    #opp-hand-backs {
        position: fixed;
        top: calc(var(--safe-top, 0px) + 12px);
        right: 12px;
        display: flex !important;
        gap: -14px;
        z-index: 200;
        pointer-events: none;
        transform: scale(0.40);
        transform-origin: top right;
    }

    /* ── PLAYER HUD — above action bar ── */
    #p-strip {
        bottom: calc(var(--safe-bottom, 0px) + 185px) !important;
        left: 10px !important;
        border-left: 3px solid var(--gold) !important;
        flex-direction: row !important;
    }

    /* Compact HUD text sizing */
    #game-screen .avatar   { width: 34px !important; height: 34px !important; font-size: 1.2rem !important; }
    #game-screen .pname    { font-size: 0.85rem !important; letter-spacing: 2px !important; }
    #game-screen .money-box {
        font-size: 1.3rem !important;
        padding: 4px 12px !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.2) !important;
    }
    #game-screen .income-badge,
    #game-screen .income-tier { display: none !important; }

    /* Synergy HUDs — hide generic synergy-bar, show named IDs as fixed overlay rows */
    #game-screen .synergy-bar { display: none !important; }
    /* Override with double-ID specificity (200) to beat #game-screen .synergy-bar (110) */
    #game-screen #opp-synergy,
    #game-screen #p-synergy {
        display: flex !important;
        position: fixed !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        z-index: 220 !important;
        pointer-events: none !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 0 !important;
        width: auto !important;
    }
    #game-screen #opp-synergy {
        top: 72px !important;
    }
    #game-screen #p-synergy {
        bottom: 218px !important;
    }

    /* ── FLOATING TRAP INDICATORS — battlefield edges ── */
    #game-screen .trap-zone-wrap {
        position: fixed !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1px !important;
        margin: 0 !important;
        z-index: 210;
        pointer-events: none;
    }

    /* Opponent trap — top-right of battlefield */
    .pstrip.opp .trap-zone-wrap,
    .opp-trap-row .trap-zone-wrap {
        top: 70px !important;
        right: 4px !important;
        left: auto !important;
        bottom: auto !important;
    }

    /* Player trap — bottom-right of battlefield */
    .p-trap-hud {
        bottom: 215px !important;
        right: 4px !important;
        left: auto !important;
        top: auto !important;
    }

    /* Compact trap zone sizing — override inline styles */
    #game-screen .trap-zone,
    #game-screen #opp-trap-zone,
    #game-screen #p-trap-zone {
        width: 28px !important;
        height: 40px !important;
        border-radius: 3px !important;
        border: 1px dashed rgba(255, 107, 53, .3) !important;
        background: rgba(10, 8, 6, 0.65) !important;
        backdrop-filter: blur(6px);
    }

    #game-screen .trap-zone.has-trap,
    #game-screen #opp-trap-zone.has-trap,
    #game-screen #p-trap-zone.has-trap {
        border-color: rgba(255, 107, 53, .7) !important;
        border-style: solid !important;
        background: rgba(255, 107, 53, .08) !important;
        box-shadow: 0 0 10px rgba(255, 107, 53, .35) !important;
    }

    #game-screen .trap-zone-label {
        font-size: .4rem !important;
        letter-spacing: 1px !important;
        opacity: .45;
    }

    /* Compact face-down card inside trap zone */
    #game-screen .face-down-card {
        width: 22px !important;
        height: 34px !important;
        font-size: .7rem !important;
    }
    #game-screen .face-down-card::after {
        font-size: .35rem !important;
        letter-spacing: 0.5px !important;
    }

    /* Territory trap zones override — must come AFTER general .trap-zone-wrap fixed rule */
    /* Use double-ID specificity (200) to beat #game-screen .trap-zone-wrap (110) */
    #territory-strip #opp-trap-zone-wrap,
    #territory-strip #p-trap-zone-wrap {
        position: relative !important;
        top: auto !important; right: auto !important;
        bottom: auto !important; left: auto !important;
        z-index: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        pointer-events: auto !important;
    }
    /* Unused now — opp-trap-row removed from HTML */
    .opp-trap-row {
        position: static !important;
        margin: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: visible !important;
    }

    /* ── ACTION BAR — horizontal pill row above hand ── */
    #actbar {
        position: fixed;
        bottom: calc(var(--safe-bottom, 0px) + 145px);
        left: 0;
        right: 0;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: flex-end !important;
        gap: 8px !important;
        padding: 0 12px !important;
        background: transparent !important;
        border: none !important;
        z-index: 300;
        pointer-events: auto;
    }
    /* Show leave button on mobile (header is hidden) */
    #btn-leave-game-bottom {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Log wrap in actbar hidden — floating log below takes over */
    #actbar #log-wrap {
        display: none !important;
    }
    #actbar .btn {
        height: 48px !important;
        border-radius: 24px !important;
        font-size: 0.72rem !important;
        padding: 0 16px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }

    #actbar .btn-ghost {
        background: rgba(10,10,15,0.82) !important;
        border: 1px solid rgba(255,255,255,0.12) !important;
    }

    /* Leave button — small, red-tinted */
    #btn-leave-game-bottom {
        padding: 0 12px !important;
        font-size: 0.65rem !important;
        opacity: 0.7;
    }

    /* Phase button wrap — hide label on mobile, it adds height unevenness */
    #phase-label { display: none !important; }

    #phase-btn {
        height: 48px !important;
        font-size: 0.9rem !important;
        padding: 0 24px !important;
        background: linear-gradient(135deg, var(--gold) 0%, #ffe066 100%) !important;
        color: #000 !important;
        font-weight: 900 !important;
        border-radius: 24px !important;
        box-shadow: 0 6px 24px rgba(212,175,55,0.45), inset 0 2px 0 rgba(255,255,255,0.4) !important;
        letter-spacing: 2px !important;
    }
    #phase-btn:active { transform: scale(0.96) !important; }

    /* ── FLOATING LOG — bottom left, above action bar ── */
    #log-wrap {
        position: fixed !important;
        display: block !important;
        bottom: calc(var(--safe-bottom, 0px) + 225px);
        left: 10px;
        max-width: 55vw;
        background: rgba(8,8,12,0.88);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 10px;
        padding: 4px 10px;
        z-index: 250;
        pointer-events: auto;
    }
    #log {
        font-size: 0.72rem !important;
        color: rgba(255,255,255,0.7) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #log-history { display: none !important; } /* keep it clean */
    #log-toggle-btn { display: none !important; }

    /* ── HAND — pinned absolutely at the bottom ── */
    #hand-area {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 155px !important;
        z-index: 200;
        pointer-events: none;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        align-items: center !important;
        background: linear-gradient(0deg, rgba(4,4,6,0.98) 0%, rgba(4,4,6,0.7) 60%, transparent 100%) !important;
        border-top: none !important;
        box-shadow: none !important;
    }

    #hand-lbl {
        display: none !important; /* clean up — no label on mobile */
    }

    #hand-cards {
        pointer-events: auto !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-end !important;
        padding-bottom: 8px !important;
        perspective: 1200px !important;
        overflow: visible !important;
        scrollbar-width: none !important;
    }

    /* Fanned hand cards */
    .card-fanned {
        transform-origin: center bottom !important;
        margin: 0 -18px !important;
        transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1) !important;
    }
    .card-fanned.scrub-active {
        transform: translateY(-55px) scale(1.18) rotate(0deg) !important;
        z-index: 1000 !important;
    }

    /* ── JUICE EFFECTS ── */
    @keyframes card-lunge {
        0%  { transform: translateZ(0); }
        30% { transform: translateZ(100px) translateY(-50px) rotateX(-20deg); }
        100%{ transform: translateZ(0); }
    }
    .card-attacking {
        animation: card-lunge 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        z-index: 500 !important;
    }

    .floating-text {
        position: absolute;
        font-family: 'Bebas Neue', sans-serif;
        font-size: 1.5rem;
        font-weight: 900;
        pointer-events: none;
        z-index: 2000;
        text-shadow: 0 0 10px rgba(0,0,0,0.8);
        animation: float-up-fade 1s ease-out forwards;
    }
    @keyframes float-up-fade {
        0%   { transform: translateY(0);    opacity: 1; }
        100% { transform: translateY(-100px); opacity: 0; }
    }
}

@media (max-width: 600px) {
    /* ── PREMIUM PACK OPENING (v3.0.3) ── */
    #pack-opening-overlay {
        background: radial-gradient(circle at center, rgba(15,15,15,0.95) 0%, #000 100%) !important;
        backdrop-filter: blur(20px);
        z-index: 5000 !important;
    }

    #pack-opening-safe {
        display: none !important; /* Replacing old safe with 3D pack */
    }

    .pack-container-3d {
        width: 220px;
        height: 320px;
        perspective: 1000px;
        margin: 40px auto;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    .pack-3d {
        width: 100%;
        height: 100%;
        position: relative;
        transform-style: preserve-3d;
        animation: pack-idle-float 3s infinite ease-in-out;
    }

    @keyframes pack-idle-float {
        0%, 100% { transform: translateY(0) rotateY(0deg); }
        50% { transform: translateY(-10px) rotateY(5deg); }
    }

    .pack-3d.shaking {
        animation: pack-shake 0.1s infinite !important;
    }

    @keyframes pack-shake {
        0% { transform: translate(1px, 1px) rotate(0deg); }
        25% { transform: translate(-1px, -1px) rotate(1deg); }
        50% { transform: translate(1px, -1px) rotate(-1deg); }
        100% { transform: translate(-1px, 1px) rotate(0deg); }
    }

    .pack-3d img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 0 30px rgba(212,175,55,0.4));
    }

    /* Card Reveal Spread */
    #pack-opening-cards {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
        padding: 20px !important;
        max-width: 100vw !important;
    }

    .pcr-wrapper {
        perspective: 1000px;
        width: 100px;
        height: 140px;
        opacity: 0;
        transform: translateY(50px) scale(0.5);
        animation: card-fly-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    @keyframes card-fly-in {
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .pcr-3d {
        width: 100%;
        height: 100%;
        position: relative;
        transform-style: preserve-3d;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
    }

    .pcr-3d.flipped {
        transform: rotateY(180deg);
    }

    .pcr-front, .pcr-back {
        position: absolute;
        inset: 0;
        backface-visibility: hidden;
        border-radius: 8px;
        overflow: hidden;
    }

    .pcr-back {
        background: linear-gradient(135deg, #1a1a1a 0%, #050505 100%);
        border: 2px solid rgba(212,175,55,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Bebas Neue', sans-serif;
        color: var(--gold);
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .pcr-front {
        transform: rotateY(180deg);
    }

    /* Rarity Glows for the reveal */
    .pcr-wrapper.rarity-legendary .pcr-front { box-shadow: 0 0 20px var(--gold); border: 2px solid var(--gold); }
    .pcr-wrapper.rarity-epic .pcr-front { box-shadow: 0 0 20px #c66bff; border: 2px solid #c66bff; }
    .pcr-wrapper.rarity-rare .pcr-front { box-shadow: 0 0 15px #3a8fdf; border: 2px solid #3a8fdf; }

    /* ── DAILY HUSTLE MODAL ── */
    #daily-hustle-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.9);
        z-index: 6000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    #daily-hustle-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .daily-card {
        background: rgba(20,20,20,0.95);
        border: 1px solid var(--gold);
        border-radius: 20px;
        width: 85vw;
        max-width: 400px;
        padding: 30px;
        text-align: center;
        box-shadow: 0 0 50px rgba(212,175,55,0.2);
        transform: translateY(20px);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    #daily-hustle-overlay.active .daily-card {
        transform: translateY(0);
    }

    .daily-title {
        font-family: 'Bebas Neue', sans-serif;
        font-size: 2.5rem;
        letter-spacing: 4px;
        color: var(--gold);
        margin-bottom: 10px;
    }

    .daily-subtitle {
        color: var(--muted);
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    .daily-reward-icon {
        font-size: 4rem;
        margin-bottom: 15px;
        display: block;
        animation: reward-pulse 2s infinite ease-in-out;
    }

    @keyframes reward-pulse {
        0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--gold-glow)); }
        50% { transform: scale(1.1); filter: drop-shadow(0 0 30px var(--gold-glow)); }
    }
}

/* ── DECK BUILDER MOBILE (v3.1.2) ── */
@media (max-width: 600px) {
    /* ── Row 1: BACK | DECK BUILDER | 0/30 | EXP | IMP | PLAY ── */
    #db-hdr {
        flex-wrap: wrap !important;
        padding: 6px 8px !important;
        gap: 5px !important;
        row-gap: 5px !important;
        align-items: center !important;
    }
    #db-hdr h2 {
        flex: 1 !important;
        font-size: .75rem !important;
        letter-spacing: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    #collection-count-label { display: none !important; }
    #deck-count-badge {
        font-size: .65rem !important;
        padding: 3px 7px !important;
        flex-shrink: 0 !important;
    }
    /* Abbreviate EXPORT→EXP and IMPORT→IMP so they fit in row 1 */
    #btn-deck-export,
    #btn-deck-import {
        flex-shrink: 0 !important;
        font-size: 0 !important;   /* hide full text */
        padding: 4px 8px !important;
        letter-spacing: 0 !important;
    }
    #btn-deck-export::before { content: 'EXP'; font-size: .6rem; letter-spacing: 1px; }
    #btn-deck-import::before { content: 'IMP'; font-size: .6rem; letter-spacing: 1px; }
    #play-deck-btn {
        font-size: .65rem !important;
        padding: 5px 10px !important;
        flex-shrink: 0 !important;
    }

    /* ── Row 2: DECK NAME | ⚡QUICK | SAVE | CLEAR | STARTER ── */
    .db-action-row {
        order: 10 !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 5px !important;
    }
    #deck-name-input {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        font-size: .7rem !important;
        padding: 5px 7px !important;
    }
    .db-action-row .btn {
        font-size: .6rem !important;
        padding: 5px 9px !important;
        letter-spacing: 1px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    /* Separator inside action row not needed on mobile */
    .db-action-row > div[style*="width:1px"] { display: none !important; }

    /* ── Filter strip: horizontal scroll only ── */
    #db-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 6px 10px !important;
        gap: 5px !important;
    }
    #db-filters::-webkit-scrollbar { display: none !important; }
    #db-filters .filter-btn { flex-shrink: 0 !important; }
    #db-filters span[style*="width:1px"] { flex-shrink: 0 !important; }
    #db-filters #search-input {
        min-width: 90px !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
    }
    #db-filters #sort-select {
        flex-shrink: 0 !important;
        margin-left: 0 !important;
        font-size: .58rem !important;
    }
}
