:root {
  --bg: #eef1f4;
  --ink: #1f2a37;
  --muted: #5b6776;
  --sheet: #ffffff;
  --sky: #3d7fc1;
  --shadow: 0 6px 24px rgba(31, 42, 55, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

#game, #game canvas { position: fixed; inset: 0; touch-action: none; }

#ui { position: fixed; inset: 0; pointer-events: none; }

.chip {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.chip span { color: var(--muted); font-weight: 500; margin-left: 4px; }

.toast {
  position: absolute;
  left: 50%;
  top: max(64px, calc(env(safe-area-inset-top) + 52px));
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(31, 42, 55, 0.82);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  transition: opacity 0.5s;
}
.toast.gone { opacity: 0; }

.action {
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  transform: translateX(-50%);
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.action:active { transform: translateX(-50%) scale(0.97); }

#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 15px;
  transition: opacity 0.4s;
}
#loading.done { opacity: 0; pointer-events: none; }

#modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 28, 38, 0.55);
}
#modal[hidden] { display: none; }

.sheet {
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--sheet);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.eyebrow { margin: 0 0 6px; color: var(--sky); font-size: 13px; font-weight: 700; }
.sheet h2 { margin: 0; font-size: 20px; line-height: 1.35; letter-spacing: -0.02em; word-break: keep-all; }
.meta { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.link { color: var(--muted); font-size: 14px; }
.close {
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
