:root {
  color-scheme: dark;
  --gold: #d8ae65;
  --gold-light: #f0d39a;
  --panel: rgba(19, 23, 34, .94);
  --muted: #9da6b8;
  font-family: Inter, Segoe UI, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: #f3f0e9;
  background: #0c1018;
}
.background-glow {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 10%, #29364b 0%, #111724 48%, #090c12 100%);
}
.topbar {
  position: relative; display: flex; justify-content: space-between;
  align-items: center; padding: 22px 5vw;
  border-bottom: 1px solid #ffffff15; color: var(--muted);
  letter-spacing: 2px; font-size: 11px;
}
.brand { color: var(--gold-light); font-weight: 900; font-size: 15px; }
.brand span { color: white; }
main { position: relative; max-width: 1100px; margin: 55px auto; padding: 0 20px; }
.panel {
  background: var(--panel); border: 1px solid #ffffff18;
  border-radius: 14px; box-shadow: 0 25px 90px #0008;
}
.auth-panel { width: min(460px, 100%); margin: 50px auto; padding: 36px; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: 3px; font-weight: 800; }
h1 { font-size: clamp(25px, 5vw, 38px); line-height: 1.15; margin: 16px 0 8px; }
h1 span { color: var(--gold-light); }
.subtitle, .section-heading p { color: var(--muted); font-size: 13px; }
.auth-tabs { display: flex; gap: 8px; margin: 28px 0 22px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.tab, .secondary {
  border: 1px solid #ffffff20; color: #d8dce5; background: #ffffff08;
  border-radius: 7px; padding: 11px 15px; font-size: 11px; font-weight: 800;
}
.tab.active { border-color: var(--gold); color: var(--gold-light); }
form { display: flex; flex-direction: column; gap: 10px; }
label { color: #c5cbd6; font-size: 11px; margin-top: 8px; }
input, select {
  width: 100%; color: white; background: #0c111b;
  border: 1px solid #ffffff20; border-radius: 7px;
  padding: 13px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
.primary {
  color: #1b1720; background: linear-gradient(110deg, #c5964c, #f0d39a);
  border: 0; border-radius: 7px; padding: 14px;
  font-size: 11px; font-weight: 900; letter-spacing: 1px;
  margin-top: 12px;
}
.primary:hover { filter: brightness(1.1); }
.message { min-height: 18px; color: var(--gold-light); font-size: 12px; }
.hidden { display: none !important; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
h2 { margin: 10px 0 5px; font-size: 27px; }
.character-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.character-card {
  border: 1px solid #ffffff20; background: #171d2a;
  border-radius: 10px; padding: 19px; min-height: 150px;
  position: relative; overflow: hidden;
}
.character-card::after {
  content: ""; position: absolute; width: 100px; height: 100px;
  right: -35px; bottom: -40px; border-radius: 50%;
  background: var(--class-color); filter: blur(40px); opacity: .35;
}
.class-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.character-card h3 { margin: 12px 0 5px; font-size: 19px; }
.character-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.create-panel { margin-top: 25px; padding: 24px; }
.create-panel h3 { margin-top: 0; color: var(--gold-light); }
.create-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; }
.create-form .primary { margin: 0; height: 44px; }
#game-screen { height: min(72vh, 700px); min-height: 440px; }
.game-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 17px; background: #171d2a; border-radius: 9px 9px 0 0;
}
.game-toolbar strong, .game-toolbar small { display: block; }
.game-toolbar small { color: var(--gold); margin-top: 4px; }
.game-controls { display: flex; gap: 15px; align-items: center; color: var(--muted); font-size: 11px; }
#game-container { height: calc(100% - 58px); position: relative; overflow: hidden; background: #18271f; }
#game-container canvas { display: block; width: 100%; height: 100%; }
.world-label, .world-hint {
  position: absolute; z-index: 2; top: 15px; left: 16px;
  padding: 9px 12px; background: #0b111bd9; border: 1px solid #ffffff25;
  border-radius: 5px; color: var(--gold-light); font-size: 10px; letter-spacing: 1px;
  pointer-events: none;
}
.world-hint { top: auto; bottom: 15px; color: white; letter-spacing: 0; }
footer { position: relative; text-align: center; padding: 20px; color: #687286; font-size: 9px; letter-spacing: 2px; }
@media(max-width:650px) {
  main { margin: 25px auto; }
  .auth-panel { padding: 25px; margin: 20px auto; }
  .create-form { display: flex; }
  .game-toolbar, .game-controls { flex-wrap: wrap; gap: 9px; }
  .game-controls { justify-content: flex-end; }
}
