/* fonts loaded via <link> in each page head */

/* === Tokens ================================================================ */
:root {
    --bg:       #09090d;
    --bg2:      #101016;
    --bg3:      #18181f;
    --bg4:      #1f1f28;
    --border:   #252530;
    --border2:  #2e2e3d;
    --accent:   #e8ff47;
    --accent2:  #ff4760;
    --blue:     #47b6ff;
    --confirm:  #4ade80;
    --pending:  #fbbf24;
    --reject:   #f87171;
    --text:     #dddde8;
    --muted:    #5c5c72;
    --muted2:   #8888a8;
}

/* === Reset ================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .75; }
img { display: block; max-width: 100%; }

/* === Layout ================================================================ */
.container {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* === Nav =================================================================== */
nav {
    position: sticky;
    top: 0;
    z-index: 200;
    width: 100%;
    display: block;
    background: rgba(9,9,13,.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 32px;
    box-sizing: border-box;
}
.logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: .04em;
    flex: 1;
}
.logo span { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted2); font-size: .88rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--text); opacity: 1; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #000;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
}
.nav-logout { font-size: .78rem !important; color: var(--muted) !important; }
.btn-nav {
    background: var(--accent) !important;
    color: #000 !important;
    padding: 6px 18px; border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700; font-size: .95rem; letter-spacing: .04em;
}
.btn-nav:hover { opacity: .85 !important; }

/* === Hero ================================================================== */
.hero {
    padding: 72px 24px 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 50% -10%, rgba(232,255,71,.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 120%, rgba(255,71,96,.04) 0%, transparent 60%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow {
    font-family: 'Rajdhani', sans-serif;
    font-size: .8rem; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 16px;
    display: inline-block;
    background: rgba(232,255,71,.08);
    padding: 4px 14px; border-radius: 2px;
    border: 1px solid rgba(232,255,71,.2);
}
.hero h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(2.6rem, 7vw, 5rem);
    font-weight: 700; line-height: 1.0;
    letter-spacing: -.01em;
    margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
    color: var(--muted2); font-size: 1.05rem; font-weight: 300;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

/* === Search ================================================================ */
.search-wrap {
    position: relative;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.search-wrap input {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 15px 22px;
    font-size: 1rem; font-family: 'DM Sans', sans-serif;
    border-radius: 6px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,255,71,.08);
}
.search-wrap input::placeholder { color: var(--muted); }
.search-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--bg2); border: 1px solid var(--border2);
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 24px 48px rgba(0,0,0,.6);
    z-index: 300;
    text-align: left;
}
.search-dropdown.open { display: block; }

.sri { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; transition: background .12s; }
.sri:hover { background: var(--bg3); }
.sri + .sri { border-top: 1px solid var(--border); }
.sri-img { width: 38px; height: 50px; border-radius: 3px; object-fit: cover; background: var(--bg4); flex-shrink: 0; }
.sri-noimg { width: 38px; height: 50px; border-radius: 3px; background: var(--bg4); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.sri-info { flex: 1; min-width: 0; }
.sri-name { font-weight: 500; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sri-sub  { font-size: .75rem; color: var(--muted2); margin-top: 2px; }
.sri-badges { display: flex; gap: 5px; margin-left: auto; flex-shrink: 0; }
.badge { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; }
.badge-steam     { background: rgba(71,182,255,.12); color: var(--blue); }
.badge-ftg       { background: rgba(74,222,128,.12); color: var(--confirm); }
.badge-indb      { background: rgba(232,255,71,.1);  color: var(--accent); }
.badge-new       { background: rgba(255,71,96,.1);   color: var(--accent2); }
.badge-tags      { background: rgba(251,191,36,.1);  color: var(--pending); }
.badge-user      { background: rgba(71,182,255,.1);  color: var(--blue); }
.badge-confirmed { background: rgba(74,222,128,.12); color: var(--confirm); }
.badge-pending   { background: rgba(251,191,36,.1);  color: var(--pending); }

/* === Section title ========================================================= */
.sec-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted2);
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 14px;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === Game Grid ============================================================= */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 14px; margin-bottom: 56px;
}
.game-card {
    display: block; color: var(--text);
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.4); opacity: 1; }
.game-card-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg3); }
.game-card-noimg { width: 100%; aspect-ratio: 2/3; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.game-card-info { padding: 10px 12px; }
.game-card-info h3 { font-size: .86rem; font-weight: 500; line-height: 1.3; }
.game-card-info small { font-size: .72rem; color: var(--muted2); }

/* === How it works ========================================================== */
.how-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 14px; margin-bottom: 60px;
}
.how-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 22px 20px; }
.how-icon { font-size: 1.8rem; margin-bottom: 12px; }
.how-card h3 { font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 6px; letter-spacing: .03em; }
.how-card p  { font-size: .82rem; color: var(--muted2); line-height: 1.6; }

/* === Game Page ============================================================= */
.game-header { display: flex; gap: 32px; padding: 40px 0 36px; align-items: flex-start; }
.game-cover { width: 170px; flex-shrink: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.game-cover img { width: 100%; }
.game-cover-empty { width: 170px; aspect-ratio: 2/3; background: var(--bg3); border-radius: 8px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.game-meta h1 { font-family: 'Rajdhani', sans-serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.1; margin-bottom: 8px; }
.game-year { color: var(--muted2); font-size: .88rem; margin-bottom: 12px; }
.platforms  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.plat-tag { background: var(--bg3); border: 1px solid var(--border); padding: 2px 10px; border-radius: 20px; font-size: .72rem; color: var(--muted2); }
.game-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.tag-pill { background: rgba(232,255,71,.06); border: 1px solid rgba(232,255,71,.15); color: rgba(232,255,71,.7); padding: 2px 10px; border-radius: 20px; font-size: .72rem; }
.game-summary { color: var(--muted2); font-size: .9rem; line-height: 1.75; max-width: 560px; }
.game-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* === Deals Widget ========================================================== */
.deals-widget { background: var(--bg2); border: 1px solid var(--border2); border-radius: 8px; padding: 20px; margin-bottom: 36px; display: none; }
.deals-widget.loaded { display: block; }
.deals-title { font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; color: var(--muted2); }
.historic-low { display: inline-flex; align-items: center; gap: 8px; background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.2); border-radius: 4px; padding: 6px 14px; margin-bottom: 14px; font-size: .84rem; color: var(--confirm); }
.historic-low strong { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.price-store { flex: 1; color: var(--muted2); }
.price-cut { background: var(--accent2); color: #fff; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .78rem; padding: 1px 7px; border-radius: 3px; }
.price-amount { font-weight: 500; min-width: 60px; text-align: right; }
.price-link { font-size: .78rem; color: var(--blue); }

/* === Similarity Cards ====================================================== */
.sim-section { margin-bottom: 48px; }
.sim-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sim-section-label { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 14px; border-radius: 4px; }
.sim-section-label.confirmed { background: rgba(74,222,128,.1); color: var(--confirm); }
.sim-section-label.pending   { background: rgba(251,191,36,.08); color: var(--pending); }
.sim-count { color: var(--muted); font-size: .82rem; }
.sim-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; margin-bottom: 8px; transition: border-color .15s; }
.sim-card.is-confirmed { border-left: 3px solid var(--confirm); }
.sim-card.is-pending   { border-left: 3px solid var(--pending); }
.sim-card:hover        { border-color: var(--border2); }
.sim-cover { width: 48px; height: 64px; border-radius: 4px; object-fit: cover; background: var(--bg4); flex-shrink: 0; }
.sim-cover-empty { width: 48px; height: 64px; border-radius: 4px; background: var(--bg4); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.sim-info { flex: 1; min-width: 0; }
.sim-name { font-weight: 500; font-size: .95rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-name a { color: var(--text); }
.sim-name a:hover { color: var(--accent); opacity: 1; }
.sim-reason { font-size: .8rem; color: var(--muted2); margin-bottom: 5px; font-style: italic; }
.shared-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.shared-tag { background: var(--bg4); border: 1px solid var(--border); padding: 1px 8px; border-radius: 20px; font-size: .68rem; color: var(--muted2); }
.vote-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.vote-btn { width: 32px; height: 32px; border-radius: 5px; border: 1px solid var(--border2); background: none; color: var(--muted); cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.up.active   { border-color: var(--confirm); color: var(--confirm); background: rgba(74,222,128,.08); }
.vote-btn.down.active { border-color: var(--reject);  color: var(--reject);  background: rgba(248,113,113,.08); }
.vote-score { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .95rem; min-width: 24px; text-align: center; color: var(--muted2); }
.vote-score.pos { color: var(--confirm); }
.vote-score.neg { color: var(--reject); }

/* === Forms ================================================================= */
.page-wrap { width: 100%; max-width: 660px; margin-left: auto; margin-right: auto; padding: 40px 24px 80px; box-sizing: border-box; }
.page-wrap h1 { font-family: 'Rajdhani', sans-serif; font-size: 2rem; font-weight: 700; margin-bottom: 6px; }
.page-sub { color: var(--muted2); margin-bottom: 32px; font-size: .92rem; }
.form-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 26px; margin-bottom: 16px; }
.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); margin-bottom: 8px; }
.form-input, .form-textarea, .form-select { width: 100%; background: var(--bg3); border: 1px solid var(--border2); color: var(--text); padding: 10px 14px; font-size: .93rem; font-family: 'DM Sans', sans-serif; border-radius: 6px; outline: none; transition: border-color .2s; box-sizing: border-box; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 110px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px,1fr)); gap: 7px; }
.check-label { display: flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: .83rem; color: var(--text); transition: border-color .15s; }
.check-label:has(input:checked) { border-color: var(--accent); background: rgba(232,255,71,.04); }
.check-label input { accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #000; border: none; padding: 11px 26px; border-radius: 6px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: .04em; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { opacity: .75; }
.alert { padding: 11px 16px; border-radius: 6px; margin-bottom: 18px; font-size: .88rem; }
.alert-error   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.25); color: #fca5a5; }
.alert-success { background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.25);  color: #86efac; }

/* === Auth ================================================================== */
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.auth-tab { padding: 9px 20px; font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 1rem; color: var(--muted2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.auth-tab.active, .auth-tab:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }

/* === Profile =============================================================== */
.profile-header { display: flex; align-items: center; gap: 20px; padding: 36px 0 28px; }
.profile-avatar { width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, var(--accent)); display: flex; align-items: center; justify-content: center; font-family: 'Rajdhani', sans-serif; font-size: 1.7rem; font-weight: 700; color: #000; }
.profile-name  { font-family: 'Rajdhani', sans-serif; font-size: 1.6rem; font-weight: 700; }
.profile-since { color: var(--muted2); font-size: .82rem; }

/* === Game picker =========================================================== */
.picked-game { display: flex; align-items: center; gap: 12px; background: var(--bg3); border: 1px solid var(--accent); border-radius: 6px; padding: 9px 14px; margin-top: 8px; }
.picked-game img { width: 30px; height: 40px; object-fit: cover; border-radius: 3px; }
.picked-game .pg-name { font-weight: 500; font-size: .92rem; flex: 1; }
.picked-clear { background: none; border: none; color: var(--muted2); cursor: pointer; font-size: 1rem; padding: 0 4px; transition: color .15s; }
.picked-clear:hover { color: var(--reject); }

/* === Add Game ============================================================== */
.igdb-card { display: flex; gap: 16px; align-items: center; background: var(--bg2); border: 1px solid var(--accent); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.igdb-card img { width: 58px; height: 77px; object-fit: cover; border-radius: 4px; background: var(--bg3); }
.igdb-card-info h3 { font-size: .98rem; font-weight: 600; margin-bottom: 4px; }
.igdb-card-info p  { font-size: .8rem; color: var(--muted2); }
.igdb-note { font-size: .8rem; color: var(--accent); margin-top: 6px; }

/* === Empty ================================================================= */
.empty { text-align: center; padding: 48px 20px; color: var(--muted2); }
.empty .ei { font-size: 2.5rem; margin-bottom: 12px; }

/* === Misc ================================================================== */
.loading { color: var(--muted2); font-size: .85rem; padding: 10px 14px; }
.spinner { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive ============================================================ */
@media (max-width: 640px) {
    .game-header  { flex-direction: column; }
    .game-cover, .game-cover-empty { width: 140px; }
    .games-grid   { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); }
    .nav-links a:not(.btn-nav) { display: none; }
}
