/* Gizlo — shared styles, used by every page (index, game, profile, mygames, creategame, avatar, account). */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: system-ui, -apple-system, sans-serif; background: #1a1b1e; color: #dbdee1; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
/* Side padding lines the nav up with the 1200px page content below it. */
nav { display: flex; align-items: center; gap: 16px; padding: 0 max(32px, calc((100% - 1200px) / 2 + 40px)); height: 60px; background: #111214; border-bottom: 1px solid #232428; position: sticky; top: 0; z-index: 50; }
.nav-logo img { height: 36px; cursor: pointer; display: block; }
.nav-spacer { flex: 1; }
.nav-kinilo { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 6px; margin-right: 10px; border-radius: 16px; background: #1e1f22; border: 1px solid #2a2b2f; color: #f2f3f5; font-weight: 700; font-size: 13px; text-decoration: none; flex-shrink: 0; transition: border-color 0.15s; font-variant-numeric: tabular-nums; }
.nav-kinilo:hover { border-color: #00c850; }
.nav-kinilo img { width: 22px; height: 22px; display: block; }
.kinilo-icon { width: 1.05em; height: 1.05em; vertical-align: -0.17em; margin-right: 0.22em; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a2b2f; color: #dbdee1; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; user-select: none; flex-shrink: 0; }
.nav-menu { position: absolute; top: 44px; right: 0; background: #111214; border: 1px solid #2a2b2f; border-radius: 12px; padding: 6px; min-width: 170px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
.nav-menu.open { display: block; }
.nav-menu-user { font-size: 11px; color: #6d6f78; padding: 8px 10px 10px; border-bottom: 1px solid #2a2b2f; margin-bottom: 4px; font-weight: 600; }
.nav-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: #dbdee1; cursor: pointer; }
.nav-menu a:hover { background: #1e1f22; }
.nav-menu a.danger { color: #f23f43; }

/* ── Pages ───────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: revert; }

/* ── Login ───────────────────────────────────────────────────────────────── */
#page-login { background: #1a1b1e; overflow-y: auto; height: 100vh; }
#page-login.active { display: block; }
.auth-wrap { width: 100%; max-width: 400px; padding: 24px; }
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo img { height: 72px; }
.auth-sub { text-align: center; color: #6d6f78; font-size: 13px; margin-bottom: 32px; }
.auth-box { background: #111214; border-radius: 16px; padding: 32px; box-shadow: 0 8px 48px rgba(0,0,0,0.5); border: 1px solid #2a2b2f; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 28px; background: #1a1b1e; border-radius: 10px; padding: 4px; }
.auth-tabs button { flex: 1; padding: 8px; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; background: transparent; color: #6d6f78; font-weight: 600; transition: all 0.15s; }
.auth-tabs button.active { background: #00c850; color: #000; font-weight: 700; }
.field-label { display: block; font-size: 10px; color: #6d6f78; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 7px; margin-top: 18px; font-weight: 700; }
input[type=text], input[type=password] { width: 100%; padding: 11px 14px; background: #1a1b1e; border: 1px solid #2a2b2f; border-radius: 9px; color: #dbdee1; font-size: 14px; outline: none; transition: border-color 0.15s; }
input:focus { border-color: #00c850; }
.auth-btn { display: block; width: 100%; padding: 12px; margin-top: 24px; background: #00c850; color: #000; font-weight: 700; font-size: 15px; border: none; border-radius: 9px; cursor: pointer; transition: background 0.15s; }
.auth-btn:hover { background: #00b040; }
.err { color: #f23f43; font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ── Home ────────────────────────────────────────────────────────────────── */
#page-home { padding: 28px 40px 40px; max-width: 1200px; margin: 0 auto; width: 100%; flex-direction: column; min-height: calc(100vh - 58px); height: auto; overflow-y: auto; }
#page-home.active { display: flex; }
.home-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.home-search { flex: 1; max-width: 480px; position: relative; }
.home-search input { width: 100%; padding: 11px 16px 11px 40px; background: #111214; border: 1px solid #2a2b2f; border-radius: 10px; color: #dbdee1; font-size: 14px; outline: none; transition: border-color 0.15s; }
.home-search input::placeholder { color: #4e5058; }
.home-search input:focus { border-color: #00c850; }
.home-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #4e5058; font-size: 15px; pointer-events: none; }
.search-hint { font-size: 11px; color: #4e5058; margin-top: 5px; }

.tabs { display: flex; gap: 2px; margin-bottom: 22px; background: #111214; border-radius: 10px; padding: 4px; width: fit-content; }
.tab-btn { padding: 7px 20px; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; background: transparent; color: #6d6f78; transition: all 0.15s; }
.tab-btn.active { background: #00c850; color: #000; }
.tab-btn:not(.active):hover { background: #1e1f22; color: #dbdee1; }

.section-block { display: block; margin-bottom: 36px; }
.section-block:last-child { margin-bottom: 0; }
.section-block.hidden { display: none; }
.section-title { font-size: 20px; font-weight: 800; margin-bottom: 2px; color: #f2f3f5; letter-spacing: -0.3px; }
.section-sub { font-size: 12px; color: #6d6f78; margin-bottom: 16px; }

/* Continue Playing — single horizontally-scrolling row */
.continue-row { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; scroll-snap-type: x proximity; }
.continue-row::-webkit-scrollbar { height: 6px; }
.continue-row::-webkit-scrollbar-track { background: transparent; }
.continue-row::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
.continue-row .game-card { flex: 0 0 220px; scroll-snap-align: start; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.game-card { background: #111214; border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; border: 1px solid #2a2b2f; }
.game-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); border-color: #00c850; }
.game-thumb { height: 118px; background: #1a1b1e; display: flex; align-items: center; justify-content: center; color: #2a2b2f; font-size: 11px; letter-spacing: 1px; }
.game-info { padding: 12px 14px 14px; }
.game-title { font-size: 14px; font-weight: 700; color: #f2f3f5; line-height: 1.3; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-desc { font-size: 11px; color: #6d6f78; line-height: 1.5; }
.game-stats { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 10px; color: #4e5058; flex-wrap: wrap; }
.game-creator-link { font-size: 10px; color: #b5bac1; font-weight: 600; cursor: pointer; }
.game-creator-link:hover { color: #00c850; }
.badge { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: rgba(242,63,67,0.15); color: #f23f43; margin-left: 6px; font-weight: 700; vertical-align: middle; }
.empty-state { color: #4e5058; font-size: 13px; padding: 8px 0; }

/* Popular — compact, square-icon cards laid out as a wide grid */
.popular-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.game-card-compact { background: #111214; border-radius: 10px; overflow: hidden; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; border: 1px solid #2a2b2f; }
.game-card-compact:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); border-color: #00c850; }
.game-card-compact .game-icon { width: 100%; aspect-ratio: 1 / 1; background: #1a1b1e; display: flex; align-items: center; justify-content: center; color: #2a2b2f; font-size: 10px; letter-spacing: 1px; }
.game-card-compact .game-info { padding: 8px 10px 10px; }
.game-card-compact .game-title { font-size: 12px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card-compact .game-stats { margin-top: 5px; gap: 6px; font-size: 9px; }
.game-card-compact .game-creator-link { font-size: 9px; }

/* ── Home (redesign) ─────────────────────────────────────────────────────── */
.hm-top { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; margin-bottom: 40px; }
.hm-top.hidden { display: none; }
.hm-hero { position: relative; height: 300px; border-radius: 18px; overflow: hidden; border: 1px solid #2a2b2f; background: #0d0e10; }
.hm-hero-bg { position: absolute; inset: 0; background: #0d0e10 center / cover no-repeat; transition: opacity 0.5s; }
.hm-hero-bg .hm-tile { font-size: 160px; justify-content: flex-end; padding-right: 60px; }
.hm-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,14,0.92) 0%, rgba(10,10,14,0.65) 45%, rgba(10,10,14,0.05) 100%); pointer-events: none; }
.hm-hero-body { position: absolute; inset: 0; z-index: 1; padding: 32px 34px; display: flex; flex-direction: column; justify-content: flex-end; max-width: 560px; }
.hm-tag { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #00c850; background: rgba(0,200,80,0.12); border: 1px solid rgba(0,200,80,0.35); padding: 4px 10px; border-radius: 20px; margin-bottom: 14px; }
.hm-hero h1 { font-size: 34px; font-weight: 900; line-height: 1.08; color: #fff; letter-spacing: -0.6px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hm-hero-by { font-size: 13px; color: #b5bac1; margin-bottom: 18px; }
.hm-hero-by b { color: #f2f3f5; cursor: pointer; }
.hm-hero-by b:hover { color: #00c850; }
.hm-btns { display: flex; gap: 10px; }
.hm-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: 10px; font-weight: 800; font-size: 14px; border: none; cursor: pointer; font-family: inherit; text-decoration: none; transition: filter 0.15s, background 0.15s; }
.hm-btn.go { background: #00c850; color: #04140a; }
.hm-btn.go:hover { filter: brightness(1.08); }
.hm-btn.ghost { background: rgba(255,255,255,0.08); color: #f2f3f5; border: 1px solid rgba(255,255,255,0.14); }
.hm-btn.ghost:hover { background: rgba(255,255,255,0.14); }
.hm-dots { position: absolute; z-index: 2; right: 22px; bottom: 20px; display: flex; gap: 6px; }
.hm-dots button { width: 8px; height: 8px; border-radius: 4px; border: none; padding: 0; background: rgba(255,255,255,0.3); cursor: pointer; transition: width 0.2s, background 0.2s; }
.hm-dots button.on { width: 22px; background: #00c850; }

.hm-welcome { border-radius: 18px; border: 1px solid #2a2b2f; background: linear-gradient(160deg, #1d2a22 0%, #141518 55%); padding: 24px; display: flex; flex-direction: column; min-width: 0; }
.hm-wl-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; min-width: 0; }
.hm-wl-av { width: 62px; height: 62px; border-radius: 14px; background: #2a2b2f; border: 3px solid #2f3a33; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: #dbdee1; cursor: pointer; }
.hm-wl-hi { font-size: 12px; color: #8a8e96; font-weight: 600; }
.hm-wl-name { font-size: 20px; font-weight: 900; color: #f2f3f5; letter-spacing: -0.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-wl-text { font-size: 13px; color: #8a8e96; line-height: 1.5; margin-bottom: 16px; }
.hm-wl-bal { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.25); border: 1px solid #2a2b2f; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; text-decoration: none; transition: border-color 0.15s; }
.hm-wl-bal:hover { border-color: #00c850; }
.hm-wl-bal img { width: 34px; height: 34px; }
.hm-wl-bal .n { font-size: 20px; font-weight: 900; color: #f2f3f5; font-variant-numeric: tabular-nums; }
.hm-wl-bal .l { font-size: 11px; color: #6d6f78; font-weight: 600; }
.hm-wl-bal .go { margin-left: auto; font-size: 12px; font-weight: 700; color: #00c850; }
.hm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.hm-q { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 12px; border-radius: 10px; background: #1e1f22; border: 1px solid #2a2b2f; font-size: 13px; font-weight: 700; color: #dbdee1; text-decoration: none; cursor: pointer; transition: border-color 0.15s, filter 0.15s; }
.hm-q:hover { border-color: #3a3c42; }
.hm-q.main { grid-column: 1 / -1; background: #00c850; color: #04140a; border-color: #00c850; }
.hm-q.main:hover { filter: brightness(1.08); }
.hm-q svg { width: 16px; height: 16px; flex-shrink: 0; }

.hm-sec { margin-bottom: 40px; }
.hm-sec.hidden { display: none; }
.hm-sec-h { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.hm-sec-h h2 { font-size: 21px; font-weight: 900; color: #f2f3f5; letter-spacing: -0.3px; }
.hm-sec-h p { font-size: 12px; color: #6d6f78; margin-top: 2px; }
.hm-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.hm-arrow { width: 32px; height: 32px; border-radius: 9px; background: #1e1f22; border: 1px solid #2a2b2f; display: flex; align-items: center; justify-content: center; color: #b5bac1; font-size: 18px; line-height: 1; cursor: pointer; font-family: inherit; }
.hm-arrow:hover:not(:disabled) { border-color: #00c850; color: #f2f3f5; }
.hm-arrow:disabled { opacity: 0.35; cursor: default; }
.hm-tabs { display: flex; gap: 4px; background: #111214; border: 1px solid #232428; border-radius: 10px; padding: 3px; }
.hm-tabs button { font: inherit; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 7px; color: #6d6f78; background: none; border: none; cursor: pointer; }
.hm-tabs button:hover { color: #dbdee1; }
.hm-tabs button.on { background: #2a2b2f; color: #f2f3f5; }

.hm-row { display: flex; gap: 14px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 0 6px; }
.hm-row::-webkit-scrollbar { display: none; }
.hm-row.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.hm-card { flex: 0 0 248px; border-radius: 14px; overflow: hidden; background: #111214; border: 1px solid #232428; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.hm-card:hover { transform: translateY(-3px); border-color: #00c850; box-shadow: 0 10px 26px rgba(0,0,0,0.45); }
.hm-card .th { aspect-ratio: 16 / 9; background: #1a1b1e center / cover no-repeat; position: relative; overflow: hidden; }
.hm-resume { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: #00c850; color: #04140a; border: none; display: flex; align-items: center; justify-content: center; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,0.5); cursor: pointer; padding-left: 2px; transition: transform 0.15s; }
.hm-resume:hover { transform: scale(1.1); }
.hm-card .in { padding: 12px 14px 14px; }
.hm-t { font-size: 14px; font-weight: 800; color: #f2f3f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-m { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6d6f78; margin-top: 5px; white-space: nowrap; overflow: hidden; }
.hm-m .cr { color: #b5bac1; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.hm-m .cr:hover { color: #00c850; }
.hm-m .d { width: 3px; height: 3px; border-radius: 50%; background: #4e5058; flex-shrink: 0; }
.hm-when { font-size: 11px; color: #4e5058; margin-top: 6px; }

.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 18px 16px; }
.hm-g { cursor: pointer; min-width: 0; }
.hm-g .ic { aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #1a1b1e center / cover no-repeat; border: 1px solid #232428; position: relative; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.hm-g:hover .ic { border-color: #00c850; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,0.45); }
.hm-g .ic::after { content: '\25B6'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; background: rgba(0,0,0,0.35); opacity: 0; transition: opacity 0.15s; }
.hm-g:hover .ic::after { opacity: 1; }
.hm-live { position: absolute; left: 8px; top: 8px; z-index: 1; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,0.62); padding: 3px 8px 3px 6px; border-radius: 20px; }
.hm-live i { width: 7px; height: 7px; border-radius: 50%; background: #00c850; box-shadow: 0 0 0 3px rgba(0,200,80,0.25); }
.hm-g .hm-t { margin-top: 9px; font-size: 13px; }
.hm-g .hm-m { margin-top: 3px; }
.hm-empty { color: #6d6f78; font-size: 13px; padding: 18px 0; }

/* Games without an image get a coloured tile with their first letter. */
.hm-tile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 900; color: rgba(255,255,255,0.92); text-shadow: 0 4px 0 rgba(0,0,0,0.18); }
.hm-tile::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 14px); }
.hm-card .hm-tile { font-size: 44px; }

.hm-footer { border-top: 1px solid #232428; margin-top: 16px; padding: 22px 0 6px; font-size: 12px; color: #4e5058; display: flex; gap: 18px; flex-wrap: wrap; }
.hm-footer .sp { flex: 1; }
.hm-footer a { color: #6d6f78; text-decoration: none; }
.hm-footer a:hover { color: #dbdee1; }

/* ── Game detail ─────────────────────────────────────────────────────────── */
#page-game { max-width: 800px; margin: 0 auto; padding: 36px 40px; overflow-y: auto; height: calc(100vh - 58px); }
#page-game::-webkit-scrollbar { width: 5px; }
#page-game::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
.back-btn { background: none; border: none; color: #6d6f78; cursor: pointer; font-size: 13px; margin-bottom: 24px; padding: 0; display: flex; align-items: center; gap: 6px; transition: color 0.15s; }
.back-btn:hover { color: #dbdee1; }
.game-hero { height: 260px; background: #111214; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #2a2b2f; font-size: 12px; letter-spacing: 1px; margin-bottom: 24px; border: 1px solid #2a2b2f; }
.gd-title { font-size: 36px; font-weight: 800; margin-bottom: 20px; line-height: 1.1; color: #f2f3f5; letter-spacing: -0.5px; word-break: break-word; }
.gd-creator { display: inline-flex; align-items: center; gap: 8px; background: #111214; border: 1px solid #2a2b2f; border-radius: 8px; padding: 8px 14px; margin-bottom: 20px; cursor: pointer; transition: border-color 0.15s; text-decoration: none; }
.gd-creator:hover { border-color: #00c850; }
.gd-creator-label { font-size: 10px; color: #6d6f78; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.gd-creator-name { font-size: 13px; color: #f2f3f5; font-weight: 700; }
.gd-creator-avatar { width: 26px; height: 26px; border-radius: 50%; background: #2a2b2f; color: #dbdee1; font-weight: 800; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gd-stats { display: flex; background: #111214; border-radius: 12px; margin-bottom: 24px; overflow: hidden; border: 1px solid #2a2b2f; }
.gd-stat { flex: 1; padding: 16px 20px; border-right: 1px solid #2a2b2f; min-width: 0; }
.gd-stat:last-child { border-right: none; }
.gd-stat-label { font-size: 10px; color: #6d6f78; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; font-weight: 700; }
.gd-stat-val { font-size: 20px; font-weight: 700; color: #f2f3f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-desc { font-size: 14px; color: #b5bac1; line-height: 1.7; }
.play-btn { background: #00c850; color: #000; font-weight: 800; border: none; border-radius: 10px; padding: 15px 44px; font-size: 16px; cursor: pointer; transition: background 0.15s, transform 0.1s; display: inline-flex; align-items: center; gap: 8px; }
.play-btn:hover { background: #00b040; transform: translateY(-1px); }
.play-note { font-size: 11px; color: #4e5058; margin-top: 10px; margin-bottom: 28px; }

/* Description / Servers tabs on the game detail page */
.gd-tab-panel { display: none; }
.gd-tab-panel.active { display: block; }

/* ── Profile ─────────────────────────────────────────────────────────────── */
#page-profile { max-width: 860px; margin: 0 auto; padding: 36px 40px; overflow-y: auto; height: calc(100vh - 58px); }
#page-profile::-webkit-scrollbar { width: 5px; }
#page-profile::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
#page-account { overflow-y: auto; height: calc(100vh - 58px); }
#page-account::-webkit-scrollbar { width: 5px; }
#page-account::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }

.profile-header { background: #111214; border-radius: 14px; padding: 28px 28px 24px; border: 1px solid #2a2b2f; margin-bottom: 16px; }
.profile-avatar-wrap { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: #2a2b2f; color: #dbdee1; font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-name-row { flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.profile-username { font-size: 24px; font-weight: 800; color: #f2f3f5; letter-spacing: -0.3px; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.profile-action-btn { padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 700; border: none; cursor: pointer; transition: all 0.15s; }
.profile-action-btn.primary { background: #00c850; color: #000; }
.profile-action-btn.primary:hover { background: #00b040; }
.profile-action-btn.secondary { background: #1e1f22; color: #dbdee1; border: 1px solid #2a2b2f; }
.profile-action-btn.secondary:hover { background: #2a2b2f; }
.profile-action-btn.danger { background: transparent; color: #f23f43; border: 1px solid rgba(242,63,67,0.3); }
.profile-action-btn.danger:hover { background: rgba(242,63,67,0.1); }
.profile-join-date { font-size: 12px; color: #4e5058; margin-bottom: 12px; }
.profile-bio-wrap { display: flex; align-items: flex-start; gap: 10px; }
.profile-bio { font-size: 13px; color: #b5bac1; line-height: 1.6; flex: 1; min-height: 18px; white-space: pre-wrap; word-break: break-word; }
.profile-bio.empty { color: #4e5058; font-style: italic; }
.profile-edit-bio-btn { background: none; border: 1px solid #2a2b2f; border-radius: 6px; color: #6d6f78; font-size: 11px; padding: 4px 10px; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all 0.15s; }
.profile-edit-bio-btn:hover { border-color: #00c850; color: #00c850; }
.bio-edit-area { width: 100%; background: #1a1b1e; border: 1px solid #2a2b2f; border-radius: 8px; color: #dbdee1; font-size: 13px; padding: 10px 12px; resize: vertical; min-height: 70px; outline: none; font-family: inherit; line-height: 1.6; transition: border-color 0.15s; }
.bio-edit-area:focus { border-color: #00c850; }
.bio-edit-row { display: flex; gap: 8px; margin-top: 8px; }
.bio-char-count { font-size: 11px; color: #4e5058; margin-top: 4px; }

.profile-stats-bar { display: flex; background: #111214; border: 1px solid #2a2b2f; border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.profile-stat-item { flex: 1; padding: 14px 20px; border-right: 1px solid #2a2b2f; text-align: center; }
.profile-stat-item:last-child { border-right: none; }
.profile-stat-val { font-size: 20px; font-weight: 800; color: #f2f3f5; }
.profile-stat-label { font-size: 10px; color: #4e5058; text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; font-weight: 700; }

.profile-body { display: grid; grid-template-columns: 1fr 268px; gap: 16px; }
.profile-section-card { background: #111214; border-radius: 12px; border: 1px solid #2a2b2f; margin-bottom: 16px; overflow: hidden; }
.profile-section-head { padding: 14px 18px; font-size: 12px; font-weight: 700; color: #f2f3f5; border-bottom: 1px solid #2a2b2f; display: flex; align-items: center; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.8px; }
.profile-section-head .count { font-size: 11px; color: #4e5058; font-weight: 400; text-transform: none; letter-spacing: 0; }

.profile-games-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.profile-game-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #1a1b1e; cursor: pointer; border: 1px solid transparent; transition: border-color 0.15s; }
.profile-game-item:hover { border-color: #00c850; }
.profile-game-thumb { width: 48px; height: 36px; border-radius: 6px; background: #2a2b2f; display: flex; align-items: center; justify-content: center; font-size: 8px; color: #4e5058; letter-spacing: 0.5px; flex-shrink: 0; }
.profile-game-info { flex: 1; min-width: 0; }
.profile-game-title { font-size: 13px; font-weight: 700; color: #f2f3f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-game-meta { font-size: 11px; color: #4e5058; margin-top: 2px; }
.profile-games-empty { padding: 24px 16px; color: #4e5058; font-size: 13px; text-align: center; }

.friends-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.friend-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.friend-item:hover { background: #1a1b1e; }
.friend-avatar { width: 32px; height: 32px; border-radius: 50%; background: #2a2b2f; color: #dbdee1; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.friend-name { font-size: 13px; font-weight: 600; color: #dbdee1; }
.friend-status-text { font-size: 11px; color: #4e5058; }
.friends-empty { padding: 20px 16px; color: #4e5058; font-size: 13px; text-align: center; }

.friend-req-badge { background: #f23f43; color: #fff; font-size: 9px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }
.profile-search-wrap { padding: 10px 14px; border-bottom: 1px solid #2a2b2f; }
.profile-search-input { width: 100%; padding: 8px 12px; background: #1a1b1e; border: 1px solid #2a2b2f; border-radius: 8px; color: #dbdee1; font-size: 13px; outline: none; transition: border-color 0.15s; }
.profile-search-input:focus { border-color: #00c850; }
.search-results-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.search-result-item:hover { background: #1a1b1e; }

/* ── My Games ────────────────────────────────────────────────────────────── */
#page-mygames { max-width: 900px; margin: 0 auto; padding: 36px 40px; overflow-y: auto; height: calc(100vh - 58px); }
#page-mygames::-webkit-scrollbar { width: 5px; }
#page-mygames::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
.mygames-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.mygames-title { font-size: 28px; font-weight: 800; color: #f2f3f5; letter-spacing: -0.4px; }
.mygames-create-btn { background: #00c850; color: #000; font-weight: 700; border: none; border-radius: 9px; padding: 10px 20px; font-size: 13px; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; gap: 7px; }
.mygames-create-btn:hover { background: #00b040; }
.mygames-list { display: flex; flex-direction: column; gap: 10px; }
.mygames-item { background: #111214; border: 1px solid #2a2b2f; border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; transition: border-color 0.15s; }
.mygames-item:hover { border-color: #3a3b3f; }
.mygames-item-thumb { width: 64px; height: 48px; border-radius: 8px; background: #1a1b1e; border: 1px solid #2a2b2f; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #4e5058; letter-spacing: 0.5px; flex-shrink: 0; }
.mygames-item-info { flex: 1; min-width: 0; }
.mygames-item-title { font-size: 15px; font-weight: 700; color: #f2f3f5; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mygames-item-meta { font-size: 11px; color: #4e5058; display: flex; align-items: center; gap: 10px; }
.mygames-status-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.mygames-status-badge.live { background: rgba(0,200,80,0.12); color: #00c850; }
.mygames-status-badge.draft { background: rgba(255,255,255,0.05); color: #6d6f78; }
.mygames-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.mygames-action-btn { padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 700; border: 1px solid #2a2b2f; background: #1a1b1e; color: #dbdee1; cursor: pointer; transition: all 0.15s; }
.mygames-action-btn:hover { background: #2a2b2f; border-color: #3a3b3f; }
.mygames-action-btn.primary { background: #00c850; color: #000; border-color: #00c850; }
.mygames-action-btn.primary:hover { background: #00b040; border-color: #00b040; }
.mygames-empty { text-align: center; padding: 60px 20px; color: #4e5058; }
.mygames-empty-icon { font-size: 48px; margin-bottom: 16px; }
.mygames-empty-text { font-size: 15px; font-weight: 600; color: #6d6f78; margin-bottom: 8px; }
.mygames-empty-sub { font-size: 13px; color: #4e5058; }

/* ── Create Game page ────────────────────────────────────────────────────── */
#page-creategame { max-width: 600px; margin: 0 auto; padding: 36px 40px; overflow-y: auto; height: calc(100vh - 58px); }
#page-creategame::-webkit-scrollbar { width: 5px; }
#page-creategame::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
.creategame-title { font-size: 26px; font-weight: 800; color: #f2f3f5; margin-bottom: 28px; letter-spacing: -0.3px; }
.creategame-section { margin-bottom: 24px; }
.creategame-label { font-size: 10px; color: #6d6f78; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; margin-bottom: 10px; display: block; }
.creategame-drop { border: 2px dashed #2a2b2f; border-radius: 12px; background: #111214; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; position: relative; overflow: hidden; }
.creategame-drop:hover { border-color: #00c850; background: #111f17; }
.creategame-drop.icon-drop { width: 120px; height: 120px; border-radius: 16px; }
.creategame-drop.thumb-drop { width: 100%; height: 160px; }
.creategame-drop-icon { font-size: 28px; margin-bottom: 8px; color: #4e5058; }
.creategame-drop-text { font-size: 11px; color: #4e5058; font-weight: 600; }
.creategame-drop-sub { font-size: 10px; color: #3a3b3f; margin-top: 3px; }
.creategame-drop img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.creategame-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.creategame-assets-row { display: flex; gap: 20px; align-items: flex-start; }
.creategame-input { width: 100%; padding: 11px 14px; background: #111214; border: 1px solid #2a2b2f; border-radius: 9px; color: #dbdee1; font-size: 14px; outline: none; transition: border-color 0.15s; font-family: inherit; }
.creategame-input:focus { border-color: #00c850; }
.creategame-textarea { width: 100%; padding: 11px 14px; background: #111214; border: 1px solid #2a2b2f; border-radius: 9px; color: #dbdee1; font-size: 14px; outline: none; transition: border-color 0.15s; font-family: inherit; resize: vertical; min-height: 90px; line-height: 1.6; }
.creategame-textarea:focus { border-color: #00c850; }
.creategame-actions { display: flex; gap: 10px; margin-top: 32px; }
.creategame-submit-btn { flex: 1; padding: 13px; background: #00c850; color: #000; font-weight: 700; font-size: 15px; border: none; border-radius: 9px; cursor: pointer; transition: background 0.15s; }
.creategame-submit-btn:hover { background: #00b040; }
.creategame-cancel-btn { padding: 13px 24px; background: #1e1f22; color: #dbdee1; font-weight: 700; font-size: 15px; border: 1px solid #2a2b2f; border-radius: 9px; cursor: pointer; transition: background 0.15s; }
.creategame-cancel-btn:hover { background: #2a2b2f; }

/* ── Avatar editor ───────────────────────────────────────────────────────── */
#page-avatar { max-width: 1000px; margin: 0 auto; padding: 36px 40px; overflow-y: auto; height: calc(100vh - 58px); }
#page-avatar::-webkit-scrollbar { width: 5px; }
#page-avatar::-webkit-scrollbar-thumb { background: #2a2b2f; border-radius: 3px; }
.avatar-title { font-size: 28px; font-weight: 800; color: #f2f3f5; letter-spacing: -0.4px; margin-bottom: 24px; }
.avatar-layout { display: flex; gap: 24px; align-items: flex-start; }
.avatar-preview-wrap { background: #111214; border: 1px solid #2a2b2f; border-radius: 14px; overflow: hidden; flex-shrink: 0; width: 460px; height: 460px; position: relative; }
.avatar-preview-hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11px; color: #4e5058; pointer-events: none; }
.avatar-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6d6f78; font-size: 13px; }
.avatar-controls { flex: 1; background: #111214; border: 1px solid #2a2b2f; border-radius: 14px; padding: 24px; min-width: 260px; }
.avatar-color-row { margin-bottom: 20px; }
.avatar-color-row:last-of-type { margin-bottom: 0; }
.avatar-color-label { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: #6d6f78; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; margin-bottom: 9px; }
.avatar-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-swatch { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform 0.1s, border-color 0.15s; }
.avatar-swatch:hover { transform: translateY(-1px); }
.avatar-swatch.selected { border-color: #00c850; }
.avatar-color-custom { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #2a2b2f; cursor: pointer; background: transparent; padding: 0; }
.avatar-save-btn { display: block; width: 100%; padding: 12px; margin-top: 28px; background: #00c850; color: #000; font-weight: 700; font-size: 14px; border: none; border-radius: 9px; cursor: pointer; transition: background 0.15s; }
.avatar-save-btn:hover { background: #00b040; }
.avatar-save-status { font-size: 11px; color: #6d6f78; margin-top: 10px; min-height: 14px; text-align: center; }

/* ── Nav link + avatar equip lists ───────────────────────────────────────── */
.nav-link { color: #b5bac1; font-size: 14px; font-weight: 600; text-decoration: none; padding: 7px 12px; border-radius: 8px; margin-left: 2px; transition: background 0.15s, color 0.15s; }
.nav-link:hover { background: #1e1f22; color: #f2f3f5; }
.nav-link.active { color: #00c850; background: rgba(0,200,80,0.08); }
.nav-search { display: flex; align-items: center; gap: 8px; width: 300px; height: 36px; padding: 0 10px 0 12px; background: #1e1f22; border: 1px solid #2a2b2f; border-radius: 10px; color: #6d6f78; transition: border-color 0.15s; flex-shrink: 1; min-width: 0; }
.nav-search:focus-within { border-color: #00c850; }
.nav-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: #f2f3f5; font: inherit; font-size: 13px; }
.nav-search input::placeholder { color: #6d6f78; }
.nav-search kbd { font: 600 10px system-ui, sans-serif; color: #4e5058; border: 1px solid #2a2b2f; border-radius: 4px; padding: 1px 5px; }
.avatar-equip-section { margin-top: 24px; }
.avatar-required { color: #00c850; font-size: 10px; letter-spacing: 1px; }
.avatar-equip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.equip-card { width: 96px; cursor: pointer; border: 2px solid #2a2b2f; border-radius: 10px; background: #1a1b1e; padding: 6px; transition: border-color 0.15s, transform 0.1s; user-select: none; }
.equip-card:hover { transform: translateY(-1px); border-color: #3a3b40; }
.equip-card.selected { border-color: #00c850; }
.equip-thumb { width: 100%; aspect-ratio: 1; border-radius: 6px; background: #111214 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #4e5058; font-size: 26px; }
.equip-name { font-size: 11px; color: #dbdee1; margin-top: 6px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-note { font-size: 11px; color: #6d6f78; margin-top: 10px; line-height: 1.5; }
.avatar-catalog-link { display: inline-block; margin-top: 22px; font-size: 12px; color: #6d6f78; text-decoration: none; }
.avatar-catalog-link:hover { color: #00c850; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .hm-top { grid-template-columns: 1fr; }
  .nav-search { width: 220px; }
}

@media (max-width: 900px) {
  #page-home { padding: 22px 24px 32px; }
  #page-game, #page-profile, #page-mygames, #page-creategame, #page-avatar { padding: 24px; }
  .profile-body { grid-template-columns: 1fr; }
  .avatar-layout { flex-wrap: wrap; }
  .avatar-preview-wrap { width: 100%; max-width: 460px; height: auto; aspect-ratio: 1 / 1; }
  .avatar-controls { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
  nav { padding: 0 14px; gap: 10px; overflow-x: auto; }
  nav::-webkit-scrollbar { display: none; }
  .nav-logo img { height: 28px; }
  .nav-link { font-size: 13px; padding: 6px 9px; margin-left: 0; white-space: nowrap; }
  .nav-link[href="/catalog.html"] { display: none; }

  #page-home { padding: 16px 16px 28px; }
  .nav-search { display: none; }
  .hm-mobile-search { display: flex !important; width: 100%; height: 40px; margin-bottom: 16px; }
  .hm-hero { height: 240px; }
  .hm-hero-body { padding: 22px; }
  .hm-hero h1 { font-size: 26px; }
  .hm-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px 10px; }
  .hm-card { flex-basis: 200px; }
  .hm-sec-h { flex-wrap: wrap; }
  .hm-right { margin-left: 0; }
  .home-header { flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
  .home-search { max-width: none; width: 100%; }
  .section-title { font-size: 17px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .popular-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
  .continue-row .game-card { flex-basis: 170px; }

  #page-game, #page-profile, #page-mygames, #page-creategame, #page-avatar { padding: 18px 16px; }
  .game-hero { height: 180px; }
  .gd-title { font-size: 26px; }
  .gd-stats { flex-wrap: wrap; }
  .gd-stat { flex: 1 1 50%; border-right: none; border-bottom: 1px solid #2a2b2f; }
  .gd-stat:nth-child(2n) { border-right: none; }
  .play-btn { width: 100%; justify-content: center; padding: 15px; }

  .profile-header { padding: 20px 18px 18px; }
  .profile-avatar-wrap { flex-wrap: wrap; }
  .profile-actions { margin-left: 0; width: 100%; }
  .profile-action-btn { flex: 1; }
  .profile-stats-bar { flex-wrap: wrap; }
  .profile-stat-item { flex: 1 1 33%; }

  .mygames-header { flex-wrap: wrap; gap: 12px; }
  .mygames-item { flex-wrap: wrap; }
  .mygames-item-actions { width: 100%; }
  .mygames-action-btn { flex: 1; }

  .creategame-assets-row { flex-wrap: wrap; }
  .creategame-drop.thumb-drop { width: 100%; }

  .avatar-equip-grid { justify-content: center; }
}

@media (max-width: 420px) {
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .popular-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .gd-title { font-size: 22px; }
  .gd-stat { flex: 1 1 100%; }
  .profile-stat-item { flex: 1 1 50%; }
}
