* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a1a0a; font-family: 'Segoe UI', Arial, sans-serif; }
#game-canvas { position: fixed; inset: 0; display: block; }

/* Every menu/dashboard/stats/admin screen is a full page you scroll, not a
   small centered card — matches the public site's full-page feel. */
.overlay {
  position: fixed; inset: 0; overflow-y: auto;
  background: linear-gradient(180deg, #08170c 0%, #0a1f10 40%, #0d2412 100%);
  z-index: 20;
}
.overlay.hidden { display: none; }

.panel {
  max-width: 960px; margin: 0 auto; padding: 56px 32px 80px;
  text-align: center; color: #eafff0;
}
.panel h1 { font-size: 32px; letter-spacing: 2px; color: #4dffa0; text-shadow: 0 0 12px rgba(77,255,160,0.6); margin-bottom: 8px; }
.panel h2 { font-size: 26px; color: #4dffa0; margin-bottom: 16px; }
.subtitle { margin: 16px 0 8px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #8fdba8; }

.grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: #16401f; color: #d6ffe4; border: 1px solid #2fdc6b55;
  padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: all 0.15s;
}
.chip:hover { background: #1f5a2c; border-color: #4dffa0; }
.chip.active { background: #2fdc6b; color: #06220d; font-weight: bold; border-color: #4dffa0; }

.start-btn {
  margin-top: 24px; width: 100%; padding: 14px; font-size: 16px; font-weight: bold;
  background: linear-gradient(90deg, #2fdc6b, #17b854); color: #06220d; border: none;
  border-radius: 10px; cursor: pointer; letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(47,220,107,0.4);
}
.start-btn:disabled { background: #2a3a2f; color: #6a8a75; cursor: not-allowed; box-shadow: none; }
.start-btn.secondary { background: transparent; border: 1px solid #2fdc6b88; color: #cfe; box-shadow: none; margin-top: 10px; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; color: #fff; font-family: 'Segoe UI', Arial, sans-serif; }
#hud.hidden { display: none; }

.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 6px; }
.score-box {
  background: rgba(6, 20, 10, 0.8); border: 1px solid #2fdc6b55; border-radius: 10px;
  padding: 8px 20px; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: bold;
}
.score-box span#score-a, .score-box span#score-b { color: #4dffa0; font-size: 24px; }
.dash { color: #6a8a75; }
.clock-box { background: rgba(6,20,10,0.8); border: 1px solid #2fdc6b55; border-radius: 8px; padding: 4px 14px; font-size: 16px; font-variant-numeric: tabular-nums; }
.event-box { min-height: 24px; font-size: 15px; font-weight: bold; color: #ffe14d; text-shadow: 0 0 8px rgba(255,225,77,0.7); transition: opacity 0.3s; }

.hud-bottom { position: absolute; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 8px; width: 220px; }
.bar-wrap { display: flex; flex-direction: column; gap: 2px; }
.bar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #b9d9c2; text-shadow: 0 1px 2px #000; }
.bar { width: 100%; height: 10px; background: rgba(0,0,0,0.5); border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
.bar-fill { height: 100%; width: 100%; transition: width 0.1s linear; }
.bar-fill.stamina { background: linear-gradient(90deg, #4dffa0, #17b854); }
.bar-fill.power { background: linear-gradient(90deg, #ffe14d, #ff5b4d); }

.controls-hint { position: absolute; bottom: 16px; right: 16px; font-size: 12px; color: #cfe; background: rgba(0,0,0,0.5); padding: 6px 10px; border-radius: 8px; text-align: right; max-width: 260px; }

.mouse-action-buttons { position: absolute; top: 70px; right: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid #2fdc6b88; background: rgba(6,20,10,0.8);
  color: #eafff0; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.round-btn:hover { background: rgba(47,220,107,0.25); }

.final-score { font-size: 40px; font-weight: bold; margin: 12px 0; color: #4dffa0; }

.face-upload-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.webcam-panel { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.webcam-panel.hidden { display: none; }
.webcam-panel video { width: 260px; height: 195px; border-radius: 10px; border: 2px solid #2fdc6b88; background: #000; object-fit: cover; transform: scaleX(-1); }
.webcam-actions { display: flex; gap: 8px; }
.face-preview {
  width: 56px; height: 56px; border-radius: 50%; background: #16401f; border: 2px solid #2fdc6b88;
  display: flex; align-items: center; justify-content: center; font-size: 24px; overflow: hidden;
}
.face-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-chip { display: inline-block; }

.kit-swatch { display: flex; align-items: center; gap: 8px; }
.kit-swatch .swatch-dot { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(255,255,255,0.4); }

.text-input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2fdc6b55;
  background: #0d2412; color: #eafff0; font-size: 14px; outline: none;
}
.text-input:focus { border-color: #4dffa0; }

.auth-panel { width: min(420px, 92vw); }
.auth-tabs { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-form.hidden { display: none; }
.auth-error { color: #ff5b4d; font-size: 13px; margin-top: 10px; min-height: 18px; }

.password-row { display: flex; gap: 6px; }
.password-row .text-input { flex: 1; }
.password-toggle {
  background: #16401f; border: 1px solid #2fdc6b55; border-radius: 8px; color: #eafff0;
  font-size: 15px; padding: 0 12px; cursor: pointer;
}
.password-toggle:hover { background: #1f5a2c; }

.landing-panel { width: min(620px, 92vw); }
.landing-tagline { color: #b9d9c2; font-size: 14px; margin: 10px 0 20px; line-height: 1.5; }
.landing-stats-preview { font-size: 13px; color: #8fdba8; margin-bottom: 16px; min-height: 18px; }

/* ---- Dashboard ---- */
.dashboard { max-width: 1100px; margin: 0 auto; padding: 56px 24px 80px; }
.account-badge {
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px;
  color: #b9d9c2; background: rgba(0,0,0,0.25); border-radius: 8px; padding: 6px 14px; margin-bottom: 14px; width: fit-content; margin-left: auto; margin-right: auto;
}
.account-switch-link {
  background: none; border: 1px solid #2fdc6b66; color: #4dffa0; font-size: 11px; padding: 3px 10px; border-radius: 6px; cursor: pointer;
}
.account-switch-link:hover { background: rgba(47,220,107,0.15); }
.dashboard-header { text-align: center; margin-bottom: 12px; }
.dashboard-header h1 {
  font-size: 36px; letter-spacing: 2px; font-weight: 800;
  background: linear-gradient(135deg, #4dffa0 0%, #2fdc6b 50%, #4dffa0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(77,255,160,0.45);
}
.dashboard-summary {
  text-align: center; font-size: 15px; color: #8fdba8; margin: 14px 0 32px; min-height: 18px;
}
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px;
}
.dash-box {
  min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(160deg, #16401f, #0a1f10); border: 2px solid #2fdc6b44; border-radius: 14px;
  color: #eafff0; cursor: pointer; padding: 18px 14px; text-align: center;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.dash-box:hover { transform: translateY(-4px) scale(1.02); border-color: #4dffa0; box-shadow: 0 12px 32px rgba(47,220,107,0.35), 0 0 0 1px rgba(77,255,160,0.2) inset; }
.dash-box:active { transform: translateY(-1px) scale(0.99); }
.dash-box-icon { transition: transform 0.15s; }
.dash-box:hover .dash-box-icon { transform: scale(1.15); }
.dash-box-icon { font-size: 34px; line-height: 1; }
.dash-box-title { font-size: 16px; font-weight: bold; letter-spacing: 0.5px; overflow-wrap: break-word; word-break: break-word; }
.dash-box-sub { font-size: 12px; color: #b9d9c2; line-height: 1.4; overflow-wrap: break-word; word-break: break-word; }
.dash-box-primary { background: linear-gradient(160deg, #1f8a4b, #0a3018); border-color: #4dffa0; }
.dash-box-admin { background: linear-gradient(160deg, #4a2a0a, #2a1505); border-color: #ffb24d88; }
.dash-box-admin .dash-box-title { color: #ffcf8a; }
.dash-box-muted { opacity: 0.75; }
.dash-box.hidden { display: none; }
.dash-box-wide { grid-column: 1 / -1; min-height: auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 16px; padding: 20px 24px; text-align: left; }
.dash-box-wide .dash-box-icon { font-size: 44px; flex-shrink: 0; }
.dash-box-wide .dash-box-title { font-size: 20px; }
.dash-box-wide .dash-box-sub { min-width: 0; }

.corner-logout {
  position: fixed; top: 14px; right: 14px; z-index: 30;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid #2fdc6b55;
  background: rgba(6,20,10,0.7); color: #eafff0; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.corner-logout:hover { background: rgba(255,91,77,0.25); border-color: #ff5b4d; }
.corner-logout.hidden { display: none; }

.lang-toggle { position: fixed; bottom: 14px; left: 14px; z-index: 30; display: flex; gap: 4px; }
.lang-toggle.hidden { display: none; }
.lang-btn {
  width: 34px; height: 32px; border-radius: 8px; border: 1px solid #2fdc6b55; background: rgba(6,20,10,0.7);
  color: #b9d9c2; font-size: 12px; font-weight: bold; cursor: pointer;
}
.lang-btn.active { background: #2fdc6b; color: #06220d; border-color: #4dffa0; }
.lang-btn:hover:not(.active) { background: rgba(47,220,107,0.2); }

/* ---- Public site: normal full-width scrolling pages, not modal panels ---- */
.site-page {
  position: fixed; inset: 0; z-index: 15; overflow-y: auto;
  background: linear-gradient(180deg, #08170c 0%, #0a1f10 40%, #0d2412 100%);
  color: #eafff0;
}
.site-page.hidden { display: none; }

.site-nav {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 28px; background: rgba(6, 20, 10, 0.92); border-bottom: 1px solid #2fdc6b33;
  backdrop-filter: blur(6px); flex-wrap: wrap;
}
.site-nav-brand { font-weight: bold; color: #4dffa0; font-size: 15px; letter-spacing: 1px; cursor: pointer; }
.site-nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav-link {
  background: none; border: none; color: #b9d9c2; font-size: 13px; padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.site-nav-link:hover { background: rgba(47,220,107,0.12); color: #eafff0; }
.site-nav-auth { display: flex; gap: 8px; }
.site-nav-btn {
  background: none; border: 1px solid #2fdc6b55; color: #eafff0; font-size: 13px; font-weight: bold;
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
}
.site-nav-btn:hover { background: rgba(47,220,107,0.12); }
.site-nav-btn-primary { background: #2fdc6b; color: #06220d; border-color: #4dffa0; }
.site-nav-btn-primary:hover { background: #4dffa0; }

.site-hero { text-align: center; padding: 80px 24px 50px; max-width: 800px; margin: 0 auto; }
.hero-title { font-size: 38px; letter-spacing: 2px; color: #4dffa0; text-shadow: 0 0 16px rgba(77,255,160,0.6); }
.hero-tagline { color: #b9d9c2; font-size: 17px; margin: 18px 0 28px; line-height: 1.6; }
.hero-cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-cta { width: auto; min-width: 190px; }

.site-section { max-width: 800px; margin: 0 auto; padding: 40px 24px; border-top: 1px solid #2fdc6b22; }
.site-section-first { border-top: none; padding-top: 60px; }
.site-section h1 { font-size: 26px; color: #4dffa0; margin-bottom: 20px; }
.site-section h3 { font-size: 16px; color: #4dffa0; margin: 20px 0 8px; }
.site-section p { font-size: 14px; line-height: 1.7; color: #d6ffe4; }

.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 16px; }
.feature-card { background: #0d2412; border: 1px solid #2fdc6b33; border-radius: 12px; padding: 18px; }
.feature-card h3 { margin-top: 0; }
.feature-card p { font-size: 13px; }

.auth-page-section { max-width: 440px; text-align: center; }
.auth-page-section h1 { text-align: center; }
.auth-page-section .auth-tabs { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.auth-page-section .auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; text-align: left; }

.stats-panel { width: 100%; max-width: 900px; text-align: left; }
.stats-panel h2 { text-align: center; }
.stats-summary {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0;
}
.stats-summary .stat-chip {
  background: linear-gradient(160deg, #1a4a24, #0d2412); border: 1px solid #2fdc6b55; border-radius: 10px; padding: 12px 18px;
  text-align: center; min-width: 90px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.stats-summary .stat-chip .num { display: block; font-size: 22px; font-weight: 800; color: #4dffa0; text-shadow: 0 0 10px rgba(77,255,160,0.4); }
.stats-summary .stat-chip .lbl { font-size: 11px; color: #b9d9c2; text-transform: uppercase; letter-spacing: 1px; }

.stats-history-wrap { max-height: 340px; overflow-y: auto; margin: 12px 0; border: 1px solid #2fdc6b33; border-radius: 8px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th { position: sticky; top: 0; background: #16401f; color: #cfe; padding: 8px 10px; text-align: left; }
.stats-table td { padding: 7px 10px; border-top: 1px solid #2fdc6b22; color: #eafff0; }
.stats-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.result-win { color: #4dffa0; font-weight: bold; }
.result-draw { color: #ffe14d; font-weight: bold; }
.result-loss { color: #ff5b4d; font-weight: bold; }
.stats-empty { text-align: center; color: #6a8a75; padding: 20px; }
.howto-content { text-align: left; margin: 12px 0; }
.howto-content p { color: #eafff0; font-size: 14px; line-height: 1.6; margin-bottom: 4px; }
.howto-content .subtitle { margin-top: 16px; }

.squad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0; }
.squad-slot { display: flex; align-items: center; gap: 8px; background: #0d2412; border: 1px solid #2fdc6b33; border-radius: 8px; padding: 8px 10px; }
.squad-slot .squad-slot-label { font-size: 11px; color: #8fdba8; min-width: 46px; flex-shrink: 0; }
.squad-slot input { flex: 1; min-width: 0; background: transparent; border: none; color: #eafff0; font-size: 13px; outline: none; }

.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 20px 0; }
.achievement-badge {
  background: linear-gradient(160deg, #16401f, #0a1f10); border: 2px solid #2fdc6b44; border-radius: 14px;
  padding: 20px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.achievement-badge.locked { opacity: 0.35; filter: grayscale(0.8); }
.achievement-badge .badge-icon { font-size: 40px; }
.achievement-badge .badge-title { font-weight: bold; font-size: 14px; }
.achievement-badge .badge-desc { font-size: 11px; color: #b9d9c2; }

.admin-action-btn {
  background: rgba(255,91,77,0.15); border: 1px solid #ff5b4d66; color: #ff9a8f;
  font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.admin-action-btn:hover { background: rgba(255,91,77,0.3); }
