:root {
  color-scheme: dark;
  --bg: #090b0b;
  --panel: #111716;
  --panel-2: #18201d;
  --line: #334039;
  --text: #edf2e8;
  --muted: #a9b5aa;
  --gold: #c9a96a;
  --green: #78a878;
  --danger: #ad6d62;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(120, 168, 120, .18), transparent 36rem),
    linear-gradient(#0c100f, var(--bg));
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}
button, a { font: inherit; }
button, .account-link {
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--panel-2);
  color: var(--text);
  padding: .65rem .9rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, button:focus-visible, .account-link:hover, .account-link:focus-visible {
  border-color: var(--gold);
  outline: 2px solid transparent;
}
.trial-shell { width: min(1320px, 100%); margin: 0 auto; padding: 1rem; }
.trial-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.brand img { width: clamp(110px, 16vw, 180px); display: block; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .25rem; font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: 1.05rem; color: var(--gold); }
.eyebrow { margin-bottom: .3rem; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.world-note {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(201, 169, 106, .45);
  border-radius: .65rem;
  background: rgba(83, 70, 45, .22);
  color: var(--muted);
}
.world-note strong { color: var(--gold); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; }
.stage-card, .trial-panel { border: 1px solid var(--line); border-radius: .8rem; background: rgba(17, 23, 22, .96); overflow: hidden; }
.stage-card { position: relative; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3); }
.stage-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.toolbar-actions { display: flex; gap: .45rem; }
.status-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--gold); margin-right: .4rem; box-shadow: 0 0 .7rem currentColor; }
.status-dot.ready { background: var(--green); }
.status-dot.error { background: var(--danger); }
canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #101611;
  touch-action: none;
  image-rendering: auto;
  cursor: crosshair;
}
#trial-atmosphere,
#trial-cinematic-overlay {
  background: transparent !important;
  cursor: default;
}
.loading-cover { position: absolute; inset: 3.3rem 0 0; display: grid; place-content: center; gap: .35rem; padding: 2rem; text-align: center; background: rgba(9, 11, 11, .9); }
.loading-cover[hidden] { display: none; }
.trial-panel { padding: 1rem; display: grid; align-content: start; gap: 1rem; max-height: 708px; overflow-y: auto; }
.trial-panel section { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.trial-panel section:last-child { border-bottom: 0; }
blockquote { margin: 0; color: #d7dfd3; line-height: 1.45; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.metrics div { background: var(--panel-2); border-radius: .5rem; padding: .6rem; min-width: 0; }
.metrics .wide { grid-column: 1 / -1; }
.metrics span, .metrics strong { display: block; }
.metrics span { color: var(--muted); font-size: .72rem; }
.metrics strong { margin-top: .2rem; overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.section-heading h2 { margin-bottom: .5rem; }
.section-heading span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
#trial-minimap { border: 1px solid var(--line); border-radius: .45rem; background: #151b18; }
#trial-minimap:hover, #trial-minimap:focus-visible { border-color: var(--gold); }
.map-legend { display: flex; flex-wrap: wrap; gap: .35rem .7rem; align-items: center; margin: .55rem 0 0; color: var(--muted); font-size: .72rem; }
.map-legend span { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; margin-right: -.25rem; }
.legend-player { background: #edf2e8; }
.legend-landmark { background: #d3b36f; }
.legend-water { background: #24434a; }
.objective-list label { display: block; margin: .55rem 0; color: var(--muted); }
.region-list { columns: 2; margin: 0; padding-left: 1.2rem; color: var(--muted); }
.region-list li { margin-bottom: .35rem; break-inside: avoid; }
kbd { background: #050706; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem; padding: .1rem .35rem; }
.touch-pad { display: grid; justify-content: center; gap: .35rem; margin: 1rem 0; }
.touch-pad > button { justify-self: center; }
.touch-pad div { display: flex; gap: .35rem; }
.touch-pad button { min-width: 4rem; min-height: 3.4rem; font-size: 1.25rem; touch-action: manipulation; user-select: none; }
footer { color: var(--muted); text-align: center; font-size: .9rem; }
@media (max-width: 920px) {
  .trial-header { grid-template-columns: auto 1fr; }
  .account-link { grid-column: 1 / -1; text-align: center; }
  .game-layout { grid-template-columns: 1fr; }
  .trial-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
  .metrics { grid-column: 1 / -1; }
  .minimap-panel { grid-column: 1 / -1; }
  #trial-minimap { max-width: 480px; }
}
@media (max-width: 620px) {
  .trial-shell { padding: .55rem; }
  .trial-header { align-items: start; }
  .world-note { flex-direction: column; gap: .25rem; }
  .trial-panel { grid-template-columns: 1fr; }
  .stage-toolbar { align-items: flex-start; }
  .toolbar-actions { flex-direction: column; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .region-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
