/* Dragon Riders: menus and the flight display, in the colours of Taran Matharu's site. */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500 700; font-display: swap; src: url(/fonts/cormorant-garamond-500-latin.woff2) format("woff2"); }
@font-face { font-family: "Marcellus SC"; font-weight: 400; font-display: swap; src: url(/fonts/marcellus-sc-400-latin.woff2) format("woff2"); }

:root {
  --ink: #0b0908;
  --ink-2: #15110e;
  --parch: #efe6d4;
  --parch-dim: #b8ab95;
  --gold: #d8a85b;
  --gold-hi: #f2cd86;
  --line: rgba(239, 230, 212, 0.18);
  --display: "Cormorant Garamond", Georgia, serif;
  --label: "Marcellus SC", Georgia, serif;
  --body: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--parch); font: 400 16px/1.5 var(--body); }
body { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
canvas#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

/* screens over the world */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(11,9,8,.35), rgba(11,9,8,.82)); overflow-y: auto; z-index: 10; }
.menu-inner { width: min(860px, 100%); text-align: center; padding: 24px 0; }
.menu-inner.small { width: min(440px, 100%); display: grid; gap: 14px; }
.eyebrow { margin: 0 0 .6rem; font: 400 .78rem/1 var(--label); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
h1, h2 { margin: 0 0 .8rem; font: 600 clamp(2.6rem, 8vw, 4.6rem)/1 var(--display); letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
h2 { font-size: clamp(2.2rem, 7vw, 3.4rem); }
.lede { margin: 0 auto 1.6rem; max-width: 34em; color: var(--parch-dim); font-size: 1.05rem; }

.dragons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 1.6rem; }
.dragon { position: relative; padding: 18px 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: rgba(21,17,14,.78); cursor: pointer; text-align: center; transition: border-color .2s, transform .2s, background .2s; }
.dragon:hover { transform: translateY(-2px); border-color: rgba(242,205,134,.5); }
.dragon[aria-checked="true"] { border-color: var(--gold); background: rgba(40,30,18,.85); box-shadow: 0 0 0 1px var(--gold), 0 10px 40px -10px rgba(216,168,91,.5); }
.dragon .swatch { display: block; height: 54px; margin: 0 auto 12px; width: 100%; border-radius: 3px; background: var(--grad); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.dragon .name { display: block; font: 600 1.5rem/1.1 var(--display); }
.dragon .trait { display: block; margin: .2rem 0 .7rem; font: 400 .7rem/1.3 var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.stats { display: grid; gap: 5px; text-align: left; }
.stat { display: grid; grid-template-columns: 4.6em 1fr; align-items: center; gap: 8px; font-size: .78rem; color: var(--parch-dim); }
.stat b { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--v), rgba(255,255,255,.1) var(--v)); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .8em 2.4em; border: 1px solid transparent; border-radius: 2px; cursor: pointer; font: 400 .9rem/1 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1b130a; box-shadow: 0 10px 30px -10px rgba(216,168,91,.7); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: rgba(255,255,255,.03); border-color: var(--line); color: var(--parch); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn:focus-visible, .dragon:focus-visible, .pause-btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.controls { margin: 1.4rem 0 0; font-size: .85rem; color: var(--parch-dim); }
kbd { display: inline-block; min-width: 1.7em; margin: 0 1px; padding: .05em .4em; border: 1px solid var(--line); border-radius: 3px; font: .78rem/1.5 ui-monospace, Menlo, monospace; color: var(--parch); }
.ctl-touch { display: none; }
@media (pointer: coarse) { .ctl-keys { display: none; } .ctl-touch { display: inline; } }

/* flight display */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; font-family: var(--label); text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.hud-label { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.hud strong { display: block; font: 600 2rem/1 var(--display); color: var(--parch); }
.hud-score { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; }
.hud-time { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); text-align: center; }
.hud-best { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 64px; text-align: right; }
.combo { display: block; margin-top: 4px; font-size: .8rem; letter-spacing: .14em; color: var(--gold-hi); min-height: 1em; }
.boost { position: absolute; left: 16px; bottom: max(18px, env(safe-area-inset-bottom)); width: min(220px, 40vw); }
.boost-bar { height: 7px; margin-top: 6px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.boost-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f59e0b, var(--gold-hi)); transform-origin: left; }
.marker { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%); will-change: transform; }
.marker-dot { width: 18px; height: 18px; border: 2px solid var(--gold-hi); transform: rotate(45deg); box-shadow: 0 0 12px rgba(242,205,134,.7); }
.marker.edge .marker-dot { width: 0; height: 0; border: 10px solid transparent; border-bottom: 16px solid var(--gold-hi); border-top: 0; transform: rotate(var(--a, 0deg)); box-shadow: none; filter: drop-shadow(0 0 6px rgba(242,205,134,.8)); }
.marker-dist { font-size: .72rem; letter-spacing: .1em; color: var(--parch); }
.toast { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); margin: 0; font: 600 clamp(1.6rem, 5vw, 2.6rem)/1 var(--display); color: var(--gold-hi); opacity: 0; transition: opacity .3s, transform .3s; text-align: center; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, -60%); }
.region { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); margin: 0; font-size: .82rem; letter-spacing: .3em; text-transform: uppercase; color: var(--parch); opacity: 0; transition: opacity 1.2s; white-space: nowrap; }
.region.show { opacity: .9; }
.pause-btn { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(11,9,8,.5); cursor: pointer; pointer-events: auto; font: 700 .8rem/1 var(--body); letter-spacing: .05em; }
.boost-btn { display: none; position: absolute; right: 18px; bottom: max(22px, env(safe-area-inset-bottom)); width: 96px; height: 96px; border-radius: 50%; border: 1px solid rgba(242,205,134,.6); background: rgba(216,168,91,.22); pointer-events: auto; font: 400 .8rem/1 var(--label); letter-spacing: .18em; text-transform: uppercase; touch-action: none; }
.boost-btn.on { background: rgba(216,168,91,.55); }
@media (pointer: coarse) { .boost-btn { display: block; } .boost { bottom: auto; top: 84px; } }
.stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 1px solid rgba(239,230,212,.35); background: rgba(11,9,8,.18); opacity: 0; transition: opacity .15s; }
.stick.on { opacity: 1; }
.stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(242,205,134,.55); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

@media (max-width: 640px) {
  .dragons { grid-template-columns: 1fr; gap: 10px; }
  .dragon { display: grid; grid-template-columns: 64px 1fr; gap: 0 14px; text-align: left; padding: 12px; }
  .dragon .swatch { grid-row: span 3; height: 100%; margin: 0; }
  .dragon .trait { margin-bottom: .4rem; }
  .hud strong { font-size: 1.6rem; }
  .hud-best { display: none; }
}
