@font-face {
  font-family: 'VT323';
  src: url('../assets/vt323.woff2') format('woff2');
  font-display: swap;
}
:root {
  --black: #050003;
  --red: #c1121f;
  --red-dim: #5c0a10;
  --bone: #f2ede4;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--black); overflow: hidden; }
body {
  font-family: 'VT323', 'Courier New', monospace;
  color: var(--bone);
  font-size: 19px;
  line-height: 1.35;
}
a { color: var(--red); }
a:hover { color: var(--bone); background: var(--red-dim); }
.hidden { display: none !important; }
.dim { color: #8a7f78; }
.tiny { font-size: 14px; }
h3 { color: var(--red); margin: 1.1em 0 .3em; font-weight: normal; letter-spacing: .06em; }
b { color: var(--bone); }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* terminal screens */
.term {
  position: fixed; inset: 0; z-index: 30;
  background: var(--black);
  padding: 4vh 5vw; overflow-y: auto;
  text-shadow: 0 0 6px rgba(193, 18, 31, .35);
}
.term::after { /* scanlines */
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.22) 2px 4px);
}
.term p { margin: .5em 0; max-width: 72ch; }
.ascii { color: var(--red); font-size: 13px; line-height: 1.1; margin-bottom: .5em; }
#bootlog { white-space: pre-wrap; color: var(--bone); }
#bootlog .ok { color: var(--red); }

.btn {
  font-family: inherit; font-size: 19px;
  background: transparent; color: var(--red);
  border: 1px solid var(--red); padding: .35em 1em;
  cursor: pointer; margin: .4em .6em .4em 0;
  text-decoration: none; display: inline-block;
  text-shadow: 0 0 6px rgba(193, 18, 31, .5);
}
.btn:hover { background: var(--red); color: var(--black); }
.btn.dim { color: #8a7f78; border-color: #4a4340; }
.btn.mini { font-size: 15px; padding: .1em .6em; }
#enter-row { margin-top: 1.4em; }

/* consent */
#consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #0d0306; border-top: 1px solid var(--red-dim);
  padding: 12px 5vw; font-size: 16px;
}
#consent p { margin-bottom: .5em; max-width: 100ch; }

/* HUD — retro game status bar */
#hud { position: fixed; left: 0; right: 0; top: 0; z-index: 20; pointer-events: none; }
#hud .btn { pointer-events: auto; }
#hud-bar {
  display: flex; align-items: center; gap: 1.1em;
  padding: 7px 14px; font-size: 16px;
  background: linear-gradient(#120307, #0a0205);
  border-bottom: 2px solid var(--red);
  box-shadow: 0 2px 0 #000, 0 4px 14px rgba(0,0,0,.7);
  color: var(--bone); letter-spacing: .04em;
  white-space: nowrap; overflow: hidden;
}
#counter { color: var(--red); background: #000; border: 1px solid var(--red-dim); padding: 1px 8px; }
#legend { color: #cfc4bb; overflow: hidden; text-overflow: ellipsis; }
#gesture-glyph { font-size: 20px; min-width: 1.3em; }
.hud-right { margin-left: auto; display: flex; gap: .5em; }
#hint-row { text-align: center; padding-top: 10px; }
#hint {
  display: inline-block; color: var(--bone);
  background: rgba(5,0,3,.75); border: 1px solid var(--red-dim);
  padding: 2px 14px; font-size: 17px;
  text-shadow: 0 0 8px rgba(193,18,31,.5);
}
#hint:empty { display: none; }

/* on-screen button pad (touch option) */
#pad {
  position: fixed; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 18px; pointer-events: none;
}
.pad-cluster { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pad-row { display: flex; gap: 6px; }
.pad-b {
  pointer-events: auto; margin: 0;
  min-width: 58px; min-height: 52px; font-size: 22px;
  background: rgba(5,0,3,.72); touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.pad-b:active { background: var(--red); color: var(--black); }
.pad-right-side .pad-b { font-size: 17px; }

/* question bubble — bioluminescent cloud */
#bubble {
  position: fixed; inset: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(5,0,3,.25), rgba(5,0,3,.8));
}
#bubble-cloud {
  max-width: min(620px, 86vw); padding: 42px 46px; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(242,237,228,.16), rgba(193,18,31,.10) 55%, transparent 75%);
  border-radius: 48% 52% 55% 45% / 55% 48% 52% 45%;
  box-shadow:
    0 0 60px 24px rgba(242,237,228,.10),
    0 0 140px 60px rgba(193,18,31,.14),
    inset 0 0 60px rgba(242,237,228,.10);
  backdrop-filter: blur(3px);
  animation: cloudbreathe 5s ease-in-out infinite;
}
#bubble-text { font-size: clamp(21px, 3.2vw, 28px); color: var(--bone);
  text-shadow: 0 0 14px rgba(242,237,228,.55); }
#bubble-close { margin-top: 14px; }
#bubble-cloud.sinking {
  transition: transform .65s cubic-bezier(.5, 0, .9, .4), opacity .6s ease-in;
  transform: translateY(70vh) scale(.75) !important;
  opacity: 0;
}
@keyframes cloudbreathe {
  0%, 100% { transform: scale(1); border-radius: 48% 52% 55% 45% / 55% 48% 52% 45%; }
  50% { transform: scale(1.03); border-radius: 52% 48% 45% 55% / 48% 55% 45% 52%; }
}

#exit-screen { display: flex; align-items: center; z-index: 40; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .term { padding: 3vh 6vw; }
  .ascii { font-size: 8px; }
  #legend { display: none; } /* the hint chip guides instead */
}
