/* Hiro Hangout: the pixel island fills the screen; everything you press is Hiro's black glass. */
:root {
  --night: #030303;
  --glass: rgba(14, 15, 18, 0.82);
  --glass-solid: rgba(16, 17, 21, 0.97);
  --edge: rgba(255, 255, 255, 0.12);
  --edge-hi: rgba(255, 255, 255, 0.24);
  --text: #f2f3f5;
  --sub: #a3a8b0;
  --dim: #6f747c;
  --bad: #ff6b5e;
  --good: #6fd08a;
  --chrome: linear-gradient(180deg, #ffffff 0%, #f3f4f6 55%, #dfe2e6 100%);
  --display: 'Saira', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
  --bars-b: 0px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: calc(env(safe-area-inset-bottom, 0px) + var(--bars-b));
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); touch-action: manipulation; }
body { margin: 0; color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
input { -webkit-user-select: text; user-select: text; }
.email { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
.i { display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }

.game { position: relative; height: 100vh; height: 100lvh; overflow: hidden; background: #5a6aa0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; image-rendering: pixelated; }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--night); color: var(--sub); font-weight: 600; z-index: 30; }
.fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
.fade.on { opacity: 1; }

/* Joystick (phones): appears where your finger lands. */
.stick { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 12; pointer-events: none; }
.stick::before { content: ''; position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.15); }
.stick i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.4); transform: translate(var(--kx, 0px), var(--ky, 0px)); }

/* HUD */
.hud { position: absolute; z-index: 10; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud.top { top: calc(var(--safe-t) + 12px); left: calc(var(--safe-l) + 12px); right: calc(var(--safe-r) + 12px); flex-wrap: wrap; }
html.ios .hud.top { top: max(44px, calc(var(--safe-t) + 12px)); }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.chip .i { font-size: 15px; }
.chip.home img { width: 18px; height: 18px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #e0a33a; box-shadow: 0 0 0 3px rgba(224,163,58,.18); }
.chip.on .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(111,208,138,.2); }
.chip.btn { margin-left: auto; }
#hud-gems .i { color: #9fe0ff; }

.hud.bottom { right: calc(var(--safe-r) + 14px); bottom: calc(var(--safe-b) + 16px); align-items: flex-end; }
.round { display: grid; place-items: center; gap: 1px; width: 58px; height: 58px; border-radius: 50%; background: var(--glass); border: 1px solid var(--edge-hi); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); font-size: 11px; font-weight: 600; padding: 0; }
.round .i { font-size: 20px; }
.round span { line-height: 1; }
.round.big { width: 76px; height: 76px; background: var(--chrome); color: #111; font: italic 900 17px/1 var(--display); text-transform: uppercase; border: 0; }
.round:active { transform: scale(.94); }
.round:disabled { opacity: .45; }
@media (hover: hover) and (pointer: fine) { .round.big { display: none; } }

/* Chat log: bottom left, fades when quiet. */
.log { position: absolute; z-index: 9; left: calc(var(--safe-l) + 12px); bottom: calc(var(--safe-b) + 16px); width: min(340px, calc(100vw - 210px)); max-height: 30vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; opacity: .55; transition: opacity .4s; pointer-events: none; font-size: 13px; }
.log.fresh { opacity: 1; }
.log p { margin: 0; padding: 3px 9px; border-radius: 9px; background: rgba(10,10,14,.6); width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.log p b { font-weight: 700; color: #bfe3ff; }
.log p.mine b { color: #ffe08a; }
@media (max-width: 560px) {
  .log { width: calc(100vw - 24px); max-height: 18vh; font-size: 12px; bottom: calc(var(--safe-b) + 104px); }
  .chip { height: 32px; padding: 0 10px; font-size: 12px; }
  .chip.home span { display: none; }
  .chip.btn span { display: none; }
  .hud.top { flex-wrap: nowrap; gap: 6px; }
}

.chatbar { position: absolute; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 18px); width: min(560px, calc(100vw - 24px)); display: flex; gap: 8px; padding: 8px; border-radius: 16px; background: var(--glass-solid); border: 1px solid var(--edge-hi); box-shadow: var(--shadow); }
.chatbar input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--edge); background: rgba(255,255,255,.06); color: var(--text); font: 500 16px var(--body); outline: none; }
.chatbar input:focus { border-color: var(--edge-hi); }
.chatbar button { height: 42px; padding: 0 18px; border-radius: 11px; border: 0; background: var(--chrome); color: #111; font-weight: 700; }

/* Cards */
.card { position: absolute; z-index: 14; background: var(--glass-solid); border: 1px solid var(--edge-hi); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.card.sheet { right: calc(var(--safe-r) + 14px); bottom: calc(var(--safe-b) + 104px); width: min(330px, calc(100vw - 28px)); }
@media (hover: hover) and (pointer: fine) { .card.sheet { bottom: calc(var(--safe-b) + 86px); } }
.card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 28px)); max-height: calc(100% - 40px); overflow: auto; }
.card h3 { margin: 0 0 10px; font: italic 900 22px/1.1 var(--display); text-transform: uppercase; padding-right: 30px; }
.card ul { margin: 0 0 14px; padding-left: 18px; color: #d6d9de; font-size: 14px; }
.card li { margin: 6px 0; }
.card .x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--edge); background: transparent; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick button, .card .wide, .actions button, .report button { min-height: 40px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--edge); background: rgba(255,255,255,.06); font-weight: 600; font-size: 14px; }
.quick button:hover, .card .wide:hover, .actions button:hover { background: rgba(255,255,255,.12); }
.card .wide { width: 100%; margin-top: 8px; }
.fine { margin: 10px 0 0; color: var(--sub); font-size: 12px; }
.emote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.emote-grid button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255,255,255,.05) var(--img) 0 0 / auto 100% no-repeat; image-rendering: pixelated; }
.emote-grid button:hover { background-color: rgba(255,255,255,.12); }
.actions { display: grid; gap: 8px; }
.danger { color: #ffb3ab !important; border-color: rgba(255,107,94,.4) !important; }
.report p { margin: 0 0 8px; font-weight: 600; }
.report label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; font-size: 14px; color: #d6d9de; cursor: pointer; }
.report input { margin-top: 3px; accent-color: #fff; }
.report button { width: 100%; margin-top: 8px; }

/* Menu: pick a colour */
.menu { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 22px; }
.menu h1 { margin: 0; font: italic 900 34px/1 var(--display); text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; padding-left: .1em; margin-left: -.1em; }
.menu h1 b { font-weight: 900; }
.menu .sub { margin: 6px 0 14px; color: var(--sub); }
.pick { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pick canvas { width: 72px; height: 72px; image-rendering: pixelated; border-radius: 16px; background: radial-gradient(circle at 50% 60%, rgba(255,255,255,.14), rgba(255,255,255,.03)); border: 1px solid var(--edge); }
.pick b { display: block; font-size: 18px; }
.pick small { color: var(--sub); }
.colors { display: grid; grid-template-columns: repeat(9, 1fr); gap: 7px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; background: radial-gradient(circle at 35% 30%, var(--c) 55%, var(--d)); padding: 0; position: relative; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.swatch.locked { filter: grayscale(.85) brightness(.45); }
.swatch.locked::after { content: ''; position: absolute; inset: 28%; background: #fff; -webkit-mask: url(/icons/lock.png) center / contain no-repeat; mask: url(/icons/lock.png) center / contain no-repeat; }
.opts { display: flex; gap: 18px; margin: 14px 0; font-size: 14px; }
.opts label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.opts input { accent-color: #fff; width: 17px; height: 17px; }
.play { width: 100%; height: 50px; border: 0; border-radius: 14px; background: var(--chrome); color: #111; font: italic 900 20px/1 var(--display); text-transform: uppercase; }
.link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--sub); text-decoration: underline; font-size: 13px; }

.toast { position: absolute; z-index: 25; left: 50%; top: calc(var(--safe-t) + 64px); transform: translate(-50%, -12px); max-width: min(480px, calc(100vw - 24px)); padding: 10px 16px; border-radius: 14px; background: var(--glass-solid); border: 1px solid var(--edge-hi); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: rgba(255,107,94,.5); }

/* Below the game */
.guide { max-width: 760px; margin: 0 auto; padding: 48px 20px 24px; color: #d6d9de; }
.guide h1 { font: italic 900 34px/1.05 var(--display); text-transform: uppercase; color: var(--text); }
.guide h2 { margin-top: 32px; font-size: 21px; color: var(--text); }
.guide li { margin: 6px 0; }
.guide .more { display: flex; gap: 10px; flex-wrap: wrap; }
.guide .more a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--edge); text-decoration: none; color: var(--text); }
.foot { max-width: 760px; margin: 0 auto; padding: 24px 20px 40px; color: var(--dim); font-size: 13px; }
.foot a { color: var(--sub); }
#ad-under-game { max-width: 970px; margin: 24px auto 0; padding: 0 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
