/* DAWG DAZE UI — one font (Chakra Petch), one text colour (white; hierarchy by opacity), one panel style. */
:root {
  --purple: #4b2e83; --purple2: #6a49b8; --gold: #b7a57a; --ink: #0b0617;
  --panel: linear-gradient(180deg, rgba(58, 34, 112, .92), rgba(22, 12, 46, .94));
  --edge: rgba(255, 255, 255, .28);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
button { font: inherit; color: #fff; cursor: pointer; }
.panel {
  position: fixed; z-index: 20; background: var(--panel); border: 2px solid var(--edge); border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 10px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff; backdrop-filter: blur(4px);
}
.panel h2 { margin: 0 0 2px; font-style: italic; font-weight: 700; font-size: 26px; letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.panel .kick { opacity: .6; text-transform: uppercase; letter-spacing: .2em; font-size: 11px; }
.panel p { line-height: 1.45; opacity: .9; font-size: 15px; margin: 10px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; margin: 4px 6px 4px 0; border-radius: 9px; border: 1.5px solid var(--edge);
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04)); font-weight: 700; font-style: italic; font-size: 15px; }
.btn:hover, .btn:focus-visible { background: linear-gradient(180deg, rgba(183,165,122,.55), rgba(183,165,122,.2)); outline: none; }
.btn .k { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.35); font-style: normal; font-size: 12px; opacity: .85; text-align: center; }
.close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--edge); background: rgba(0,0,0,.35); font-size: 16px; z-index: 3; }

/* Title */
#title { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; padding: 0 max(28px, 7vw);
  background: linear-gradient(90deg, rgba(11,6,23,.78) 0%, rgba(11,6,23,.35) 45%, rgba(11,6,23,0) 70%); }
.t-logo { font-style: italic; font-weight: 700; font-size: clamp(54px, 10vw, 128px); line-height: .9; transform: skew(-6deg);
  background: linear-gradient(180deg, #fff 0%, #e8e0ff 45%, #b7a57a 50%, #fff3cf 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #2a1650) drop-shadow(0 0 22px rgba(150,110,255,.6)); }
.t-sub { opacity: .75; letter-spacing: .35em; text-transform: uppercase; font-size: clamp(11px, 2vw, 15px); margin: 10px 0 34px 6px; }
.t-menu { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.t-btn { min-width: 250px; text-align: left; padding: 12px 22px; font-size: 22px; font-weight: 700; font-style: italic; border-radius: 10px; border: 2px solid var(--edge);
  background: linear-gradient(90deg, rgba(75,46,131,.85), rgba(75,46,131,.15)); transform: skew(-8deg); transition: transform .12s, background .12s; }
.t-btn:hover, .t-btn:focus-visible { transform: skew(-8deg) translateX(10px); background: linear-gradient(90deg, rgba(183,165,122,.9), rgba(183,165,122,.15)); outline: none; }
.t-btn.primary { font-size: 28px; }
.t-flyover { position: absolute; right: max(24px, 5vw); bottom: 70px; text-align: right; font-style: italic; font-weight: 700; font-size: 20px; opacity: .85; text-shadow: 0 2px 8px #000; }
.t-foot { position: absolute; left: 0; right: 0; bottom: calc(12px + var(--safe-b)); text-align: center; font-size: 11px; opacity: .55; padding: 0 16px; }
.t-foot a { color: #fff; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
#banner { position: absolute; top: 18%; left: 0; right: 0; text-align: center; opacity: 0; transition: opacity .6s; }
#banner.on { opacity: 1; }
#banner .b-kicker { letter-spacing: .4em; text-transform: uppercase; font-size: 13px; opacity: .75; }
#banner .b-name { font-style: italic; font-weight: 700; font-size: clamp(30px, 6vw, 64px); transform: skew(-6deg);
  background: linear-gradient(180deg, #fff 30%, #b7a57a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(42,22,80,.9)); }
#place { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); font-weight: 700; font-style: italic; font-size: 17px; }
#place small { display: block; font-style: normal; font-weight: 500; opacity: .65; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#clock { position: absolute; right: calc(18px + var(--safe-r)); top: calc(232px + var(--safe-t)); font-weight: 700; font-style: italic; font-size: 16px; width: 200px; text-align: center; }
#minimap-wrap { position: absolute; right: calc(18px + var(--safe-r)); top: calc(18px + var(--safe-t)); width: 200px; height: 200px; border-radius: 50%; overflow: hidden;
  border: 3px solid rgba(255,255,255,.75); box-shadow: 0 0 0 3px rgba(75,46,131,.8), 0 6px 20px rgba(0,0,0,.5); background: #223; }
#minimap { width: 100%; height: 100%; display: block; }
.mm-n { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 12px; }
#stamps { position: absolute; right: calc(18px + var(--safe-r)); top: calc(256px + var(--safe-t)); width: 200px; text-align: center; font-size: 12px; opacity: .8; }
#prompt { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); padding: 8px 16px; border-radius: 10px; background: rgba(11,6,23,.6); border: 1.5px solid var(--edge);
  font-weight: 700; font-style: italic; font-size: 17px; white-space: nowrap; opacity: 0; transition: opacity .2s; }
#prompt.on { opacity: 1; }
#prompt .k { display: inline-block; padding: 1px 8px; margin-right: 6px; border-radius: 6px; background: var(--gold); color: var(--ink); font-style: normal; }
#toast { position: absolute; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); padding: 9px 18px; border-radius: 10px; background: var(--panel); border: 1.5px solid var(--edge);
  font-weight: 700; font-style: italic; opacity: 0; transition: opacity .3s; max-width: 80vw; text-align: center; }
#toast.on { opacity: 1; }
#waypoint { position: absolute; left: 50%; top: calc(20px + var(--safe-t)); transform: translateX(-50%); text-align: center; display: none; margin-top: 44px; }
#waypoint.on { display: block; }
.wp-arrow { font-size: 26px; color: var(--gold); display: inline-block; }
.wp-d { font-size: 12px; font-weight: 700; }
#osm { position: absolute; right: calc(8px + var(--safe-r)); bottom: calc(6px + var(--safe-b)); font-size: 10px; opacity: .55; }
#hints { position: absolute; left: 50%; bottom: calc(6px + var(--safe-b)); transform: translateX(-50%); font-size: 11px; opacity: .5; white-space: nowrap; }

/* Info card */
#infocard { left: calc(18px + var(--safe-l)); top: 50%; transform: translateY(-50%); width: min(400px, calc(100vw - 36px)); max-height: 76vh; overflow: auto; padding: 18px 20px; }
#infocard .facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin: 10px 0; }
#infocard .facts b { opacity: .6; font-weight: 500; }
#infocard .inside { font-size: 13px; opacity: .85; }
#infocard .inside span { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.1); }

/* Dialog */
#dialog { left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); padding: 16px 18px; }
#dialog .who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#dialog .who h2 { font-size: 22px; }
#dialog .line { font-size: 17px; line-height: 1.45; margin: 8px 0 10px; min-height: 2.9em; }
#dialog .mind { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 10px; font-size: 11px; }
#dialog .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 2px; }
#dialog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple2), var(--gold)); }
#dialog .why { font-size: 12px; opacity: .75; margin: -4px 0 8px; }
#dialog .why div { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
#dialog .opts { display: flex; flex-wrap: wrap; }

/* Map */
#mapview { position: fixed; inset: 0; z-index: 25; background: rgba(11,6,23,.92); }
#bigmap { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map-side { left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); bottom: calc(14px + var(--safe-b)); width: min(300px, 44vw); padding: 14px; overflow: auto; }
#map-side input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--edge); background: rgba(0,0,0,.35); color: #fff; font: inherit; margin: 8px 0; }
#map-side .row { display: block; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; }
#map-side .row:hover { background: rgba(255,255,255,.1); }
#map-side .row small { opacity: .55; margin-left: 6px; }
#map-side .tabs { display: flex; flex-wrap: wrap; gap: 4px; }
#map-side .tabs button { padding: 4px 10px; border-radius: 7px; border: 1.5px solid var(--edge); background: rgba(255,255,255,.05); font-size: 13px; }
#map-side .tabs button.on { background: var(--gold); color: var(--ink); }

/* Passport, settings, custom, pause */
#passport, #settings, #custom, #pause { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: 86vh; overflow: auto; padding: 20px 22px; }
#passport .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
#passport .st { padding: 10px; border-radius: 10px; border: 1.5px dashed rgba(255,255,255,.3); background: rgba(0,0,0,.22); color: rgba(255,255,255,.62); font-size: 13px; font-weight: 700; font-style: italic; }
#passport .st:hover { color: #fff; border-color: rgba(255,255,255,.6); }
#passport .st.got { color: #fff; border-style: solid; border-color: var(--gold); background: rgba(183,165,122,.22); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 15px; }
.seg { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--edge); flex-wrap: wrap; }
.seg button { padding: 5px 11px; background: transparent; border: 0; font-size: 13px; font-weight: 700; }
.seg button.on { background: var(--gold); color: var(--ink); }
.set-row input[type=range] { width: 160px; accent-color: #b7a57a; }
#custom { left: auto; right: calc(20px + var(--safe-r)); transform: translateY(-50%); width: min(360px, calc(100vw - 24px)); }
#pause .btn { display: flex; width: 100%; justify-content: flex-start; font-size: 18px; padding: 11px 16px; }

/* Touch */
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
#stick { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.15); left: 30px; bottom: 40px; opacity: .45; }
#stick.on { opacity: .9; }
#nub { position: absolute; left: 45px; top: 45px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.55); }
#tbtns { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); display: grid; grid-template-columns: repeat(3, 58px); gap: 10px; pointer-events: auto; }
#tbtns button { width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(75,46,131,.55); font-size: 20px; font-weight: 700; touch-action: none; }
#tbtns button.on { background: rgba(183,165,122,.8); }
@media (max-width: 720px), (pointer: coarse) {
  #minimap-wrap { width: 128px; height: 128px; }
  #clock, #stamps { width: 128px; top: calc(150px + var(--safe-t)); font-size: 13px; }
  #stamps { top: calc(170px + var(--safe-t)); }
  #hints { display: none; }
  #place { bottom: auto; top: calc(14px + var(--safe-t)); font-size: 15px; }
  #infocard { top: auto; bottom: calc(240px + var(--safe-b)); transform: none; max-height: 45vh; }
  #dialog { bottom: calc(10px + var(--safe-b)); }
  #dialog .mind { grid-template-columns: repeat(3, 1fr); }
  .t-btn { min-width: 200px; font-size: 19px; }
  #map-side { width: auto; right: 14px; top: auto; height: 38vh; }
  #toast { top: auto; bottom: calc(46% + var(--safe-b)); font-size: 14px; }
  #banner { top: 36%; }
  #stamps { font-size: 11px; text-align: right; }
  #tbtns button[data-k="whistle"] { font-size: 24px; }
  #banner .b-name { font-size: clamp(26px, 8vw, 44px); }
  #prompt { bottom: calc(146px + var(--safe-b)); font-size: 15px; } /* just above the action buttons, clear of the player */
  #tbtns { grid-template-columns: repeat(4, 52px); gap: 8px; }
  #tbtns button { width: 52px; height: 52px; font-size: 18px; }
  #place { max-width: calc(100vw - 170px); }
  #waypoint { margin-top: 120px; }
}
