/* ================================================
   GAME NIGHT — GLOBAL STYLES
   ================================================ */

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

:root {
    --bg:      #0f0820;
    --bg2:     #1a0f2e;
    --surface: #2a1a4a;
    --border:  #3d2b5f;
    --text:    #f0e6ff;
    --muted:   #9d8fb5;
    --pink:    #ff6b9d;
    --teal:    #4ecdc4;
    --yellow:  #ffe66d;
    --mint:    #a8e6cf;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Quicksand', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,107,157,.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(78,205,196,.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,230,109,.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

main { position: relative; z-index: 1; }

/* Language switcher */
.layout-wrapper { position: relative; }
.language-switcher-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: rgba(15, 8, 32, 0.9);
    border-bottom: 1px solid var(--border);
}
.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--muted);
}
.language-label { margin-right: 6px; }
.lang-link {
    color: var(--muted);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .2s, background .2s;
}
.lang-link:hover {
    color: var(--text);
    background: var(--surface);
}
.lang-link.active {
    color: var(--teal);
    font-weight: 600;
}
.lang-sep { opacity: 0.5; }

/* ── HOME PAGE ── */
.container {
    width: min(90vw, 1600px);
    margin: 0 auto;
    padding: 0 5vw;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 64px;
    animation: fadeInDown .6s ease;
}

.logo {
    font-family: 'Cabin Sketch', cursive;
    font-size: 72px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink) 0%, var(--teal) 50%, var(--yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 3px;
}

.tagline {
    font-size: 18px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 1px;
}

.tagline span {
    color: var(--yellow);
    font-weight: 700;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 32px 0 48px;
    animation: fadeIn .8s ease .2s backwards;
}

.stat { text-align: center; }

.stat-num {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Cabin Sketch', cursive;
    color: var(--yellow);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.game-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
    position: relative;
    animation: fadeInUp .5s ease backwards;
}

.game-card:nth-child(1) { animation-delay: .1s; }
.game-card:nth-child(2) { animation-delay: .2s; }
.game-card:nth-child(3) { animation-delay: .3s; }
.game-card:nth-child(4) { animation-delay: .4s; }

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}

.game-card.pink  { color: var(--pink);  }
.game-card.teal  { color: var(--teal);  }
.game-card.yellow { color: var(--yellow); }
.game-card.mint  { color: var(--mint);  }
.game-card.blue  { color: #7c9ef5; }
.game-card.gold  { color: #f0a500; }

.game-card:hover { border-color: currentColor; box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 2px currentColor; }

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, currentColor 100%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.game-card:hover::before { opacity: .08; }

.game-header { padding: 28px 24px 20px; }

.game-icon {
    font-size: 56px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Cabin Sketch', cursive;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.game-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.game-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
}

.game-card.pink   .tag { background: rgba(255,107,157,.15); border-color: rgba(255,107,157,.3); color: var(--pink); }
.game-card.teal   .tag { background: rgba(78,205,196,.15);  border-color: rgba(78,205,196,.3);  color: var(--teal); }
.game-card.yellow .tag { background: rgba(255,230,109,.15); border-color: rgba(255,230,109,.3); color: var(--yellow); }
.game-card.mint   .tag { background: rgba(168,230,207,.15); border-color: rgba(168,230,207,.3); color: var(--mint); }
.game-card.blue   .tag { background: rgba(124,158,245,.15); border-color: rgba(124,158,245,.3); color: #7c9ef5; }
.game-card.gold   .tag { background: rgba(240,165,  0,.15); border-color: rgba(240,165,  0,.3); color: #f0a500; }

.game-footer {
    padding: 16px 24px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.players {
    font-size: 13px;
    color: var(--muted);
}

.btn-play {
    
    color: var(--bg);
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.btn-play:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.btn-play:active { transform: translateY(0); }

.btn-soon {
    opacity: .65;
    cursor: default;
}
.btn-soon:hover { transform: none; }

/* How It Works */
.how-it-works {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    animation: fadeIn 1s ease .5s backwards;
}

.how-it-works h2 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--yellow);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.step-num {
    font-family: 'Cabin Sketch', cursive;
    font-size: 48px;
    font-weight: 700;
    color: var(--pink);
    opacity: .3;
    margin-bottom: 8px;
}

.step-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }

.step-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Footer */
.footer {
    text-align: center;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn .2s ease;
    padding: 20px;
}

.modal-box {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 36px;
    width: 100%;
    max-width: 440px;
    position: relative;
    animation: scaleIn .3s cubic-bezier(.34,1.56,.64,1);
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,.1);
    border: none;
    color: var(--muted);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-icon { font-size: 48px; display: block; margin-bottom: 8px; }

.modal-header h2 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 28px;
    color: var(--pink);
}

.modal-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
}

.join-modal-back {
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
    margin-top: 8px;
    transition: color .2s;
}

.join-modal-back:hover { color: var(--text); }

.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255,255,255,.05);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.tab-btn.active {
    background: var(--pink);
    color: var(--bg);
}

.modal-body { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.form-input {
    background: rgba(255,255,255,.07);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: border-color .2s;
    width: 100%;
}

.form-input:focus { border-color: var(--pink); }

.code-input {
    font-family: 'Cabin Sketch', cursive;
    font-size: 28px;
    letter-spacing: 6px;
    text-align: center;
    text-transform: uppercase;
}

.modal-error {
    background: rgba(255,107,107,.15);
    border: 1px solid rgba(255,107,107,.4);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ff9090;
    font-size: 13px;
}

.btn-modal-submit {
    background: linear-gradient(135deg, var(--pink), #e05090);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
    box-shadow: 0 4px 20px rgba(255,107,157,.3);
}

.btn-modal-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,107,157,.4); }
.btn-modal-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── RESUME BANNER ── */
.resume-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: linear-gradient(135deg, rgba(42, 26, 74, 0.97), rgba(26, 15, 46, 0.97));
    border-bottom: 2px solid var(--teal);
    backdrop-filter: blur(8px);
    animation: slideDown .3s ease;
}

.resume-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resume-icon {
    font-size: 24px;
}

.resume-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.resume-text strong {
    font-size: 15px;
    color: var(--text);
}

.resume-text span {
    font-size: 13px;
    color: var(--muted);
}

.resume-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-resume {
    background: linear-gradient(135deg, var(--teal), #3ab0a8);
    color: var(--bg);
    border: none;
    padding: 8px 20px;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}

.btn-resume:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.btn-dismiss {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.btn-dismiss:hover {
    border-color: var(--muted);
    color: var(--text);
}

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

@media (max-width: 768px) {
    .resume-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }
    .resume-actions {
        justify-content: flex-end;
    }
}

/* ── TOAST ── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 2px solid var(--teal);
    border-radius: 16px;
    padding: 14px 24px;
    color: var(--teal);
    font-weight: 700;
    font-size: 15px;
    z-index: 200;
    animation: slideUp .3s ease;
    white-space: nowrap;
}

/* ── ERROR / MISC ── */
.error-state {
    text-align: center;
    padding: 100px 20px;
}

.error-msg {
    color: var(--pink);
    font-size: 18px;
    margin-bottom: 24px;
}

.btn-home {
    display: inline-block;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: border-color .2s;
}

.btn-home:hover { border-color: var(--pink); color: var(--text); }

#blazor-error-ui {
    background: #b32121;
    bottom: 0; left: 0; right: 0;
    padding: 8px 16px;
    position: fixed;
    z-index: 999;
    display: none;
    color: white;
    font-size: 13px;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ── ANIMATIONS ── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .container { padding: 40px 20px; }
    .logo { font-size: 48px; }
    .tagline { font-size: 16px; }
    .stats { gap: 24px; }
    .stat-num { font-size: 24px; }
    .game-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .modal-box { padding: 24px; }
}
