/* ==========================================================================
   Game Night — modern layer. Same language as the homepage: tight grotesk
   with serif italics, smoked glass, hairlines, pill controls; one warm
   accent (lantern) and the coral of the tiles. Overrides the inline sheet.
   ========================================================================== */

:root {
  --m-fg: #f4efe6;
  --m-fg-2: rgba(244, 239, 230, 0.72);
  --m-fg-3: rgba(244, 239, 230, 0.46);
  --m-line: rgba(255, 255, 255, 0.12);
  --m-line-2: rgba(255, 255, 255, 0.22);
  --m-glass: rgba(10, 14, 17, 0.62);
  --m-sans: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --m-serif: 'Instrument Serif', Georgia, serif;
  --m-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --m-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: var(--m-sans);
  --cream: var(--m-fg);
  --cream-dim: var(--m-fg-2);
  --cream-faint: var(--m-fg-3);
}

body {
  font-family: var(--m-sans);
  background:
    radial-gradient(60% 55% at 50% 52%, rgba(227, 184, 123, 0.18), transparent 70%),
    radial-gradient(ellipse at 48% 48%, #1d3238 0%, #0f1d22 58%, #070d10 100%);
}

/* giant 雀 watermark behind the room */
#stage::before {
  content: '雀';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: min(92vh, 72vw);
  font-weight: 900;
  line-height: 1;
  color: rgba(227, 184, 123, 0.045);
  transform: translate(-50%, -52%);
  pointer-events: none;
}

#stage::after {
  background:
    linear-gradient(90deg, rgba(5, 10, 12, 0.66), transparent 30%, transparent 72%, rgba(5, 10, 12, 0.6)),
    linear-gradient(0deg, rgba(5, 10, 12, 0.55), transparent 28%),
    linear-gradient(180deg, rgba(5, 10, 12, 0.4), transparent 18%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- shared glass + pills ---------- */

.glass {
  border: 0;
  border-radius: 999px;
  background: var(--m-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--m-line), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

.home-link {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px 0 5px;
  color: var(--m-fg);
  font: 500 14px var(--m-sans);
  transition: box-shadow 0.4s var(--m-ease);
}

.home-link__ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--m-fg);
  color: #0b0f12;
  font-size: 14px;
  transition: transform 0.5s var(--m-ease);
}

.home-link:hover {
  color: var(--m-fg);
  box-shadow: inset 0 0 0 1px var(--m-fg), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

.home-link:hover .home-link__ico {
  transform: translateX(-3px);
}

/* ---------- masthead ---------- */

.hud {
  top: 26px;
  left: 30px;
  max-width: 420px;
}

.hud__kicker {
  gap: 9px;
  font-family: var(--m-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--m-fg-2);
}

.hud__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e86a4f;
  box-shadow: 0 0 12px #e86a4f;
}

.hud__title {
  margin-top: 14px;
  font-size: clamp(54px, 6vw, 92px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.hud__title em {
  font-family: var(--m-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffd9a8, #f3a07f, #e86a4f, #ffd9a8);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lantern 8s linear infinite;
  padding-right: 0.05em;
}

@keyframes lantern {
  to { background-position: 300% 0; }
}

.hud__sub {
  margin-top: 16px;
  max-width: 300px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--m-fg-2);
}

.meter {
  gap: 3px;
  margin-top: 24px;
}

.meter .mark {
  width: 14px;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.meter .mark.is-got {
  transform: none;
  background: linear-gradient(90deg, #ffd9a8, #e86a4f);
  box-shadow: 0 0 10px rgba(232, 106, 79, 0.6);
}

.meter__count {
  margin-top: 10px;
  font-family: var(--m-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--m-fg-3);
}

.meter__count em {
  color: var(--m-fg);
  font-weight: 500;
}

/* ---------- hint ---------- */

.hint {
  border-radius: 999px;
  font-family: var(--m-sans);
  font-size: 13px;
}

/* ---------- tooltip ---------- */

.tooltip {
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 14, 17, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--m-line), 0 16px 30px -12px rgba(0, 0, 0, 0.6);
}

.tooltip .tile {
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: var(--m-fg);
  box-shadow: none;
  font-size: 13px;
}

.tooltip .tile > span {
  transform: none;
}

.tooltip .lbl {
  font-family: var(--m-sans);
  font-size: 14px;
}

.tooltip .lbl em {
  font-family: var(--m-mono);
  font-weight: 400;
  color: var(--m-fg-3);
}

/* ---------- story index: an editorial contents list ---------- */

.index {
  right: 30px;
  width: 240px;
}

.index__head {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--m-line-2);
}

.index__title {
  font-family: var(--m-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--m-fg-2);
}

.index__meta,
.index__cap {
  font-family: var(--m-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--m-fg-3);
}

.index__cap {
  padding: 16px 0 6px;
}

.index__item {
  grid-template-columns: 22px 1fr 8px;
  height: 34px;
  padding: 0;
  border-bottom: 1px solid var(--m-line);
  transition: padding 0.45s var(--m-ease), background 0.3s ease;
}

.index__item .num {
  font-family: var(--m-mono);
  font-size: 10.5px;
  font-weight: 400;
}

.index__item .lbl {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.index__item .mark {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.index__item.is-visited .mark {
  background: #e86a4f;
  box-shadow: 0 0 8px rgba(232, 106, 79, 0.8);
}

.index__item:hover {
  background: none;
  padding-left: 8px;
}

.index__item:hover .num {
  color: #ffd9a8;
}

.index__item.is-active {
  background: none;
  box-shadow: none;
  padding-left: 8px;
}

.index__item.is-active .lbl {
  font-weight: 500;
}

.index__item.is-active .lbl::after {
  content: ' ←';
  font-family: var(--m-serif);
  color: #ffd9a8;
}

/* ---------- story panel: smoked glass, editorial ---------- */

.panel {
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(460px, calc(100% - 36px));
  border: 0;
  border-radius: 26px;
  color: var(--m-fg);
  background: rgba(10, 14, 17, 0.74);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--m-line), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}

.panel::before {
  content: '';
  position: absolute;
  z-index: -1;
  right: -30%;
  top: -25%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 106, 79, 0.45), transparent 62%);
  filter: blur(24px);
  pointer-events: none;
}

.panel__spine {
  display: none;
}

.panel__head {
  padding: 18px 16px 16px 26px;
  border-bottom: 1px solid var(--m-line);
}

.panel__head .tile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--m-fg);
  box-shadow: none;
  font-size: 17px;
}

.panel__head .tile > span {
  transform: none;
}

.panel__num {
  font-family: var(--m-mono);
  font-weight: 400;
  color: #ffd9a8;
}

.panel__eyebrow {
  font-family: var(--m-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--m-fg-3);
}

.panel__eyebrow::before {
  background: var(--m-line-2);
}

.panel__close {
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--m-fg);
  box-shadow: inset 0 0 0 1px var(--m-line-2);
  transition: background 0.3s ease, color 0.3s ease, transform 0.5s var(--m-ease);
}

.panel__close:hover {
  border: 0;
  background: var(--m-fg);
  color: #0b0f12;
  transform: rotate(90deg);
}

.panel__scroll {
  padding: 28px 28px 30px 26px;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.panel__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

.panel__title {
  margin-bottom: 18px;
  font-size: clamp(34px, 3vw, 44px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--m-fg);
}

.panel__title em {
  font-family: var(--m-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: #ffb08f;
}

.panel__body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--m-fg-2);
}

.panel__body strong {
  color: var(--m-fg);
  font-weight: 500;
}

.panel__body em {
  color: var(--m-fg-3);
}

.panel__body a {
  color: #ffd9a8;
}

.panel__body img {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--m-line), 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--m-fg);
  color: #0b0f12;
  font: 500 14px var(--m-sans);
  text-decoration: none;
  transition: background 0.4s var(--m-ease);
}

.panel__cta:hover {
  background: #ffd9a8;
  color: #0b0f12;
}

.panel__foot {
  padding: 14px 16px 14px 26px;
  border-top: 1px solid var(--m-line);
  background: none;
}

.panel__where {
  font-family: var(--m-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--m-fg-3);
}

.panel__nav button {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--m-fg);
  box-shadow: inset 0 0 0 1px var(--m-line-2);
  font: 500 14px var(--m-sans);
  transition: background 0.3s ease, color 0.3s ease;
}

.panel__nav button:hover {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: var(--m-fg);
}

.panel__nav #panelNext {
  padding: 0 16px;
  background: var(--m-fg);
  color: #0b0f12;
  box-shadow: none;
}

.panel__nav #panelNext:hover {
  background: #ffd9a8;
  color: #0b0f12;
}

/* ---------- tour + small controls ---------- */

.tour {
  border-radius: 999px;
  padding: 5px;
}

.tour button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--m-fg);
  transition: background 0.3s ease, color 0.3s ease;
}

.tour #tourNext {
  background: var(--m-fg);
  color: #0b0f12;
}

.tour button:hover {
  background: #ffd9a8;
  color: #0b0f12;
}

.tour__lbl {
  font-family: var(--m-mono);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--m-fg-3);
}

.tour__now {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.tour__now b {
  color: #ffd9a8;
  font-weight: 500;
}

.legend {
  font-family: var(--m-mono);
  font-size: 11px;
  color: var(--m-fg-3);
}

.reset,
.index-toggle {
  border-radius: 999px;
  color: var(--m-fg);
  font: 500 14px var(--m-sans);
}

/* ---------- loader: ink sheet, the line rises, the sheet lifts ---------- */

.loading {
  z-index: 20;
}

.loading__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(45% 50% at 25% 30%, rgba(232, 106, 79, 0.2), transparent 70%),
    radial-gradient(45% 55% at 78% 72%, rgba(227, 184, 123, 0.14), transparent 70%),
    #0a0e11;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s cubic-bezier(0.76, 0, 0.24, 1) 0.2s;
}

.loading.is-leaving .loading__veil {
  clip-path: inset(0 0 100% 0);
}

.loading__inner {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 26px 30px 30px;
  color: var(--m-fg);
  transition: transform 1s cubic-bezier(0.76, 0, 0.24, 1) 0.2s, opacity 0.4s ease 0.2s;
}

.loading.is-leaving .loading__inner {
  transform: translateY(-14vh);
  opacity: 0;
}

.loading__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.loading__mark {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.loading__mark sup {
  font-size: 0.5em;
}

.loading__meta {
  font-family: var(--m-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--m-fg-3);
}

.loading__line {
  align-self: center;
  margin: 0;
  font-size: clamp(48px, 7vw, 112px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.loading__line span {
  display: block;
  animation: room-rise 1.2s var(--m-ease) both;
}

.loading__line span:nth-child(2) {
  animation-delay: 0.12s;
}

.loading__line em {
  font-family: var(--m-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #ffb08f;
}

@keyframes room-rise {
  from { transform: translateY(60%); opacity: 0; }
}

.loading__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 16px;
}

.loading__text {
  margin: 0;
  font-family: var(--m-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--m-fg-2);
}

.loading__han {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(110px, 16vw, 220px);
  font-weight: 900;
  line-height: 0.8;
  color: var(--m-fg);
  animation: han-breathe 2.6s ease-in-out infinite;
}

@keyframes han-breathe {
  50% { opacity: 0.55; transform: translateY(-4px); }
}

.loading__bar {
  position: relative;
  height: 1px;
  overflow: hidden;
  background: var(--m-line);
}

.loading__bar i {
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--m-fg);
  animation: room-bar 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes room-bar {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

/* ---------- phones ---------- */

@media (max-width: 900px) {
  .hud__title {
    font-size: clamp(42px, 12vw, 60px);
  }

  .home-link {
    top: 18px;
    right: 16px;
    height: 40px;
  }

  .home-link {
    font-size: 0;
    gap: 0;
    padding: 0 3px;
  }

  .panel {
    border-radius: 22px 22px 0 0;
  }

  body:has(.panel.is-open) .home-link {
    opacity: 0;
    pointer-events: none;
  }

  .index {
    border-radius: 22px 22px 0 0;
    background: rgba(10, 14, 17, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .grain,
  .hud__title em,
  .loading__line span,
  .loading__han,
  .loading__bar i {
    animation: none;
  }
}
