/* ═══════════════════════════════════════════════════════════════════
   COMPONENTS CSS - Buttons, Cards, Modals, Forms
   Token Clash Mobile-First SPA
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: #000;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.875rem;
    min-height: var(--min-touch-target);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    min-height: 32px;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

/* Button variants */
.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    color: #000;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
    color: #fff;
}

.btn-purple {
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-purple-dark) 100%);
    color: #fff;
}

.btn-blue {
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-dark) 100%);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Back button for screen headers */
.btn-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    min-height: 36px;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ─────────────────────────────────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────────────────────────────────── */
input, select, textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    width: 100%;
    font-size: 1rem;
    min-height: var(--min-touch-target);
    transition: border-color var(--transition-fast);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

select {
    cursor: pointer;
}

select option {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
}

/* ─────────────────────────────────────────────────────────────────────
   PANELS / CARDS
   ───────────────────────────────────────────────────────────────────── */
.panel {
    background: var(--color-bg-panel);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.panel-header {
    color: var(--color-gold);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: var(--spacing-sm);
}

.panel-dark {
    background: var(--color-bg-dark);
}

/* ─────────────────────────────────────────────────────────────────────
   GAME CARDS
   ───────────────────────────────────────────────────────────────────── */
.game-card {
    background: linear-gradient(135deg, #2a2a4a 0%, var(--color-bg-primary) 100%);
    border: 2px solid #555;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    width: 100px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
}

.game-card.selected {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 20px rgba(68, 255, 68, 0.7) !important;
}

.game-card.attacker { border-left: 4px solid var(--color-attacker); }
.game-card.defender { border-left: 4px solid var(--color-defender); }
.game-card.hybrid { border-left: 4px solid var(--color-hybrid); }

.game-card-cost {
    background: var(--color-gold);
    color: #000;
    border-radius: var(--radius-round);
    width: 20px;
    height: 20px;
    line-height: 20px;
    margin: 0 auto var(--spacing-xs);
    font-weight: bold;
    font-size: 0.7rem;
}

.game-card-name {
    font-size: 0.55rem;
    font-weight: bold;
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-stats {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────────────────────────────
   COLLECTION CARDS
   ───────────────────────────────────────────────────────────────────── */
.collection-card {
    background: linear-gradient(135deg, #2a2a4a 0%, #0d0d1a 100%);
    border: 2px solid #444;
    border-radius: var(--radius-lg);
    padding: 0;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.collection-card.common  { border-color: #666; }
.collection-card.rare    { border-color: #4a9eff; box-shadow: 0 0 8px rgba(74, 158, 255, 0.4); }
.collection-card.epic    { border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, 0.5); animation: epicPulse 3s ease-in-out infinite; }
.collection-card.legendary { border-color: var(--color-legendary); animation: legendaryGlow 2s ease-in-out infinite; }
.collection-card.no-art  { background: linear-gradient(135deg, #2a2a4a 0%, #0d0d1a 100%); }

/* ── Rarity inner-frame overlay (decorative inset border over art) ── */
.collection-card::after,
.library-card::after,
.deck-card-mini::after,
.forge-card::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--radius-lg) - 3px);
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Common: no frame overlay */
.collection-card.common::after,
.library-card.common::after,
.deck-card-mini.common::after,
.forge-card.common::after { opacity: 0; }

/* Rare: thin blue inner frame */
.collection-card.rare::after,
.library-card.rare::after,
.deck-card-mini.rare::after,
.forge-card.rare::after {
    border: 1px solid rgba(74, 158, 255, 0.5);
    box-shadow: inset 0 0 8px rgba(74, 158, 255, 0.2);
    opacity: 1;
}

/* Epic: purple inner frame with corner accents via gradient */
.collection-card.epic::after,
.library-card.epic::after,
.deck-card-mini.epic::after,
.forge-card.epic::after {
    border: 1px solid rgba(168, 85, 247, 0.6);
    box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.25),
                inset 0 0 2px rgba(168, 85, 247, 0.8);
    opacity: 1;
}

/* Legendary: gold inner frame with shimmer */
.collection-card.legendary::after,
.library-card.legendary::after,
.deck-card-mini.legendary::after,
.forge-card.legendary::after {
    border: 1px solid rgba(255, 215, 0, 0.7);
    box-shadow: inset 0 0 16px rgba(255, 215, 0, 0.3),
                inset 0 0 3px rgba(255, 215, 0, 0.9);
    background: linear-gradient(135deg,
        rgba(255,215,0,0.07) 0%, transparent 30%,
        transparent 70%, rgba(255,215,0,0.07) 100%);
    opacity: 1;
    animation: legendaryFrameShimmer 3s ease-in-out infinite;
}

@keyframes legendaryFrameShimmer {
    0%, 100% { box-shadow: inset 0 0 16px rgba(255,215,0,0.3), inset 0 0 3px rgba(255,215,0,0.9); }
    50%       { box-shadow: inset 0 0 24px rgba(255,215,0,0.5), inset 0 0 5px rgba(255,215,0,1); }
}

/* Art fills card — contain shows full square images without cropping */
.collection-card-bg-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
    background: #0d0d1a;
}

/* Top strip: ID + badges */
.collection-card-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 5px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
    z-index: 2;
}

.collection-card-id {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.6);
}

.collection-card-count {
    background: var(--color-gold);
    color: #000;
    font-size: 0.55rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: var(--radius-lg);
}

/* Bottom overlay */
.collection-card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    padding: 5px 5px 4px;
    z-index: 2;
}

.collection-card-name {
    font-size: 0.65rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
    line-height: 1.2;
    margin-bottom: 2px;
}

.collection-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.58rem;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,1);
}

.collection-card-rarity { display: none; }

/* Transaction card styles */
.collection-card.transaction-type {
    border-color: #44ffaa;
    box-shadow: 0 0 10px rgba(68, 255, 170, 0.3);
}

.collection-card-tx-badge {
    background: #44ffaa;
    color: #000;
    font-size: 0.5rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
}

.tx-label {
    color: #44ffaa;
    font-weight: bold;
}

.deck-card-mini.transaction-type {
    border-color: #44ffaa;
    box-shadow: 0 0 6px rgba(68, 255, 170, 0.25);
}

/* Transaction card detail modal */
.card-detail-modal.tx-detail {
    border-color: #44ffaa;
}

.tx-badge-detail {
    background: #44ffaa;
    color: #000;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.transaction-type-tag {
    background: #44ffaa;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.tx-ability-large .card-detail-ability-text {
    font-size: 1rem;
    line-height: 1.4;
}

.collection-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    margin-bottom: 4px;
}

.collection-card-role {
    font-size: 0.55rem;
    color: var(--color-text-muted);
    text-align: center;
}

.collection-card-ability {
    font-size: 0.55rem;
    color: var(--color-purple);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Starter Card Styles (permanent virtual cards, never tradeable) */
.collection-card.starter {
    border-color: #666 !important;
    box-shadow: none !important;
}

.collection-card.starter::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.15) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* Forge overlay - centered on card image for unforged starter cards */
.collection-card-forge-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: pulse-forge 2s infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes pulse-forge {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* Off-chain card styling (starter cards not yet forged) */
.collection-card.off-chain {
    border-color: rgba(156, 39, 176, 0.5) !important;
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.2);
}

.collection-card.off-chain::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.1) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* ─────────────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: linear-gradient(135deg, #2a2a4a 0%, var(--color-bg-primary) 100%);
    border: 3px solid var(--color-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text-primary);
}

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

/* ─────────────────────────────────────────────────────────────────────
   ONBOARDING MODAL
   ───────────────────────────────────────────────────────────────────── */
.onboarding-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.2s ease-out;
}

.onboarding-modal {
    background: linear-gradient(135deg, #2a2a4a 0%, var(--color-bg-primary) 100%);
    border: 3px solid var(--color-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 100%;
    animation: scaleIn 0.2s ease-out;
}

.onboarding-modal h2 {
    color: var(--color-gold);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.onboarding-content {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.onboarding-content p {
    margin-bottom: var(--spacing-sm);
}

.onboarding-content ol {
    margin-left: var(--spacing-lg);
    margin-top: var(--spacing-sm);
}

.onboarding-content li {
    margin-bottom: var(--spacing-xs);
}

.onboarding-content strong {
    color: var(--color-gold);
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.onboarding-action-btn {
    width: 100%;
}

.onboarding-close-btn {
    width: 100%;
    background: var(--color-bg-panel);
    color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────────────────────────────
   POST-TUTORIAL HINT MODAL
   ───────────────────────────────────────────────────────────────────── */
.post-tutorial-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease-out;
}

.post-tutorial-modal {
    background: linear-gradient(135deg, #1a1a3a 0%, var(--color-bg-primary) 100%);
    border: 3px solid var(--color-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.post-tutorial-modal-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: bounce 1s ease-in-out infinite;
}

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

.post-tutorial-modal-title {
    color: var(--color-gold);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.post-tutorial-modal-text {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.post-tutorial-modal-info {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.post-tutorial-modal-info p {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-xs);
}

.post-tutorial-modal-info p:last-child {
    margin-bottom: 0;
}

.post-tutorial-modal-info strong {
    color: var(--color-gold);
}

.post-tutorial-modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.post-tutorial-modal-actions .btn {
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    border-left: 4px solid var(--color-gold);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.toast.success { border-color: var(--color-success); }
.toast.error { border-color: var(--color-danger); }
.toast.warning { border-color: var(--color-gold-dark); }

/* Mobile: full width toasts at bottom */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: calc(var(--nav-height) + var(--spacing-lg));
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        max-width: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   NAVIGATION BAR (Mobile)
   ───────────────────────────────────────────────────────────────────── */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    min-width: var(--min-touch-target);
    min-height: var(--min-touch-target);
    cursor: pointer;
}

.nav-item:hover {
    color: var(--color-text-secondary);
}

.nav-item.active {
    color: var(--color-gold);
}

.nav-icon {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
}

/* Hide nav bar on desktop */
@media (min-width: 1200px) {
    .nav-bar {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   STATUS INDICATORS
   ───────────────────────────────────────────────────────────────────── */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-round);
    background: var(--color-danger);
}

.status-dot.connected {
    background: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
}

.status-bar {
    background: var(--color-bg-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ─────────────────────────────────────────────────────────────────────
   LOADER / SPINNER
   ───────────────────────────────────────────────────────────────────── */
.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loader-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
}

/* ─────────────────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.empty-state-text {
    margin-bottom: var(--spacing-lg);
}

/* ─────────────────────────────────────────────────────────────────────
   BADGE
   ───────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-gold {
    background: var(--color-gold);
    color: #000;
}

.badge-success {
    background: var(--color-success);
    color: #000;
}

.badge-danger {
    background: var(--color-danger);
    color: #fff;
}

.badge-purple {
    background: var(--color-purple);
    color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────
   TUTORIAL MODAL
   ───────────────────────────────────────────────────────────────────── */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.tutorial-container {
    position: relative;
    background: var(--color-surface);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
    animation: tutorialSlideIn 0.3s ease-out;
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.tutorial-close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-voice-btn {
    position: absolute;
    top: 12px;
    right: 44px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    line-height: 1;
}

.tutorial-voice-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-voice-btn.playing {
    color: #44ffaa;
    animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tutorial-content {
    padding: var(--spacing-xl);
}

.tutorial-step {
    text-align: center;
}

.tutorial-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: tutorialBounce 1s ease-in-out infinite;
}

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

.tutorial-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-gold);
    margin-bottom: var(--spacing-sm);
}

.tutorial-description {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

/* Learn More Section */
.tutorial-learn-more {
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.tutorial-learn-toggle {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    width: 100%;
    text-align: left;
    transition: background var(--transition-fast);
}

.tutorial-learn-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
}

.tutorial-learn-content {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.tutorial-learn-content p {
    margin: var(--spacing-sm) 0 0 0;
}

/* Rarity Grid */
.tutorial-learn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
}

.tutorial-rarity {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: bold;
    font-size: 0.75rem;
}

.tutorial-rarity.common { background: #555; color: #ccc; }
.tutorial-rarity.rare { background: #1e40af; color: #60a5fa; }
.tutorial-rarity.epic { background: #6b21a8; color: #c084fc; }
.tutorial-rarity.legendary { background: #854d0e; color: #fbbf24; }

/* Roles */
.tutorial-roles {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.tutorial-role {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
}

.tutorial-role .role-icon {
    font-size: 1.25rem;
}

.tutorial-role .role-name {
    font-weight: bold;
    color: var(--color-text);
    min-width: 70px;
}

.tutorial-role .role-desc {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.tutorial-role.attacker { border-left: 3px solid #ff6b6b; }
.tutorial-role.defender { border-left: 3px solid #74c0fc; }
.tutorial-role.hybrid { border-left: 3px solid #da77f2; }

/* Game Modes */
.tutorial-modes {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.tutorial-mode {
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.tutorial-mode .mode-header {
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 4px;
}

.tutorial-mode .mode-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.tutorial-note {
    font-size: 0.8rem;
    color: var(--color-gold);
    margin-top: var(--spacing-sm) !important;
}

/* Progress Dots */
.tutorial-progress {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.tutorial-dot.active {
    background: var(--color-gold);
    transform: scale(1.2);
}

.tutorial-dot.completed {
    background: var(--color-success);
}

/* Actions */
.tutorial-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.tutorial-btn-back {
    background: transparent;
    border: 1px solid var(--color-text-muted);
    color: var(--color-text-muted);
}

.tutorial-btn-back:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.tutorial-btn-next {
    min-width: 100px;
}

.tutorial-btn-primary {
    background: linear-gradient(135deg, var(--color-success) 0%, #2f9e44 100%);
}

/* Skip */
.tutorial-skip {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-skip-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.tutorial-skip-btn:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────
   HUB HELP SECTION (Tutorial/FAQ buttons)
   ───────────────────────────────────────────────────────────────────── */
.hub-help-section {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-help-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.hub-help-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--color-text);
}

.hub-help-icon {
    font-size: 1rem;
}

/* Desktop help buttons */
.hub-help-desktop {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-md);
}

.hub-help-btn-desktop {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.hub-help-btn-desktop:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────────────
   QUEST MARKERS
   ───────────────────────────────────────────────────────────────────── */
.quest-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: #fff;
    font-weight: bold;
    font-size: 0.75rem;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: -5px;
    animation: quest-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

/* Mobile menu icon needs relative positioning */
.hub-menu-icon {
    position: relative;
}

.hub-menu-icon .quest-marker {
    top: -8px;
    right: -8px;
}

/* Desktop station quest marker */
.hub-station {
    position: relative;
}

.hub-station > .quest-marker {
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

.hub-station.has-quest {
    border-color: rgba(255, 68, 68, 0.5);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.2);
}

.hub-menu-item.has-quest {
    border-left: 3px solid #ff4444;
}

@keyframes quest-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    }
}

@keyframes quest-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Quest marker preview in tutorial */
.quest-marker-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ff4444;
    color: #fff;
    font-weight: bold;
    font-size: 0.7rem;
    border-radius: 50%;
    margin: 0 4px;
    vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────────────
   SCREEN HINTS
   ───────────────────────────────────────────────────────────────────── */
.screen-hint {
    background: linear-gradient(135deg, rgba(20, 18, 40, 0.97) 0%, rgba(30, 24, 55, 0.97) 100%);
    border: 1.5px solid rgba(255, 215, 0, 0.5);
    border-left: 4px solid var(--color-gold);
    border-radius: var(--radius-md);
    margin: var(--spacing-md);
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,215,0,0.08);
}

.screen-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

.screen-hint-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 10px 10px;
}

.screen-hint-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.screen-hint-text {
    flex: 1;
    min-width: 0;
}

.screen-hint-title {
    font-weight: bold;
    color: var(--color-gold);
    font-size: 0.92rem;
    letter-spacing: 0.2px;
}

.screen-hint-desc {
    color: #b8b8d0;
    font-size: 0.8rem;
    margin-top: 3px;
    line-height: 1.4;
}

.screen-hint-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.screen-hint-close:hover {
    color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────────────
   TUTORIAL SLIDESHOW
   ───────────────────────────────────────────────────────────────────── */
.tutorial-container.slideshow {
    max-width: 480px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.tutorial-modal.closing .tutorial-container {
    animation: tutorialSlideOut 0.3s ease-in forwards;
}

@keyframes tutorialSlideOut {
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.tutorial-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px 2px 0 0;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-cyan) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.tutorial-slide-content {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    min-height: 320px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .tutorial-slide-content {
        min-height: 250px;
        padding: var(--spacing-md);
    }

    .tutorial-container.slideshow .tutorial-icon {
        font-size: 3rem;
        margin-bottom: var(--spacing-sm);
    }

    .tutorial-container.slideshow .tutorial-title {
        font-size: 1.2rem;
    }

    .tutorial-container.slideshow .tutorial-subtitle {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-md);
    }
}

.tutorial-slide-content.fade-out {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tutorial-slide-content.fade-in {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.tutorial-subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
}

.tutorial-body {
    flex: 1;
    width: 100%;
}

.tutorial-body p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

/* Slide animations */
.tutorial-icon.fade-scale {
    animation: iconFadeScale 0.5s ease-out;
}

.tutorial-icon.slide-left {
    animation: iconSlideLeft 0.5s ease-out;
}

.tutorial-icon.slide-right {
    animation: iconSlideRight 0.5s ease-out;
}

.tutorial-icon.fade-up {
    animation: iconFadeUp 0.5s ease-out;
}

@keyframes iconFadeScale {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes iconSlideLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes iconSlideRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* Navigation */
.tutorial-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    gap: var(--spacing-sm);
}

@media (max-width: 480px) {
    .tutorial-navigation {
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-xs);
    }

    .tutorial-nav-btn {
        min-width: 70px;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.85rem;
    }

    .tutorial-nav-next {
        min-width: 80px !important;
    }
}

.tutorial-nav-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    min-width: 80px;
    flex-shrink: 0;
}

.tutorial-nav-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-nav-btn:focus {
    outline: none;
}

.tutorial-nav-next {
    background: var(--color-gold) !important;
    color: #000 !important;
    font-weight: bold;
    min-width: 100px;
}

.tutorial-nav-next:hover {
    background: #ffe066 !important;
    color: #000 !important;
    transform: scale(1.05);
}

.tutorial-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-dot.active {
    background: var(--color-gold);
    transform: scale(1.2);
}

.tutorial-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Slide Content Styles */
.slide-features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.slide-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.slide-feature .feature-icon {
    font-size: 2rem;
}

.slide-feature span:last-child {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Steps list */
.slide-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: left;
}

.slide-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-gold);
    color: #000;
    font-weight: bold;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.slide-note {
    font-size: 0.85rem;
    color: var(--color-cyan);
    font-style: italic;
    margin-top: var(--spacing-md);
}

/* Cards demo */
.slide-cards-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.demo-pack {
    font-size: 3rem;
    animation: packBob 2s ease-in-out infinite;
}

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

.demo-arrow {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.demo-cards {
    display: flex;
    gap: 4px;
}

.demo-card {
    font-size: 2rem;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.demo-card.common { background: rgba(128, 128, 128, 0.3); }
.demo-card.rare { background: rgba(74, 158, 255, 0.3); }
.demo-card.epic { background: rgba(156, 39, 176, 0.3); }

.slide-pack-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.pack-tier {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.pack-name {
    font-weight: bold;
    font-size: 0.85rem;
}

.pack-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Deck visual */
.slide-deck-visual {
    margin-bottom: var(--spacing-md);
}

.deck-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 250px;
    margin: 0 auto;
}

.deck-slot {
    aspect-ratio: 3/4;
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-sm);
    animation: slotFade 0.5s ease-out backwards;
}

.deck-slot:nth-child(1) { animation-delay: 0.05s; }
.deck-slot:nth-child(2) { animation-delay: 0.1s; }
.deck-slot:nth-child(3) { animation-delay: 0.15s; }
.deck-slot:nth-child(4) { animation-delay: 0.2s; }
.deck-slot:nth-child(5) { animation-delay: 0.25s; }
.deck-slot:nth-child(6) { animation-delay: 0.3s; }
.deck-slot:nth-child(7) { animation-delay: 0.35s; }
.deck-slot:nth-child(8) { animation-delay: 0.4s; }
.deck-slot:nth-child(9) { animation-delay: 0.45s; }
.deck-slot:nth-child(10) { animation-delay: 0.5s; }
.deck-slot:nth-child(11) { animation-delay: 0.55s; }
.deck-slot:nth-child(12) { animation-delay: 0.6s; }
.deck-slot:nth-child(13) { animation-delay: 0.65s; }
.deck-slot:nth-child(14) { animation-delay: 0.7s; }
.deck-slot:nth-child(15) { animation-delay: 0.75s; }

@keyframes slotFade {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.slide-deck-tips {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.deck-tip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.tip-icon {
    font-size: 1.2rem;
}

/* Combat phases */
.slide-combat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.combat-phase {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: left;
}

.phase-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.phase-info {
    flex: 1;
}

.phase-name {
    font-weight: bold;
    color: var(--color-gold);
    margin-bottom: 2px;
}

.phase-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Card roles */
.slide-roles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    border-left: 3px solid transparent;
}

.role-attacker { border-left-color: #ff6b6b; }
.role-defender { border-left-color: #4a9eff; }
.role-hybrid   { border-left-color: #ffd93d; }

.role-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.role-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.role-desc {
    font-size: 0.76rem;
    color: var(--color-text-secondary);
    line-height: 1.35;
}

/* Game modes */
.slide-modes {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.mode-card {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.mode-practice {
    border-color: rgba(0, 200, 83, 0.3);
}

.mode-ranked {
    border-color: rgba(255, 68, 68, 0.3);
}

.mode-tournament {
    border-color: rgba(147, 112, 219, 0.3);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.mode-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

.mode-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Escrow flow */
.slide-escrow {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.escrow-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.escrow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.escrow-icon {
    font-size: 2rem;
}

.escrow-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.escrow-arrow {
    font-size: 1.5rem;
    color: var(--color-gold);
}

.escrow-info p {
    font-size: 0.85rem;
    margin: var(--spacing-xs) 0;
}

/* Missions */
.slide-missions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.mission-type {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: left;
}

.mission-icon {
    font-size: 2rem;
}

.mission-info {
    display: flex;
    flex-direction: column;
}

.mission-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.mission-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Ready slide */
.slide-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.ready-checklist {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.95rem;
}

.check-icon {
    color: var(--color-success);
    font-weight: bold;
}

.ready-hint {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.quest-marker-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
    margin: 0 4px;
}

/* ─────────────────────────────────────────────────────────────────────
   GUIDE DIALOG — comic-style avatar + speech bubble
   Avatar slides in from bottom-left. Bubble sits above avatar like a comic panel.
   ───────────────────────────────────────────────────────────────────── */
.guide-dialog {
    position: fixed;
    bottom: 20px;
    left: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 300px;
    transform: translateX(-115%);
    transition: transform 0.45s cubic-bezier(0.34, 1.35, 0.64, 1);
    pointer-events: none;
    gap: 0;
}

.guide-dialog.visible {
    transform: translateX(0);
    pointer-events: auto;
}

/* Speech bubble — sits above the avatar */
.guide-dialog-bubble {
    position: relative;
    background: rgba(10, 10, 26, 0.97);
    border: 1.5px solid rgba(255, 215, 0, 0.55);
    border-radius: 16px 16px 16px 6px;
    padding: 10px 12px 30px 12px;
    width: 100%;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255,215,0,0.08);
}

/* Comic tail pointing down-left toward avatar */
.guide-dialog-bubble::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 22px;
    border: 10px solid transparent;
    border-top-color: rgba(10, 10, 26, 0.97);
    border-bottom: 0;
}
.guide-dialog-bubble::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 21px;
    border: 11px solid transparent;
    border-top-color: rgba(255, 215, 0, 0.55);
    border-bottom: 0;
}

/* Avatar below the bubble */
.guide-dialog-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 2.5px solid var(--color-gold);
    flex-shrink: 0;
    margin-top: 2px;
    margin-left: 6px;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.4), 0 4px 14px rgba(0,0,0,0.7);
}

.guide-dialog-title {
    color: var(--color-gold);
    font-size: 0.78rem;
    font-weight: bold;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.guide-dialog-body {
    color: #d8d8ec;
    font-size: 0.83rem;
    line-height: 1.45;
    min-height: 1.45em;
}

.guide-dialog-typed {
    transition: opacity 0.2s ease;
}

.guide-dialog-typed.fading {
    opacity: 0;
}

.guide-dialog-cursor {
    display: inline-block;
    color: var(--color-gold);
    font-size: 0.85rem;
    animation: guide-blink 0.75s step-end infinite;
    margin-left: 1px;
}

@keyframes guide-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.guide-dialog-skip {
    position: absolute;
    right: 8px;
    bottom: 6px;
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    color: rgba(255, 215, 0, 0.8);
    font-size: 0.68rem;
    cursor: pointer;
    padding: 2px 8px;
    transition: background 0.15s;
}

.guide-dialog-skip:hover {
    background: rgba(255, 215, 0, 0.15);
    color: var(--color-gold);
}

/* ─────────────────────────────────────────────────────────────────────
   SCREEN HINT AVATAR (replaces emoji icon)
   ───────────────────────────────────────────────────────────────────── */
.screen-hint-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--color-gold);
    object-fit: cover;
    object-position: top center;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.35), 0 2px 8px rgba(0,0,0,0.6);
}

.screen-hint-bubble {
    flex: 1;
    min-width: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   TUTORIAL WELCOME (Simplified)
   ───────────────────────────────────────────────────────────────────── */
.tutorial-container.welcome-only {
    max-width: 400px;
}

.tutorial-quick-guide {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
    text-align: left;
}

.tutorial-guide-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
}

.guide-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--color-gold);
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.tutorial-hint {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: var(--spacing-md) 0;
}

.tutorial-btn-start {
    width: 100%;
    margin-top: var(--spacing-md);
}

/* Quest completion success box */
.quest-success-box {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 150, 60, 0.1) 100%);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) var(--spacing-md);
    text-align: center;
}

.quest-success-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.quest-success-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-success);
    margin-bottom: var(--spacing-xs);
}

.quest-success-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.quest-success-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
}

.quest-success-btn {
    width: 100%;
    max-width: 250px;
}

.quest-success-btn-secondary {
    width: 100%;
    max-width: 250px;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════
   POST-TUTORIAL HINTS
   Shown on Hub after tutorial completion
   ═══════════════════════════════════════════════════════════════════ */

.post-tutorial-hint {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 180, 0, 0.15) 100%);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    animation: hint-slide-in 0.5s ease-out, hint-glow 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

@keyframes hint-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.5); }
}

@keyframes hint-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-tutorial-hint-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.post-tutorial-hint-content {
    flex: 1;
    min-width: 0;
}

.post-tutorial-hint-title {
    font-weight: bold;
    color: var(--color-gold);
    font-size: 0.9rem;
}

.post-tutorial-hint-text {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.3;
}

.post-tutorial-hint-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.post-tutorial-hint-dismiss {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.post-tutorial-hint-dismiss:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   BATTLE TUTORIAL TOOLTIPS
   Overlay hints during first battle
   ═══════════════════════════════════════════════════════════════════ */

.battle-tutorial-tooltip {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98) 0%, rgba(20, 20, 40, 0.98) 100%);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    max-width: 320px;
    width: 90%;
    flex-direction: column;
    gap: var(--spacing-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.battle-tutorial-tooltip.visible {
    opacity: 1;
}

/* Position classes */
.battle-tutorial-tooltip.position-top {
    top: 100px;
}

.battle-tutorial-tooltip.position-middle {
    top: 50%;
    transform: translate(-50%, -50%);
}

.battle-tutorial-tooltip.position-bottom {
    bottom: 180px;
    top: auto;
}

.battle-tutorial-content {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.battle-tutorial-icon {
    font-size: 2rem;
    flex-shrink: 0;
    animation: tutorial-bounce 1s ease-in-out infinite;
}

@keyframes tutorial-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.battle-tutorial-text {
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.battle-tutorial-text strong {
    color: var(--color-gold);
    display: block;
    margin-bottom: 4px;
}

.battle-tutorial-dismiss {
    background: var(--color-gold);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-md);
    font-weight: bold;
    cursor: pointer;
    align-self: flex-end;
    transition: transform 0.2s, box-shadow 0.2s;
}

.battle-tutorial-dismiss:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.battle-tutorial-dismiss:active {
    transform: scale(0.98);
}

/* ─────────────────────────────────────────────────────────────────────
   INBOX COMPONENT
   ───────────────────────────────────────────────────────────────────── */

/* Header Inbox Button */
.header-inbox-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    margin-right: var(--spacing-xs);
    transition: transform var(--transition-fast);
}

.header-inbox-btn:hover {
    transform: scale(1.1);
}

.header-inbox-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pulse 2s ease-in-out infinite;
}

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

/* Inbox Modal */
.inbox-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: var(--spacing-xl);
    z-index: 1100;
    animation: fadeIn 0.2s ease-out;
}

.inbox-modal {
    background: linear-gradient(135deg, #2a2a4a 0%, var(--color-bg-primary) 100%);
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.2s ease-out;
    overflow: hidden;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    flex-shrink: 0;
}

.inbox-header h2 {
    color: var(--color-gold);
    font-size: 1.2rem;
    margin: 0;
}

.inbox-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.inbox-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inbox-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary);
}

.inbox-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    margin-left: var(--spacing-sm);
    transition: color var(--transition-fast);
}

.inbox-close:hover {
    color: var(--color-text-primary);
}

/* Messages Container */
.inbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.inbox-loading,
.inbox-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Individual Message */
.inbox-message {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.inbox-message:hover {
    background: rgba(0, 0, 0, 0.4);
}

.inbox-message.unread {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--color-gold);
}

.inbox-message.unread:hover {
    background: rgba(255, 215, 0, 0.15);
}

.inbox-message.read {
    opacity: 0.7;
}

.inbox-message-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.inbox-message-content {
    flex: 1;
    min-width: 0;
}

.inbox-message-title {
    font-weight: bold;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.inbox-message.unread .inbox-message-title {
    color: var(--color-gold);
}

.inbox-message-text {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.inbox-message-time {
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.inbox-message-arrow {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.inbox-message:hover .inbox-message-arrow {
    opacity: 1;
}

/* Inbox Body */
.inbox-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Detail View */
.inbox-detail {
    flex: 1;
    overflow-y: auto;
    animation: slideIn 0.2s ease-out;
}

.inbox-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inbox-detail-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inbox-detail-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

.inbox-detail-delete {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: #ff6b6b;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inbox-detail-delete:hover {
    background: rgba(255, 100, 100, 0.3);
}

.inbox-claim-btn {
    display: block;
    width: 100%;
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--color-gold) 0%, #f0c000 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inbox-claim-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.inbox-detail-content {
    padding: var(--spacing-lg);
    text-align: center;
}

.inbox-detail-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.inbox-detail-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--color-gold);
    margin-bottom: var(--spacing-xs);
}

.inbox-detail-time {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.inbox-detail-message {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

.inbox-detail-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: left;
}

.inbox-stat-result {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.inbox-stat-result.win {
    background: rgba(68, 255, 68, 0.2);
    color: var(--color-success);
}

.inbox-stat-result.loss {
    background: rgba(255, 68, 68, 0.2);
    color: var(--color-danger);
}

.inbox-stat-result.draw {
    background: rgba(255, 215, 0, 0.2);
    color: var(--color-gold);
}

.inbox-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.inbox-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
}

.inbox-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.inbox-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-primary);
}

.inbox-stat-value.earnings {
    color: var(--color-success);
}

.inbox-stat-earnings,
.inbox-stat-opponent,
.inbox-stat-defense {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
}

.inbox-stat-earnings .inbox-stat-value {
    color: var(--color-success);
    font-size: 1.1rem;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .inbox-modal-overlay {
        padding-top: var(--spacing-md);
    }

    .inbox-modal {
        width: 95%;
        max-height: 85vh;
    }

    .inbox-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .inbox-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .inbox-message {
        padding: var(--spacing-sm);
    }

    .inbox-message-icon {
        font-size: 1.25rem;
        width: 28px;
    }

    .inbox-detail-content {
        padding: var(--spacing-md);
    }

    .inbox-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─────────────────────────────────────────────────────────────────────
   TOURNAMENT STATUS BAR
   ───────────────────────────────────────────────────────────────────── */
.tournament-status-bar {
    position: fixed;
    top: 60px; /* Below header */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid var(--color-gold);
    padding: var(--spacing-xs) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tournament-status-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.tournament-status-icon {
    font-size: 1.25rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.tournament-status-text {
    font-weight: bold;
    color: var(--color-gold);
    font-size: 0.9rem;
}

.tournament-status-matches {
    color: #888;
    font-size: 0.8rem;
}

.tournament-status-btn {
    background: var(--color-gold);
    color: #000;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tournament-status-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Adjust main content when status bar is visible */
body.has-tournament-bar main#app {
    margin-top: 40px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tournament-status-bar {
        padding: var(--spacing-xs);
        flex-wrap: nowrap;
    }

    .tournament-status-text {
        font-size: 0.8rem;
    }

    .tournament-status-matches {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EPIC PULSE EFFECT
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes epicPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
    50%      { box-shadow: 0 0 18px rgba(168, 85, 247, 0.7); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEGENDARY GLITTER EFFECT
   Applied to all legendary cards across collection, deck, library, battle
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────────────────── */

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 12px 2px rgba(255, 215, 0, 0.5), 0 0 24px 4px rgba(255, 165, 0, 0.2); }
    50%       { box-shadow: 0 0 20px 6px rgba(255, 215, 0, 0.8), 0 0 40px 10px rgba(255, 165, 0, 0.4); }
}

@keyframes legendaryShimmer {
    0%   { transform: translateX(-150%) rotate(25deg); }
    100% { transform: translateX(350%) rotate(25deg); }
}

@keyframes legendaryGlitter {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%       { opacity: 1; transform: scale(1); }
}

@keyframes legendaryBorderPulse {
    0%, 100% { border-color: #ffd700; }
    50%       { border-color: #fff8a0; }
}

/* ── Base: overflow clip on all legendary card containers ──────────────────── */

.collection-card.legendary,
.library-card.legendary,
.game-card.legendary,
.deck-card-mini.legendary {
    position: relative;
    border-color: var(--color-legendary) !important;
    animation: legendaryGlow 2s ease-in-out infinite,
               legendaryBorderPulse 2s ease-in-out infinite;
}

/* ── Shimmer sweep (light beam sliding across card) ────────────────────────── */

.collection-card.legendary::before,
.library-card.legendary::before,
.game-card.legendary::before,
.deck-card-mini.legendary::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 180, 0.35) 48%,
        rgba(255, 255, 255, 0.55) 52%,
        rgba(255, 255, 180, 0.35) 56%,
        transparent 70%
    );
    width: 60%;
    animation: legendaryShimmer 3.5s ease-in-out infinite;
    animation-delay: var(--shimmer-delay, 0s);
}

/* ── Glitter dots overlay ───────────────────────────────────────────────────── */

.collection-card.legendary::after,
.library-card.legendary::after,
.game-card.legendary::after,
.deck-card-mini.legendary::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 215, 0, 0.8) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 200, 50, 0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 215, 0, 0.7) 1px, transparent 1px);
    background-size:
        80px 80px, 60px 60px, 100px 100px,
        70px 70px, 90px 90px, 50px 50px;
    background-position:
        10px 15px, 35px 45px, 55px 20px,
        20px 65px, 70px 10px, 45px 75px;
    animation: legendaryGlitter 2.5s ease-in-out infinite alternate;
    animation-delay: var(--glitter-delay, 0.3s);
    opacity: 0.6;
}

/* ── Stagger shimmer/glitter per card so they don't all flash together ──────── */
/* Odd cards in collection grid get a delay */
.collection-card.legendary:nth-child(odd)  { --shimmer-delay: 0.8s; --glitter-delay: 1.2s; }
.collection-card.legendary:nth-child(3n)   { --shimmer-delay: 1.6s; --glitter-delay: 0.5s; }
.library-card.legendary:nth-child(odd)     { --shimmer-delay: 1.0s; --glitter-delay: 0.8s; }
.library-card.legendary:nth-child(3n)      { --shimmer-delay: 0.4s; --glitter-delay: 1.5s; }

/* ── Reduce intensity on very small cards (deck mini) ──────────────────────── */
.deck-card-mini.legendary::after {
    opacity: 0.3;
}
.deck-card-mini.legendary::before {
    animation-duration: 4.5s;
}

/* ── Respect reduced motion preference ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .collection-card.legendary,
    .library-card.legendary,
    .game-card.legendary,
    .deck-card-mini.legendary {
        animation: legendaryGlow 2s ease-in-out infinite;
    }
    .collection-card.legendary::before,
    .library-card.legendary::before,
    .game-card.legendary::before,
    .deck-card-mini.legendary::before,
    .collection-card.legendary::after,
    .library-card.legendary::after,
    .game-card.legendary::after,
    .deck-card-mini.legendary::after {
        display: none;
    }
}
