/* Chunky toy UI, after gig-ambulance: cream cards with thick ink borders and
   hard drop shadows on a lavender base, yellow for the one big action. */
:root {
  --ink: #3b2e5a;
  --bg: #b9a3e8;
  --lav: #dccbf7;
  --purple: #6e5ac8;
  --yellow: #ffd45e;
  --orange: #ff9e4a;
  --red: #ee4b5e;
  --panel: #fffdf8;
  --space: #2e2669;
  --font: 'Trebuchet MS', 'Avenir Next', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--space);
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font);
  color: var(--ink);
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--space);
}

#webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

#hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 5;
  pointer-events: none;
}

#input-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  touch-action: none;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: rgba(185, 163, 232, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.screen.hidden {
  display: none;
}

.card {
  width: 100%;
  max-width: 380px;
  padding: 26px 20px 24px;
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 7px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: card-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes card-in {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.title {
  margin: 0 0 10px;
  font-size: clamp(40px, 12vw, 54px);
  white-space: nowrap;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--purple);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}

.title .accent { color: var(--orange); }
.title.over { color: var(--red); }
.title.win { color: var(--yellow); }

.subtitle {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 700;
  color: #5a4a80;
  line-height: 1.5;
  max-width: 320px;
  margin: 4px 0 18px;
}

.howto {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 700;
  color: var(--ink);
}

.key {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: var(--lav);
  box-shadow: 0 2px 0 var(--ink);
  font-weight: 900;
  margin-right: 4px;
}

.btn {
  appearance: none;
  outline: none;
  padding: 14px 34px;
  font-family: inherit;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--ink);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover { background: #ffdc78; }

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.icon-btn {
  position: absolute;
  top: max(12px, calc(env(safe-area-inset-top) + 8px));
  right: 12px;
  z-index: 15;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
  pointer-events: auto;
  appearance: none;
  cursor: pointer;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.icon-btn.hidden {
  display: none;
}
