@font-face { font-family:'BeaufortBold'; src:url('/BeaufortforLOL-Bold.otf') format('opentype'); }
@font-face { font-family:'BeaufortHeavyItalic'; src:url('/BeaufortforLOL-HeavyItalic.otf') format('opentype'); }

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'BeaufortHeavyItalic',Arial,sans-serif; background:#0E1C2F; color:#F2F2F2; }

/* ─── Top Bar ─── */
.topbar { background:#15263A; border-bottom:1px solid #2a3f5a; padding:.75rem 1.5rem; display:flex; justify-content:space-between; align-items:center; }
.topbar-left { display:flex; align-items:center; gap:1.5rem; }
.topbar-left h1 { font-family:'BeaufortBold'; font-size:1.3rem; color:#E6A63C; }
.topbar-nav a { color:#93E1FF; text-decoration:none; font-size:.85rem; margin-right:1rem; }
.topbar-nav a:hover { color:#E6A63C; }
.topbar-right { display:flex; align-items:center; gap:.75rem; }
.topbar-right img { width:32px; height:32px; border-radius:50%; }
.topbar-right .user-name { font-size:.85rem; color:#ccc; }
.topbar-right .btn-logout { background:none; border:1px solid #555; color:#aaa; padding:4px 10px; border-radius:6px; cursor:pointer; font-size:.8rem; }
.topbar-right .btn-logout:hover { border-color:#E6A63C; color:#E6A63C; }

/* ─── Layout ─── */
.app-layout { display:flex; height:calc(100vh - 52px); }

/* ─── Sidebar ─── */
.sidebar { width:260px; background:#12213A; border-right:1px solid #2a3f5a; overflow-y:auto; flex-shrink:0; }
.sidebar-header { padding:1rem; display:flex; justify-content:space-between; align-items:center; }
.sidebar-header h2 { font-family:'BeaufortBold'; font-size:1rem; color:#E6A63C; }
.btn-new-deck { background:#E6A63C; color:#000; border:none; padding:6px 12px; border-radius:6px; font-size:.8rem; font-weight:600; cursor:pointer; }
.btn-new-deck:hover { background:#d4b87a; }
.sidebar-tabs { display:flex; border-bottom:1px solid #2a3f5a; }
.sidebar-tabs button { flex:1; background:none; border:none; color:#888; padding:.6rem; cursor:pointer; font-size:.8rem; border-bottom:2px solid transparent; }
.sidebar-tabs button.active { color:#E6A63C; border-bottom-color:#E6A63C; }
.deck-list { padding:.5rem; }
.deck-item { padding:.6rem .8rem; border-radius:8px; cursor:pointer; margin-bottom:6px; display:flex; align-items:center; gap:.6rem; }
.deck-item:hover { background:#1a3050; }
.deck-item.active { background:#1a3050; border-left:3px solid #E6A63C; }
.deck-item .deck-legend-icon { width:56px; height:56px; border-radius:6px; object-fit:cover; border: 1px solid #E6A63C; }
.deck-item .deck-info { flex:1; }
.deck-item .deck-info .deck-name { font-size:.95rem; color:#F2F2F2; }
.deck-item .deck-info .deck-meta { font-size:.8rem; color:#888; }
.deck-item .deck-visibility { font-size:.75rem; color:#888; }

/* ─── Main Area ─── */
.main-area { flex:1; display:flex; overflow:hidden; height:100%; }

/* ─── Card Browser ─── */
.card-browser { flex:1; display:flex; flex-direction:column; border-right:1px solid #2a3f5a; height:100%; }
.browser-header { padding:.75rem; background:#12213A; border-bottom:1px solid #2a3f5a; }
.browser-tabs { display:flex; gap:.5rem; margin-bottom:.5rem; }
.browser-tabs button { background:#1a3050; border:1px solid #2a3f5a; color:#aaa; padding:4px 12px; border-radius:6px; cursor:pointer; font-size:.8rem; }
.browser-tabs button.active { background:#E6A63C; color:#000; border-color:#E6A63C; }
.browser-filters { display:flex; gap:.5rem; flex-wrap:wrap; }
.browser-filters input, .browser-filters select {
    padding:5px 8px; background:#0E1C2F; border:1px solid #2a3f5a; border-radius:6px;
    color:#F2F2F2; font-size:.8rem; outline:none;
}
.browser-filters input:focus, .browser-filters select:focus { border-color:#E6A63C; }
.browser-filters input { flex:1; min-width:150px; }

.card-grid { flex:1; overflow-y:auto; padding:.5rem; display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:6px; align-content:start; }
.card-tile { background:#15263A; border:1px solid #2a3f5a; border-radius:6px; cursor:pointer; overflow:visible; position:relative; transition:border-color .15s, box-shadow .15s; display:flex; flex-direction:column; }
.card-tile:hover { border-color:#E6A63C; box-shadow:0 0 12px rgba(230,166,60,.3); z-index:2; }
.card-tile img { width:100%; display:block; border-radius:5px 5px 0 0; }
.card-tile .card-name-overlay { display:none; }
.card-tile .card-cost-badge { position:absolute; top:4px; right:4px; background:#E6A63C; color:#000; width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:700; }
.card-tile.disabled { opacity:.3; pointer-events:none; }
.card-tile.in-deck { border-color:#4ade80; }

/* ─── Card Tile +/- Controls ─── */
.card-tile-controls { display:none; /* replaced by below-card controls */
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity .15s;
    z-index: 3;
    pointer-events: none;
}
.card-tile:hover .card-tile-controls { display:none; /* replaced by below-card controls */ opacity: 1; pointer-events: auto; }
.card-ctrl-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(14,28,47,.85);
    color: #F2F2F2;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    backdrop-filter: blur(4px);
}
.card-ctrl-btn:hover { background: #E6A63C; color: #000; border-color: #E6A63C; }
.card-ctrl-btn.disabled { opacity: .3; pointer-events: none; }
.card-ctrl-qty {
    min-width: 20px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: #E6A63C;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.card-qty-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #4ade80;
    color: #000;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 2;
}

/* ─── Floating Card Preview ─── */
.card-preview {
    position: fixed;
    z-index: 1000;
    width: 250px;
    background: #15263A;
    border: 2px solid #E6A63C;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
}
.card-preview.visible { opacity: 1; }
.card-preview img { width: 100%; display: block; }
.card-preview .preview-info { padding: 8px 10px; }
.card-preview .preview-name { font-family:'BeaufortBold'; font-size: .9rem; color: #E6A63C; margin-bottom: 3px; }
.card-preview .preview-meta { font-size: .7rem; color: #93E1FF; margin-bottom: 2px; }
.card-preview .preview-text { font-size: .7rem; color: #ccc; margin-top: 4px; line-height: 1.3; max-height: 80px; overflow-y: auto; }

/* ─── Deck Panel (right side) ─── */
.deck-panel { width:480px; background:#12213A; display:flex; flex-direction:column; overflow:hidden; }
.deck-panel-header { padding:.75rem; border-bottom:1px solid #2a3f5a; }
.deck-panel-header input { width:100%; padding:8px 10px; background:#0E1C2F; border:1px solid #2a3f5a; border-radius:6px; color:#F2F2F2; font-size:.9rem; font-family:'BeaufortBold'; }
.deck-panel-header input:focus { border-color:#E6A63C; outline:none; }

.deck-stats { padding:.6rem .85rem; background:#0a1525; display:flex; gap:1rem; flex-wrap:wrap; font-size:.85rem; border-bottom:1px solid #2a3f5a; }
.deck-stats .stat { color:#888; }
.deck-stats .stat span { color:#E6A63C; font-weight:700; }

.deck-cards-list { flex:1; overflow-y:auto; padding:.4rem .5rem; }
.deck-section-title { font-family:'BeaufortBold'; font-size:.8rem; color:#E6A63C; padding:.3rem 0; margin-top:.4rem; border-bottom:1px solid #1a3050; }
.deck-card-row { display:flex; align-items:center; padding:4px 8px; border-radius:4px; font-size:.85rem; gap:6px; }
.deck-card-row:hover { background:#1a3050; }
.deck-card-row .card-qty { display:flex; align-items:center; gap:2px; }
.deck-card-row .card-qty button { background:#1a3050; border:1px solid #2a3f5a; color:#F2F2F2; width:22px; height:22px; border-radius:4px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.75rem; }
.deck-card-row .card-qty button:hover { background:#E6A63C; color:#000; }
.deck-card-row .card-qty .qty-num { min-width:14px; text-align:center; font-weight:700; color:#E6A63C; font-size:.8rem; }
.deck-card-row .card-info { flex:1; display:flex; align-items:baseline; gap:6px; }
.deck-card-row .card-info .cname { color:#F2F2F2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.deck-card-row .card-info .ctype { font-size:.7rem; color:#888; white-space:nowrap; }
.deck-card-row .btn-remove { background:none; border:none; color:#666; cursor:pointer; font-size:.85rem; padding:0 2px; }
.deck-card-row .btn-remove:hover { color:#ff6b6b; }

/* ─── Validation ─── */
.validation-panel { padding:.5rem .75rem; border-top:1px solid #2a3f5a; max-height:120px; overflow-y:auto; font-size:.75rem; }
.validation-panel .error { color:#ff6b6b; }
.validation-panel .warning { color:#f59e0b; }

/* ─── Action Bar ─── */
.action-bar { padding:.5rem .75rem; border-top:1px solid #2a3f5a; display:flex; gap:4px; flex-wrap:wrap; }
.action-bar button { padding:5px 10px; border-radius:6px; border:1px solid #2a3f5a; background:#1a3050; color:#aaa; font-size:.72rem; cursor:pointer; }
.action-bar button:hover { border-color:#E6A63C; color:#E6A63C; }
.action-bar .btn-primary { background:#E6A63C; color:#000; border-color:#E6A63C; font-weight:600; }
.action-bar .btn-primary:hover { background:#d4b87a; }
.action-bar select { padding:5px 8px; background:#0E1C2F; border:1px solid #2a3f5a; border-radius:6px; color:#F2F2F2; font-size:.72rem; }

/* ─── Suggestions ─── */
.suggestions-panel { padding:.5rem .75rem; border-top:1px solid #2a3f5a; max-height:200px; overflow-y:auto; }
.suggestions-panel h3 { font-family:'BeaufortBold'; font-size:.85rem; color:#93E1FF; margin-bottom:.4rem; }
.suggestions-list { display:grid; grid-template-columns:1fr 1fr; gap:2px 8px; }
.suggestion-item { display:flex; align-items:center; gap:6px; padding:3px 6px; border-radius:4px; cursor:pointer; font-size:.8rem; }
.suggestion-item:hover { background:#1a3050; }
.suggestion-item .sug-reason { color:#888; font-size:.7rem; }

/* ─── Welcome / Login ─── */
.welcome-screen { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100vh; text-align:center; }
.welcome-screen h1 { font-family:'BeaufortBold'; font-size:2.5rem; color:#E6A63C; margin-bottom:1rem; }
.welcome-screen p { color:#888; max-width:500px; margin-bottom:2rem; }
.btn-google { display:inline-flex; align-items:center; gap:.5rem; background:#fff; color:#333; border:none; padding:12px 24px; border-radius:8px; font-size:1rem; font-weight:600; cursor:pointer; text-decoration:none; }
.btn-google:hover { background:#eee; }
.btn-google svg { width:20px; height:20px; }

/* ─── Public Decks ─── */
.public-decks-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1rem; padding:1rem; overflow-y:auto; }
.public-deck-card { background:#15263A; border:1px solid #2a3f5a; border-radius:10px; padding:1rem; cursor:pointer; transition:border-color .2s; }
.public-deck-card:hover { border-color:#E6A63C; }
.public-deck-card h3 { font-family:'BeaufortBold'; color:#E6A63C; font-size:1rem; margin-bottom:.3rem; }
.public-deck-card .pdc-meta { font-size:.8rem; color:#888; }
.public-deck-card .pdc-stats { display:flex; gap:1rem; font-size:.75rem; color:#93E1FF; margin-top:.5rem; }
.btn-clone { background:#E6A63C; color:#000; border:none; padding:5px 12px; border-radius:6px; font-size:.75rem; font-weight:600; cursor:pointer; margin-top:.5rem; }
.btn-clone:hover { background:#d4b87a; }

/* ─── Modal ─── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:100; justify-content:center; align-items:center; }
.modal-overlay.open { display:flex; }
.modal-content { background:#15263A; border:1px solid #2a3f5a; border-radius:12px; padding:1.5rem; max-width:500px; width:95%; }
.modal-content h2 { font-family:'BeaufortBold'; color:#E6A63C; margin-bottom:1rem; }
.modal-content label { font-size:.85rem; color:#aaa; display:block; margin-top:.75rem; }
.modal-content input, .modal-content select { width:100%; padding:8px; background:#0E1C2F; border:1px solid #2a3f5a; border-radius:6px; color:#F2F2F2; margin-top:4px; }
.modal-content .modal-actions { display:flex; gap:.5rem; margin-top:1.5rem; justify-content:flex-end; }
.modal-content .modal-actions button { padding:8px 16px; border-radius:6px; border:none; cursor:pointer; font-weight:600; }
.modal-content .btn-cancel { background:#333; color:#aaa; }
.modal-content .btn-confirm { background:#E6A63C; color:#000; }

/* ─── Responsive ─── */

/* Mobile toggle button (hidden on desktop) */
.mobile-view-toggle {
    display: none;
    position: fixed;
    bottom: 72px;
    right: 16px;
    z-index: 90;
    background: #E6A63C;
    color: #000;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    line-height: 1;
}

/* Tablet */
@media (max-width:1100px) {
    .sidebar { width:220px; }
    .deck-panel { width:400px; }
}

@media (max-width:900px) {
    .sidebar { width:200px; }
    .deck-panel { width:360px; }
    .analytics-grid { grid-template-columns: 1fr; }
    .suggestions-list { grid-template-columns: 1fr; }
}

/* ─── Mobile: <=768px ─── */
@media (max-width:768px) {
    .topbar {
        padding: .5rem .75rem;
        gap: 6px;
    }
    .topbar-left { gap: .75rem; }
    .topbar-left h1 { font-size: 1rem; white-space: nowrap; }
    .topbar-nav { display: none; }
    .topbar-right .user-name { display: none; }
    .topbar-right img { width: 28px; height: 28px; }
    .topbar-right .btn-logout { font-size: .7rem; padding: 3px 8px; }

    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 44px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Sidebar becomes horizontal strip */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #2a3f5a;
        overflow: visible;
        flex-shrink: 0;
    }
    .sidebar-header {
        padding: .5rem .75rem;
    }
    .sidebar-header h2 { font-size: .9rem; }
    .sidebar-tabs button { padding: .4rem .5rem; font-size: .75rem; }
    .deck-list {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding: .4rem .5rem;
        scrollbar-width: none;
    }
    .deck-list::-webkit-scrollbar { display: none; }
    .deck-item {
        flex-shrink: 0;
        min-width: 160px;
        max-width: 200px;
        padding: .4rem .6rem;
        margin-bottom: 0;
        border: 1px solid #2a3f5a;
        border-radius: 8px;
    }
    .deck-item.active { border-color: #E6A63C; border-left: 1px solid #E6A63C; }
    .deck-item .deck-legend-icon { width: 40px; height: 40px; }
    .deck-item .deck-info .deck-name { font-size: .8rem; }
    .deck-item .deck-info .deck-meta { font-size: .7rem; }

    /* Main area stacks vertically */
    .main-area {
        flex-direction: column;
        overflow: visible;
        min-height: 0;
    }

    /* Card browser */
    .card-browser {
        border-right: none;
        overflow: visible;
        height: auto;
    }
    .card-browser.mobile-hidden { display: none; }
    .browser-header { padding: .5rem; }
    .browser-tabs { gap: 3px; margin-bottom: .4rem; flex-wrap: wrap; }
    .browser-tabs button { padding: 3px 8px; font-size: .7rem; }
    .browser-filters { gap: 4px; }
    .browser-filters input, .browser-filters select { font-size: .75rem; padding: 4px 6px; }
    .browser-filters input { min-width: 100px; }
    .card-grid {
        overflow: visible;
        max-height: none;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 4px;
        padding: .4rem;
    }

    /* Deck panel goes full width below */
    .deck-panel {
        width: 100%;
        overflow: visible;
        border-top: 2px solid #E6A63C;
    }
    .deck-panel.mobile-hidden { display: none; }
    .deck-cards-list {
        overflow: visible;
        max-height: none;
    }
    .deck-stats { font-size: .75rem; padding: .4rem .6rem; gap: .5rem; }
    .action-bar { padding: .4rem .5rem; gap: 3px; }
    .action-bar button { font-size: .65rem; padding: 4px 8px; }
    .action-bar select { font-size: .65rem; }

    /* Show mobile toggle FAB */
    .mobile-view-toggle { display: flex; align-items: center; justify-content: center; }

    /* Card tile footer controls */
    .card-tile-below-controls button { width: 22px; height: 22px; font-size: .7rem; }
    .card-tile-footer { padding: 2px 4px; }
    .card-tile-name { font-size: .65rem; }
    .card-tile-detail-btn button { font-size: .6rem; padding: 1px 4px; }

    /* Guest deck view */
    .guest-deck-view {
        overflow: visible;
        padding: 12px;
    }
    .guest-deck-view.gdv-two-col {
        flex-direction: column;
    }
    .gdv-right {
        width: 100%;
        position: static;
        max-height: none;
    }
    .gdv-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 4px;
    }
    .gdv-card-label { font-size: .55rem; }
    .gdv-card-badge { font-size: .55rem; padding: 1px 3px; }
    .gdv-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .gdv-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Modals */
    .modal-content { width: 95%; max-width: 95vw; padding: 1rem; }
    .modal-content h2 { font-size: 1.1rem; }

    /* Card preview disabled on mobile */
    .card-preview { display: none !important; }

    /* Public decks grid */
    .public-decks-grid { grid-template-columns: 1fr; padding: .5rem; gap: .5rem; }
}

/* ─── Small phones: <=480px ─── */
@media (max-width:480px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 3px;
    }
    .deck-item { min-width: 140px; }
    .browser-tabs button { padding: 2px 6px; font-size: .65rem; }
    .login-prompt { font-size: .65rem; }
}

/* ─── Battlefield Cards: Landscape Rotation ─── */
.card-tile.battlefield-card .card-tile-img-wrap {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
/* Only rotate portrait battlefield images (OGN/SFD) */
.card-tile.bf-portrait .card-tile-img-wrap img {
    transform: rotate(90deg) scale(1.4);
    transform-origin: center center;
}
/* UNL landscape battlefields display natively */
.card-tile.bf-landscape .card-tile-img-wrap img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ─── Landscape Preview for Battlefields ─── */
.card-preview.landscape {
    width: 480px;
}
.card-preview.landscape .preview-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1.4 / 1;
    overflow: hidden;
}
.card-preview.landscape .preview-img-wrap img {
    position: absolute;
    top: 50%; left: 50%;
    width: auto;
    height: 140%;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    object-fit: cover;
}
/* UNL landscape battlefields — no rotation needed */
.card-preview.landscape-native {
    width: 480px;
}
.card-preview.landscape-native img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ─── Zoom Slider ─── */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 .5rem;
    font-size: .7rem;
    color: #888;
}
.zoom-control label { white-space: nowrap; }
.zoom-control input[type=range] {
    width: 100px;
    accent-color: #E6A63C;
    cursor: pointer;
}

/* ─── Phase 2: Public Deck Gallery Cards ─── */
.public-deck-card {
    background: #1e293b;
    border: 1px solid #2a3f56;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.public-deck-card:hover { border-color: #E6A63C; background: #253348; }
.public-deck-card.active { border-color: #E6A63C; background: #253348; }

.pdc-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.pdc-legend-img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #3a4f66;
}
.pdc-legend-placeholder {
    width: 50px;
    height: 70px;
    background: #2a3f56;
    border-radius: 4px;
}
.pdc-info { flex: 1; min-width: 0; }
.pdc-name {
    font-weight: bold;
    color: #E6A63C;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdc-author { color: #888; font-size: .7rem; }
.pdc-legend { color: #93E1FF; font-size: .72rem; margin-top: 2px; }

.pdc-stats {
    display: flex;
    gap: 12px;
    font-size: .7rem;
    color: #aaa;
    padding: 4px 0;
    border-top: 1px solid #2a3f56;
    border-bottom: 1px solid #2a3f56;
    margin: 4px 0;
}
.pdc-stats span { display: flex; align-items: center; gap: 3px; }

.pdc-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.pdc-btn {
    flex: 1;
    padding: 4px 0;
    border: 1px solid #3a4f66;
    border-radius: 4px;
    background: transparent;
    color: #ccc;
    font-size: .72rem;
    cursor: pointer;
    transition: all .2s;
}
.pdc-btn:hover { background: #2a3f56; }
.pdc-btn-view { border-color: #93E1FF; color: #93E1FF; }
.pdc-btn-view:hover { background: rgba(147,225,255,.1); }
.pdc-btn-clone { border-color: #E6A63C; color: #E6A63C; }
.pdc-btn-clone:hover { background: rgba(230,166,60,.1); }

/* ─── Domain Hint ─── */
.domain-hint {
    padding: 4px 10px;
    background: rgba(230,166,60,.1);
    border: 1px solid rgba(230,166,60,.3);
    border-radius: 4px;
    color: #E6A63C;
    font-size: .75rem;
    margin-top: 6px;
}

/* ─── Lazy Sentinel ─── */
.lazy-sentinel {
    height: 1px;
    width: 100%;
}

/* ─── Login Prompt (guest topbar) ─── */
.login-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: #aaa;
}
.btn-google-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fff;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
    transition: box-shadow .2s;
}
.btn-google-sm:hover { box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ─── Enhanced Filters Layout ─── */
.browser-filters {
    flex-wrap: wrap;
    gap: 6px;
}
.browser-filters select {
    min-width: 70px;
    max-width: 110px;
    font-size: .72rem;
    padding: 4px 6px;
}
.db-reset-btn {
    background: #E6A63C;
    color: #0E1C2F;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.db-reset-btn:hover { background: #f0b84d; }
#costMin, #costMax, #powerMin, #mightMin {
    min-width: 65px;
    max-width: 85px;
}

/* ─── Guest Deck View (read-only dashboard) ─── */
.guest-deck-view {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}
.guest-deck-view.gdv-two-col {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.gdv-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.gdv-right {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    background: #0d1a2a;
    border: 1px solid #2a3f56;
    border-radius: 10px;
    padding: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    align-self: flex-start;
}
.gdv-right .analytics-grid {
    grid-template-columns: 1fr;
}
.gdv-right .analytics-full {
    grid-column: 1;
}
.gdv-header {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a3f56;
}
.gdv-images { display: flex; gap: 10px; }
.gdv-legend-img, .gdv-champ-img {
    width: 130px;
    height: 182px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #E6A63C;
}
.gdv-champ-img { border-color: #93E1FF; }
.gdv-info { flex: 1; }
.gdv-deck-name {
    font-family: 'BeaufortBold', Arial, sans-serif;
    font-size: 1.5rem;
    color: #E6A63C;
    margin: 0 0 4px 0;
}
.gdv-author { color: #888; font-size: .8rem; margin-bottom: 8px; }
.gdv-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .82rem;
    color: #93E1FF;
    margin-bottom: 8px;
}
.gdv-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .75rem;
    color: #aaa;
}
.gdv-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.gdv-actions button {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #3a4f66;
    color: #93E1FF;
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    transition: all .2s;
}
.gdv-actions button:hover { background: #1e293b; border-color: #93E1FF; }

.gdv-login-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(230,166,60,.08);
    border: 1px solid rgba(230,166,60,.25);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .8rem;
    color: #ccc;
}

.gdv-card-list { margin-top: 8px; }
.gdv-section-title {
    font-family: 'BeaufortBold', Arial, sans-serif;
    font-size: .85rem;
    color: #E6A63C;
    padding: 8px 0 4px;
    border-bottom: 1px solid #2a3f56;
    margin-bottom: 8px;
}

/* ─── Visual Card Grid in Guest Deck View ─── */
.gdv-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.gdv-card-tile {
    text-align: center;
    cursor: pointer;
}
.gdv-card-img-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2a3f56;
    transition: border-color .2s;
}
.gdv-card-tile:hover .gdv-card-img-wrap { border-color: #E6A63C; }
.gdv-card-img-wrap img {
    width: 100%;
    display: block;
}
.gdv-card-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #E6A63C;
    color: #000;
    font-size: .65rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
}
.gdv-card-label {
    font-size: .65rem;
    color: #ccc;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Legend Filter in Public Decks ─── */
.pdc-filter-bar {
    padding: 8px;
    border-bottom: 1px solid #2a3f56;
    margin-bottom: 4px;
}
.pdc-filter-bar select {
    width: 100%;
    background: #0d1a2a;
    color: #ddd;
    border: 1px solid #2a3f56;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: .78rem;
}

/* Keep old row styles for backward compat */
.gdv-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    font-size: .78rem;
    border-bottom: 1px solid rgba(42,63,86,.4);
}
.gdv-card-row:hover { background: rgba(147,225,255,.05); }
.gdv-qty { color: #E6A63C; font-weight: bold; min-width: 24px; }
.gdv-name { color: #ddd; flex: 1; }
.gdv-type { color: #888; font-size: .7rem; }

/* ─── Deck Analytics ─── */
.deck-analytics {
    padding: .5rem .75rem;
    border-bottom: 1px solid #2a3f5a;
    background: #0d1a2a;
}
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.analytics-grid .analytics-section { margin-bottom: 0; }
.analytics-full { grid-column: 1 / -1; }
.analytics-section {
    margin-bottom: 8px;
}
.analytics-section:last-child { margin-bottom: 0; }
.analytics-title {
    font-family: 'BeaufortBold', Arial, sans-serif;
    font-size: .85rem;
    color: #93E1FF;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.analytics-avg {
    font-size: .8rem;
    color: #E6A63C;
    font-weight: normal;
}
.analytics-price {
    font-size: .95rem;
    color: #4ade80;
    font-weight: bold;
}
.energy-curve {
    display: flex;
    justify-content: center;
    padding: 4px 0;
    overflow-x: auto;
}
.energy-curve svg { display: block; max-width: 100%; height: auto; }

.type-breakdown {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1a3050;
    border: 1px solid #2a3f5a;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .78rem;
}
.tc-label { color: #aaa; }
.tc-count { color: #E6A63C; font-weight: bold; }

.price-note {
    font-size: .6rem;
    color: #555;
    margin-top: 2px;
}

/* Card price in deck list */
.card-price {
    color: #4ade80;
    font-weight: 600;
}

/* ─── Power Curve ─── */
.power-curve {
    display: flex;
    justify-content: center;
    padding: 4px 0;
    overflow-x: auto;
}
.power-curve svg { display: block; max-width: 100%; height: auto; }

/* Hide hover preview on touch-only devices */
@media (hover: none) {
    .card-preview { display: none !important; }
}

/* ─── Confirm Delete Modal ─── */
.confirm-modal { max-width:400px; text-align:center; }
.confirm-modal h2 { color:#ff6b6b; }
.confirm-modal .modal-actions { justify-content:center; }
.btn-delete { background:#ff4444; color:#fff; padding:10px 24px !important; border-radius:6px; font-weight:700; transition:background .2s; }
.btn-delete:hover { background:#ff2222; }
.btn-cancel { padding:10px 24px !important; }

/* ─── Deck Visual Preview ─── */
.btn-preview { background:#E6A63C !important; color:#0E1C2F !important; font-weight:700; border-color:#E6A63C !important; }
.btn-preview:hover { background:#d4952e !important; }

#deckPreviewModal { overflow-y:auto; }

.preview-modal-content {
    background:#0E1C2F; border:1px solid #E6A63C; border-radius:16px;
    max-width:1100px; width:95%; max-height:90vh; overflow-y:auto;
    margin:2rem auto; padding:0; position:relative;
}
.preview-header {
    display:flex; justify-content:space-between; align-items:center;
    padding:1.2rem 1.5rem; border-bottom:1px solid #1e3450;
    background:linear-gradient(135deg, #15263A, #1a3050); border-radius:16px 16px 0 0;
    position:sticky; top:0; z-index:10;
}
.preview-header h2 { font-family:'BeaufortBold'; color:#E6A63C; margin:0; font-size:1.3rem; }
.preview-close {
    background:none; border:none; color:#888; font-size:2rem; cursor:pointer;
    line-height:1; padding:0 .3rem; transition:color .2s;
}
.preview-close:hover { color:#ff6b6b; }
.preview-body { padding:1rem 1.5rem 1.5rem; }
.preview-section { margin-bottom:1.5rem; }
.preview-section-title {
    font-family:'BeaufortBold'; color:#E6A63C; font-size:1rem;
    border-bottom:1px solid #1e3450; padding-bottom:.4rem; margin-bottom:.8rem;
}
.preview-grid {
    display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:.6rem;
}
.preview-card {
    position:relative; border-radius:8px; overflow:hidden;
    background:#15263A; border:1px solid #1e3450; transition:transform .15s, border-color .15s;
}
.preview-card:hover { transform:scale(1.05); border-color:#E6A63C; z-index:5; }
.preview-card img { width:100%; display:block; border-radius:7px 7px 0 0; }
.preview-card.landscape img { border-radius:7px; }
.preview-card-name {
    font-size:.7rem; color:#ccc; padding:3px 5px; text-align:center;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    background:#0E1C2F;
}
.preview-card.landscape .preview-card-name { display:none; }
.preview-card.landscape { aspect-ratio:1.4/1; }
.preview-card.landscape img { object-fit:cover; height:100%; }
.preview-qty {
    position:absolute; top:4px; right:4px;
    background:#E6A63C; color:#0E1C2F; font-weight:800; font-size:.75rem;
    padding:2px 6px; border-radius:10px; min-width:24px; text-align:center;
}
.preview-empty { color:#555; font-style:italic; padding:.5rem 0; }
.preview-section-bf .preview-grid { grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }

@media (max-width:320px) {
    .preview-grid { grid-template-columns:repeat(auto-fill, minmax(90px, 1fr)); gap:.4rem; }
    .preview-modal-content { margin:.5rem auto; border-radius:10px; }
    .preview-header { padding:.8rem 1rem; border-radius:10px 10px 0 0; }
    .preview-body { padding:.8rem; }
}

/* ─── Fix: Battlefield landscape in preview (rotate portrait only) ─── */
.preview-card.landscape {
    aspect-ratio: auto;
}
.preview-card.landscape img {
    object-fit: initial;
    height: auto;
    transform: rotate(90deg) scale(1.35);
    transform-origin: center center;
    margin: 50px 0;
}
/* UNL landscape battlefields in preview — no rotation */
.preview-card.landscape-native {
    aspect-ratio: auto;
}
.preview-card.landscape-native img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
}

/* ─── Card Tile Footer (name + controls) ─── */
.card-tile-img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 5px 5px 0 0;
    flex-shrink: 0;
}
.card-tile-img-wrap img {
    border-radius: 0;
}
.card-tile-footer {
    background: #0d1a2a;
    border-radius: 0 0 5px 5px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}
.card-tile-name {
    font-size: .65rem;
    color: #ddd;
    text-align: center;
    padding: 3px 4px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #1a2a40;
    line-height: 1.2;
}
.card-tile-below-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px;
}
.card-tile-below-controls .ctrl-minus,
.card-tile-below-controls .ctrl-plus {
    flex: 1;
    max-width: 36px;
    height: 26px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s;
}
.card-tile-below-controls .ctrl-minus {
    background: #c0392b;
    color: #fff;
}
.card-tile-below-controls .ctrl-minus:hover { background: #e74c3c; }
.card-tile-below-controls .ctrl-minus.disabled { opacity: .25; pointer-events: none; }
.card-tile-below-controls .ctrl-plus {
    background: #27ae60;
    color: #fff;
}
.card-tile-below-controls .ctrl-plus:hover { background: #2ecc71; }
.card-tile-below-controls .ctrl-qty {
    min-width: 20px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: #E6A63C;
}

/* Detail button row */
.card-tile-detail-btn {
    display: flex;
    justify-content: center;
    border-top: 1px solid #1a2a40;
    padding: 3px 2px;
}
.card-tile-detail-btn button {
    width: 100%;
    background: rgba(147,225,255,.08);
    border: 1px solid rgba(147,225,255,.2);
    color: #93E1FF;
    font-size: .68rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background .15s, color .15s;
    font-weight: 600;
}
.card-tile-detail-btn button:hover {
    background: #93E1FF;
    color: #0E1C2F;
}

/* ─── Mobile: bigger touch targets ─── */
@media (max-width: 480px), (hover: none) {
    .card-tile-below-controls {
        padding: 5px 3px;
        gap: 6px;
    }
    .card-tile-below-controls .ctrl-minus,
    .card-tile-below-controls .ctrl-plus {
        height: 34px;
        max-width: 44px;
        font-size: 1.2rem;
        border-radius: 6px;
    }
    .card-tile-below-controls .ctrl-qty {
        font-size: 1rem;
        min-width: 24px;
    }
    .card-tile-detail-btn button {
        padding: 7px 6px;
        font-size: .75rem;
    }
    .card-tile-name {
        font-size: .7rem;
        padding: 4px 4px 3px;
    }
}

/* ─── Card Detail Modal ─── */
#cardDetailModal { overflow-y: auto; }
.cd-modal-content {
    background: #0E1C2F;
    border: 1px solid #E6A63C;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 2rem auto;
    padding: 0;
    position: relative;
}
.cd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #15263A, #1a3050);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #1e3450;
    position: sticky;
    top: 0;
    z-index: 10;
}
.cd-header h2 {
    font-family: 'BeaufortBold';
    color: #E6A63C;
    margin: 0;
    font-size: 1.4rem;
}
.cd-close {
    background: none;
    border: none;
    color: #888;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 .3rem;
    transition: color .2s;
}
.cd-close:hover { color: #ff6b6b; }

.cd-body {
    display: flex;
    gap: 24px;
    padding: 1.5rem;
}
.cd-left {
    flex: 0 0 280px;
}
.cd-left img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.cd-left img.cd-battlefield.cd-bf-portrait {
    transform: rotate(90deg);
    transform-origin: center center;
    width: 60%;
    margin: 50px auto;
    display: block;
}
.cd-left img.cd-battlefield.cd-bf-landscape {
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.cd-right {
    flex: 1;
    min-width: 0;
}

/* Stats grid */
.cd-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.cd-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #15263A;
    border-radius: 6px;
    border: 1px solid #1e3450;
}
.cd-stat-label {
    color: #93E1FF;
    font-size: .8rem;
    font-weight: 600;
}
.cd-stat-value {
    color: #F2F2F2;
    font-weight: 700;
    font-size: .85rem;
}

/* Card text */
.cd-text-section {
    margin-bottom: 16px;
}
.cd-text-section h3 {
    font-family: 'BeaufortBold';
    color: #E6A63C;
    font-size: 1rem;
    margin-bottom: 6px;
}
.cd-text-section p {
    color: #ddd;
    line-height: 1.5;
    font-size: .85rem;
}

/* Errata */
.cd-errata {
    background: rgba(230,166,60,.08);
    border: 1px solid rgba(230,166,60,.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
}
.cd-errata h4 {
    color: #f59e0b;
    font-size: .8rem;
    margin-bottom: 4px;
}
.cd-errata p {
    color: #ccc;
    font-size: .8rem;
    line-height: 1.4;
}

/* CardMarket link */
.cd-actions {
    margin-bottom: 16px;
}
.cd-cm-link {
    display: inline-block;
    padding: 8px 18px;
    background: #66CCFF;
    color: #0E1C2F;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: .85rem;
    transition: background .2s;
}
.cd-cm-link:hover {
    background: #4FB8E8;
    text-decoration: none;
}

/* Price chart */
.cd-price-chart-wrap {
    margin-top: 16px;
}
.cd-price-chart-wrap h3 {
    font-family: 'BeaufortBold';
    color: #E6A63C;
    font-size: 1rem;
    margin-bottom: 8px;
}
#cd-price-chart {
    height: 300px;
    width: 100%;
    background: #0E1C2F;
    border-radius: 8px;
    padding: 8px;
    overflow: hidden;
}
.cd-price-note {
    font-size: .6rem;
    color: #555;
    margin-top: 4px;
}

@media (max-width: 480px) {
    .cd-body { flex-direction: column; gap: 12px; padding: 1rem; }
    .cd-left { flex: none; max-width: 200px; margin: 0 auto; }
    .cd-stats { grid-template-columns: 1fr; }
    .cd-modal-content { margin: .5rem auto; border-radius: 10px; }
}

/* ─── Registration Sheet Modal ─── */
.reg-modal {
    max-width: 520px;
    padding: 0;
    background: #15263A;
    border: 1px solid #2a3f5a;
    border-radius: 12px;
    overflow: hidden;
}
.reg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #2a3f5a;
}
.reg-header h2 {
    font-family: 'BeaufortBold';
    color: #F2F2F2;
    font-size: 1.3rem;
    margin: 0;
}
.reg-subtitle {
    color: #888;
    font-size: .78rem;
    margin: 2px 0 0 0;
}
.reg-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color .2s;
}
.reg-close:hover { color: #ff6b6b; }

.reg-deck-info {
    padding: .8rem 1.5rem;
    background: #0d1a2a;
    border-bottom: 1px solid #2a3f5a;
}
.reg-deck-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: .85rem;
}
.reg-label { color: #888; }
.reg-value { color: #F2F2F2; font-weight: 600; }

.reg-section-title {
    padding: .7rem 1.5rem 0;
    color: #888;
    font-size: .7rem;
    letter-spacing: .05em;
    font-weight: 600;
}
.reg-required { color: #e04848; }

.reg-row {
    display: flex;
    gap: 10px;
    padding: 6px 1.5rem 0;
}
.reg-row .reg-input { flex: 1; }

.reg-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #0d1a2a;
    border: 1px solid #2a3f5a;
    border-radius: 6px;
    color: #F2F2F2;
    font-size: .85rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.reg-input:focus { border-color: #E6A63C; }
.reg-input::placeholder { color: #555; }
.reg-full { margin: 6px 1.5rem 0; width: calc(100% - 3rem); }

.reg-select {
    appearance: auto;
    cursor: pointer;
}
.reg-select option { background: #15263A; color: #F2F2F2; }

.reg-champion-hint {
    padding: 2px 1.5rem;
    color: #888;
    font-size: .68rem;
    font-style: italic;
}

.reg-actions {
    display: flex;
    gap: 10px;
    padding: 1rem 1.5rem 1.2rem;
    align-items: center;
}
.reg-download-text {
    background: #0d1a2a;
    border: 1px solid #2a3f5a;
    color: #aaa;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
}
.reg-download-text:hover { border-color: #E6A63C; color: #E6A63C; }

.reg-download-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #E6A63C, #d4952e);
    color: #0E1C2F;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s;
}
.reg-download-btn:hover { opacity: .9; }

@media (max-width: 480px) {
    .reg-modal { max-width: 95%; }
    .reg-row { flex-direction: column; gap: 6px; }
}

/* Discord login button (small) */
.btn-discord-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #5865F2;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
    transition: box-shadow .2s;
}
.btn-discord-sm:hover { box-shadow: 0 2px 8px rgba(88,101,242,.5); background: #4752C4; }
.btn-discord-sm svg { width: 16px; height: 16px; }

/* Discord login button (large, for login page) */
.btn-discord { display:inline-flex; align-items:center; gap:.5rem; background:#5865F2; color:#fff; border:none; padding:12px 24px; border-radius:8px; font-size:1rem; font-weight:600; cursor:pointer; text-decoration:none; }
.btn-discord:hover { background:#4752C4; }
.btn-discord svg { width:20px; height:20px; }

/* Auth buttons container */
.auth-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-divider { color: #666; font-size: .75rem; }

/* Auth Choice Modal */
.auth-modal { max-width:360px; text-align:center; position:relative; }
.auth-modal h2 { color:#E6A63C; }
.auth-modal-buttons { display:flex; flex-direction:column; gap:12px; }
.auth-modal-buttons a { display:flex; align-items:center; justify-content:center; gap:.5rem; padding:14px 24px; border-radius:8px; font-size:1rem; font-weight:600; text-decoration:none; transition: all .2s; }
.auth-modal-close { position:absolute; top:12px; right:16px; background:none; border:none; color:#888; font-size:1.5rem; cursor:pointer; line-height:1; }
.auth-modal-close:hover { color:#fff; }

/* Curve color legend */
.curve-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: .7rem; color: #aaa; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ─── Color filter icon buttons ─── */
.db-color-filters {
  display: flex;
  align-items: center;
  gap: 4px;
}
.db-color-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
  opacity: 0.6;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}
.db-color-btn img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.db-color-btn:hover { transform: scale(1.15); opacity: 1; }
.db-color-btn.active { border-color: #E6A63C; transform: scale(1.15); opacity: 1; }

/* ═══════════════════════════════════════════════════════════════ */
/* ─── Hand Simulator Modal ─── */
/* ═══════════════════════════════════════════════════════════════ */
.hs-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.hs-modal {
    background: #12213A;
    border: 2px solid #E6A63C;
    border-radius: 14px;
    width: 90%; max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 12px 48px rgba(0,0,0,.6);
}
.hs-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2A3F56;
}
.hs-header h2 {
    font-family: 'BeaufortBold', sans-serif;
    color: #E6A63C; margin: 0; font-size: 1.25rem;
}
.hs-header-right {
    display: flex; align-items: center; gap: 12px;
}
.hs-remaining {
    color: #93E1FF; font-size: .85rem;
}
.hs-close {
    background: none; border: none; color: #93E1FF;
    font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.hs-close:hover { color: #FF6B6B; }
.hs-draw-info {
    padding: 8px 20px;
    color: #8899AA; font-size: .8rem;
    border-bottom: 1px solid #1a2e44;
}
.hs-hand {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 14px; padding: 20px;
}
.hs-card {
    position: relative;
    width: 130px;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    background: #0E1C2E;
}
.hs-card:hover { transform: scale(1.04); }
.hs-card img {
    width: 100%; display: block; border-radius: 7px 7px 0 0;
}
.hs-card-name {
    padding: 5px 6px;
    font-size: .7rem; color: #ccc;
    text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-card-selected {
    border-color: #FF6B6B;
    box-shadow: 0 0 16px rgba(255,107,107,.4);
}
.hs-card-selected img { opacity: .55; }
.hs-card-mulligan-badge {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,60,60,.9);
    color: #fff; font-weight: 700;
    font-size: .7rem; padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.hs-mulligan-hint {
    text-align: center;
    color: #E6A63C; font-size: .85rem;
    padding: 6px 20px 0;
}
.hs-actions {
    display: flex; justify-content: center;
    gap: 12px;
    padding: 14px 20px 20px;
}
.hs-btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    border: 2px solid;
    transition: background .15s, border-color .15s;
}
.hs-btn-confirm {
    background: #E6A63C; border-color: #E6A63C; color: #0E1C2E;
}
.hs-btn-confirm:hover { background: #d4952e; }
.hs-btn-draw {
    background: #1a3050; border-color: #93E1FF; color: #93E1FF;
}
.hs-btn-draw:hover { background: #244060; }
.hs-btn-draw:disabled { opacity: .4; cursor: not-allowed; }
.hs-btn-new {
    background: none; border-color: #93E1FF; color: #93E1FF;
    padding: 6px 14px; font-size: .8rem;
}
.hs-btn-new:hover { background: #1a3050; }

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .hs-modal { width: 96%; border-radius: 10px; }
    .hs-card { width: 100px; }
    .hs-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .hs-header-right { width: 100%; justify-content: space-between; }
}

/* Hand Simulator trigger button */
.btn-handsim {
    background: #1a3050 !important;
    color: #93E1FF !important;
    border-color: #93E1FF !important;
    font-weight: 700;
}
.btn-handsim:hover {
    background: #244060 !important;
    border-color: #E6A63C !important;
    color: #E6A63C !important;
}

/* Share button */
.btn-share {
    background: #2d5a3d !important;
    color: #7dffaa !important;
    border-color: #7dffaa !important;
    font-weight: 700;
}
.btn-share:hover {
    background: #3a7a50 !important;
    border-color: #E6A63C !important;
    color: #E6A63C !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   Tournament Decks Feature - Card Detail Modal
   ════════════════════════════════════════════════════════════════════════════ */

.cd-tournament-decks {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.td-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f0f0f0;
}

.td-loading, .td-empty, .td-error {
    padding: 1rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

.td-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.td-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.td-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.td-legend-img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.td-info {
    flex: 1;
    min-width: 0;
}

.td-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.35rem;
}

.td-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.td-colors {
    display: flex;
    gap: 0.25rem;
}


.td-domain-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}
.td-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.td-color-fury { background: #e74c3c; }
.td-color-mind { background: #3498db; }
.td-color-order { background: #f39c12; }
.td-color-nature { background: #27ae60; }
.td-color-shadow { background: #9b59b6; }
.td-color-void { background: #7f8c8d; }

.td-stats {
    color: #999;
}

.td-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.td-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.td-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.td-btn-view {
    border-color: rgba(52, 152, 219, 0.5);
}

.td-btn-view:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.td-btn-import {
    border-color: rgba(46, 204, 113, 0.5);
}

.td-btn-import:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

/* ════════════════════════════════════════════════════════════════════════════
   Deck Preview Nested Modal
   ════════════════════════════════════════════════════════════════════════════ */

.dpn-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.dpn-modal.open {
    display: flex;
}

.dpn-content {
    background: #1a1a2e;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dpn-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dpn-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.dpn-meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.dpn-stats {
    color: #2ecc71;
    font-size: 0.85rem;
}

.dpn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 28px;
    transition: color 0.2s;
}

.dpn-close:hover {
    color: #fff;
}

.dpn-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.dpn-legend {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dpn-legend img {
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dpn-section {
    margin-bottom: 1.5rem;
}

.dpn-section h4 {
    margin: 0 0 0.75rem 0;
    color: #3498db;
    font-size: 1rem;
}

.dpn-cards {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dpn-card {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
}

.dpn-card-count {
    width: 30px;
    color: #f39c12;
    font-weight: 600;
    flex-shrink: 0;
}

.dpn-card-name {
    flex: 1;
}

.dpn-card-cost {
    width: 30px;
    text-align: right;
    color: #999;
    flex-shrink: 0;
}

.dpn-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ════════════════════════════════════════════════════════════════════════════
   Toast Notification
   ════════════════════════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2ecc71;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ════════════════════════════════════════════════════════════════════════════
   Responsive Adjustments
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .td-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .td-legend-img {
        align-self: center;
    }
    
    .td-actions {
        width: 100%;
    }
    
    .td-btn {
        flex: 1;
    }
    
    .dpn-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 4.5rem;
    }
}


/* Placeholder for missing legend */
.td-no-legend {
    width: 40px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 20px;
    flex-shrink: 0;
}


/* ─── Guest Deck View: Right Sidebar Scrollbar ─── */
.gdv-right::-webkit-scrollbar { width: 5px; }
.gdv-right::-webkit-scrollbar-track { background: transparent; }
.gdv-right::-webkit-scrollbar-thumb { background: #2a3f56; border-radius: 3px; }
.gdv-right::-webkit-scrollbar-thumb:hover { background: #3a5070; }

/* ─── Guest Deck View: Suggested Cards ─── */
.gdv-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gdv-suggest-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}
.gdv-suggest-card:hover { background: rgba(147,225,255,.08); }
.gdv-suggest-card img {
    width: 36px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #2a3f56;
    flex-shrink: 0;
}
.gdv-suggest-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gdv-suggest-name {
    font-size: .78rem;
    color: #E6A63C;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gdv-suggest-reason {
    font-size: .68rem;
    color: #888;
    line-height: 1.3;
}

/* ─── Guest Deck View: Responsive Two-Column Collapse ─── */
@media (max-width: 900px) {
    .guest-deck-view.gdv-two-col {
        flex-direction: column;
    }
    .gdv-right {
        width: 100%;
        position: static;
        max-height: none;
    }
}
