/* trio.css — "세 신수" (three-spirit puzzle game) only. Landscape-first,
 * same night/gold identity as the rest of the product. */

:root {
  --t-bg: #05070f;
  --t-ink: #e8e2d4;
  --t-ink-dim: #9a94a8;
  --t-gold: #f3c15f;
  --t-panel: rgba(8, 10, 22, 0.88);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: 'Noto Serif KR', 'Apple SD Gothic Neo', serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#trio-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/* ---- title screen: a poster over a live night ----------------
 * The engine paints the scene (ridges, fog, moon, the three spirits,
 * the moon-gate) behind this layer. Everything here is a lockup on a
 * scrim, weighted to the lower-left so the art keeps the right side.
 */
:root {
  --t-ui: -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;
  --sp-1: 6px;
  --sp-2: 16px;
  --sp-3: clamp(22px, 6vh, 40px);
}

.trio-boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 44%) 1fr;
  align-items: end;
  text-align: left;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(243, 193, 95, 0.09), transparent 55%),
    var(--t-bg);
  padding: 0 calc(20px + env(safe-area-inset-right, 0px))
             calc(30px + env(safe-area-inset-bottom, 0px))
             calc(40px + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}
.trio-boot.is-hidden { display: none; }

/* with the live scene up, the CSS starfield and the flat ground both go
 * away and a directional scrim keeps the type readable */
.trio-boot.has-scene {
  background:
    linear-gradient(100deg, rgba(5,7,15,.93) 0%, rgba(5,7,15,.80) 24%, rgba(5,7,15,.32) 52%, rgba(5,7,15,0) 72%),
    linear-gradient(0deg, rgba(5,7,15,.55) 0%, rgba(5,7,15,0) 28%);
}
.trio-boot.has-scene .trio-boot-stars { display: none; }
.trio-boot.has-scene .trio-boot-title {
  text-shadow: 0 1px 0 rgba(0,0,0,.9), 0 2px 24px rgba(0,0,0,.85), 0 0 40px rgba(243,193,95,.10);
}

.trio-boot-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  position: relative;
  z-index: 2;
}

/* fallback starfield (only when the canvas scene could not start) */
.trio-boot-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(232,226,212,0.8), transparent 60%),
    radial-gradient(1px 1px at 28% 8%, rgba(232,226,212,0.5), transparent 60%),
    radial-gradient(1.4px 1.4px at 41% 24%, rgba(243,193,95,0.7), transparent 60%),
    radial-gradient(1px 1px at 57% 12%, rgba(232,226,212,0.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 66% 28%, rgba(232,226,212,0.45), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(232,226,212,0.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 88% 20%, rgba(243,193,95,0.55), transparent 60%),
    radial-gradient(1px 1px at 8% 42%, rgba(232,226,212,0.4), transparent 60%),
    radial-gradient(1.2px 1.2px at 93% 45%, rgba(232,226,212,0.5), transparent 60%);
  animation: trio-star-breathe 5.5s ease-in-out infinite alternate;
}
@keyframes trio-star-breathe { from { opacity: 0.55; } to { opacity: 1; } }

/* ---- the lockup: seal, wordmark, hairline, one line of copy ---- */
.trio-boot-eyebrow {
  margin: 0;
  font-family: var(--t-ui);
  font-size: 10px;
  letter-spacing: 0.38em;
  color: var(--t-ink-dim);
  opacity: 0.38;
  display: flex;
  align-items: center;
}

/* 달문 인장: the moon-gate arch over three marks of different heights —
 * the game's win condition, drawn as a seal. Uneven heights on purpose;
 * evenly spaced ticks read as auto-generated. */
.trio-seal {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  vertical-align: -5px;
  border: 1px solid rgba(243, 193, 95, 0.42);
  border-radius: 50%;
}
.trio-seal::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--t-gold);
  border-left-color: rgba(243, 193, 95, 0.55);
  transform: rotate(-42deg);
}
.trio-seal::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4.5px;
  width: 9px;
  height: 6px;
  transform: translateX(-50%);
  background:
    linear-gradient(var(--t-gold), var(--t-gold)) 0px 100%/1px 3.5px no-repeat,
    linear-gradient(var(--t-gold), var(--t-gold)) 4px 100%/1px 6px no-repeat,
    linear-gradient(var(--t-gold), var(--t-gold)) 8px 100%/1px 4.5px no-repeat;
}

.trio-boot-title {
  margin: var(--sp-1) 0 0;
  font-weight: 700;
  color: var(--t-ink);
  font-size: clamp(34px, 12vh, 60px);
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,.9), 0 0 40px rgba(243,193,95,.10);
}
.trio-boot-title .g1 { font-size: 1.2em; letter-spacing: 0; }
.trio-boot-title .g2 { margin-left: 0.1em; letter-spacing: 0.055em; }

.trio-rule {
  display: block;
  width: 52px;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--t-gold), rgba(243, 193, 95, 0));
}

.trio-boot-sub {
  margin: 12px 0 0;
  font-family: var(--t-ui);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.75;
  color: var(--t-ink-dim);
  opacity: 0.42;
  max-width: 22em;
  word-break: keep-all;
}

/* ---- the single primary action: a 문살 frame, not a SaaS pill ---- */
.trio-continue-btn {
  position: relative;
  z-index: 2;
  margin-top: var(--sp-3);
  font-family: var(--t-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-gold);
  background: rgba(243, 193, 95, 0.05);
  border: none;
  border-top: 1px solid rgba(243, 193, 95, 0.78);
  border-bottom: 1px solid rgba(243, 193, 95, 0.78);
  border-radius: 0;
  padding: 13px 26px;
  cursor: pointer;
}
.trio-continue-btn::before,
.trio-continue-btn::after {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: rgba(243, 193, 95, 0.32);
}
.trio-continue-btn::before { left: 0; }
.trio-continue-btn::after { right: 0; }
.trio-continue-btn:active { background: rgba(243, 193, 95, 0.16); }

/* ---- utilities: one tier down, no chrome ---- */
.trio-boot-utils {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: var(--sp-2);
}
.trio-quiet-btn,
.trio-install-btn,
.trio-privacy-link {
  font-family: var(--t-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--t-ink-dim);
  opacity: 0.5;
  background: none;
  border: none;
  padding: 11px 2px;
  cursor: pointer;
  text-decoration: none;
}
.trio-quiet-btn { border-bottom: 1px solid rgba(243, 193, 95, 0.30); }

.trio-sound-btn {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.trio-sound-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--t-ink);
  stroke-width: 1.3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
}
.trio-sound-btn:active svg { opacity: 1; stroke: var(--t-gold); }
.trio-sound-btn:not(.is-muted) .sl { display: none; }
.trio-sound-btn.is-muted .wv { display: none; }

.trio-boot-gems {
  margin: 0;
  font-family: var(--t-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--t-gold);
  opacity: 0.75;
}
.trio-gem-ico { font-size: 0.85em; }

/* ---- 밤 고르기: the 35 nights live in a sheet, not on the poster ---- */
.trio-nights {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 42;
  transform: translateY(101%);
  visibility: hidden;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s linear .24s;
  background: linear-gradient(180deg, rgba(5,7,15,.62), rgba(5,7,15,.97) 22%);
  border-top: 1px solid rgba(243, 193, 95, 0.22);
  padding: 12px calc(16px + env(safe-area-inset-right, 0px))
           calc(14px + env(safe-area-inset-bottom, 0px))
           calc(16px + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}
.trio-nights.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
/* 창호지 문살 — the one piece of Korean joinery on this screen */
.trio-nights::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background:
    repeating-linear-gradient(90deg, rgba(243,193,95,.10) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(0deg, rgba(243,193,95,.07) 0 1px, transparent 1px 38px);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
}
.trio-nights-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.trio-nights-title {
  margin: 0;
  flex: 1;
  font-family: var(--t-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--t-ink-dim);
  opacity: 0.5;
}
.trio-nights-close {
  background: none;
  border: none;
  color: var(--t-ink-dim);
  font-size: 16px;
  padding: 8px 10px;
  cursor: pointer;
  opacity: 0.6;
}

.trio-chapters {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 1vh, 9px);
}
.trio-chapter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trio-chapter-label {
  width: 58px;
  text-align: right;
  font-family: var(--t-ui);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--t-ink-dim);
  opacity: 0.55;
  word-break: keep-all;
}
.trio-stage-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(30px, 42px));
  gap: clamp(4px, 0.9vh, 7px);
}
.trio-stage-grid button {
  font: inherit;
  font-family: var(--t-ui);
  font-size: clamp(11px, 2.6vh, 14px);
  aspect-ratio: 1;
  border-radius: 2px;
  border: 1px solid rgba(243, 193, 95, 0.26);
  background: transparent;
  color: var(--t-gold);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  line-height: 1;
}
.trio-stage-grid button.is-cleared {
  background: rgba(243, 193, 95, 0.12);
  border-color: rgba(243, 193, 95, 0.5);
}
.trio-stage-grid button.is-frontier {
  animation: trio-frontier 2s ease-in-out infinite;
}
@keyframes trio-frontier {
  0%, 100% { box-shadow: 0 0 0 rgba(243, 193, 95, 0); }
  50% { box-shadow: 0 0 12px rgba(243, 193, 95, 0.5); }
}
.trio-stage-grid button:disabled {
  border-color: rgba(154, 148, 168, 0.16);
  color: rgba(154, 148, 168, 0.4);
  cursor: default;
}
.trio-stage-grid button:not(:disabled):active { background: rgba(243, 193, 95, 0.28); }
.trio-stage-grid button.is-secret {
  border-style: dashed;
  border-color: rgba(243, 193, 95, 0.55);
  font-size: clamp(9px, 2vh, 12px);
}
.trio-stage-grid button.is-secret:disabled {
  border-color: rgba(243, 193, 95, 0.25);
  color: rgba(243, 193, 95, 0.5);
}
.trio-gem-dots { display: flex; gap: 2.5px; height: 4px; }
.trio-gem-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(154, 148, 168, 0.3);
}
.trio-gem-dots i.is-got { background: var(--t-gold); }
.trio-stage-grid button:disabled .trio-gem-dots { visibility: hidden; }

/* ---- entrance: black lifts, then the lockup assembles once ---- */
@keyframes trio-rise { from { opacity: 0; transform: translateY(9px); filter: blur(4px); } }
@keyframes trio-wipe { from { transform: scaleX(0); } }
@keyframes trio-veil { to { opacity: 0; } }
.trio-boot.is-entering::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  background: var(--t-bg);
  pointer-events: none;
  animation: trio-veil 1.1s ease .15s forwards;
}
.trio-boot.is-entering .trio-boot-lockup > * {
  animation: trio-rise .7s cubic-bezier(.2,.7,.2,1) backwards;
}
.trio-boot.is-entering .trio-boot-eyebrow { animation-delay: .45s; }
.trio-boot.is-entering .trio-boot-title { animation-delay: .62s; }
.trio-boot.is-entering .trio-boot-title .g2 {
  animation: trio-rise .7s cubic-bezier(.2,.7,.2,1) .74s backwards;
}
.trio-boot.is-entering .trio-rule {
  animation: trio-wipe .55s cubic-bezier(.2,.7,.2,1) 1.05s backwards;
  transform-origin: left;
}
.trio-boot.is-entering .trio-boot-sub { animation-delay: 1.30s; }
.trio-boot.is-entering .trio-continue-btn { animation-delay: 1.65s; }
.trio-boot.is-entering .trio-boot-utils { animation-delay: 1.85s; }
.trio-boot.is-entering .trio-sound-btn {
  animation: trio-rise .7s cubic-bezier(.2,.7,.2,1) 1.95s backwards;
}

@media (prefers-reduced-motion: reduce) {
  .trio-boot *, .trio-boot *::before, .trio-boot *::after {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .trio-boot.is-entering::before { display: none; }
  .trio-nights { transition: none; }
  .trio-boot-sub, .trio-boot-eyebrow, .trio-quiet-btn,
  .trio-install-btn, .trio-privacy-link { opacity: .5 !important; }
}

/* short landscape phones: keep the lockup off the very bottom edge */
@media (max-height: 400px) {
  .trio-boot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .trio-boot-sub { display: none; }
  .trio-continue-btn { margin-top: 18px; }
}

/* ---- in-game HUD ---- */
.trio-chips {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  gap: 10px;
}
.trio-chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(232, 226, 212, 0.25);
  background: rgba(8, 10, 22, 0.6);
  color: var(--t-ink);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  touch-action: none;
}
.trio-chip.is-active {
  opacity: 1;
  border-color: var(--t-gold);
  transform: scale(1.12);
  box-shadow: 0 0 14px rgba(243, 193, 95, 0.35);
}
/* The character art carries a baked IVORY card background. Worn raw,
 * the chips became three bright cream medallions pinned to the top of
 * a world otherwise made of black — the single most tone-breaking
 * thing on screen, and it sat there on every night at once.
 *
 * So they sink into the night instead. The two you are NOT holding go
 * cold and dim, and the one you ARE lights warm. It reads as
 * atmosphere, and it doubles as the answer to the only question the
 * chips exist to answer: which of them am I moving right now. */
.trio-chip {
  padding: 0;
  overflow: hidden;
  background: #080b16;
  border-color: rgba(232, 226, 212, 0.14);
  opacity: 0.74;
}
.trio-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  pointer-events: none;
  filter: grayscale(0.78) brightness(0.32) contrast(1.18);
  transition: filter 0.18s ease;
}
.trio-chip.is-active img {
  /* lit by a lamp, not printed on paper: the cream card ground
   * has to come down too or the one you hold is the brightest thing
   * on screen after the moon */
  filter: grayscale(0.16) brightness(0.66) sepia(0.32) contrast(1.06);
}

.trio-title-tag {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  z-index: 24;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--t-ink-dim);
}

.trio-menu-btn {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 26;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(232, 226, 212, 0.2);
  background: rgba(8, 10, 22, 0.5);
  color: var(--t-ink-dim);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
}

/* ---- caption ---- */
.trio-caption {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  z-index: 20;
  max-width: min(80vw, 640px);
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--t-panel);
  border: 1px solid rgba(243, 193, 95, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
}
.trio-caption.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  cursor: pointer;
}
.trio-caption p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--t-ink);
  word-break: keep-all;
}

/* ---- controls ---- */
.trio-controls {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 calc(18px + env(safe-area-inset-left, 0px))
           calc(14px + env(safe-area-inset-bottom, 0px))
           calc(18px + env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.trio-controls-group { display: flex; gap: 14px; pointer-events: auto; }
.trio-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(232, 226, 212, 0.25);
  background: rgba(8, 10, 22, 0.55);
  color: var(--t-ink);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.trio-btn:active {
  background: rgba(243, 193, 95, 0.2);
  border-color: rgba(243, 193, 95, 0.5);
  opacity: 0.95;
}

/* ---- stage title card (non-blocking, fades on its own) ---- */
.trio-stage-card {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}
.trio-stage-card.is-open { opacity: 1; }
.trio-stage-card-no {
  margin: 0;
  font-size: clamp(11px, 2.6vh, 13px);
  letter-spacing: 0.4em;
  color: var(--t-ink-dim);
}
.trio-stage-card-name {
  margin: 0;
  font-size: clamp(24px, 7.5vh, 42px);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--t-ink);
}

/* ---- stage clear overlay ---- */
/* ---- the clear rite: same lockup language as the title poster ----
 * The painted night stays visible behind a directional scrim, and the
 * card assembles in stages — eyebrow, word, hairline, gems, meta, CTA.
 */
.trio-clear {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(5, 7, 15, 0.88), rgba(5, 7, 15, 0.55) 55%, rgba(5, 7, 15, 0.3) 100%);
  text-align: center;
}
.trio-clear.is-open { display: flex; }
.trio-clear.is-open > * {
  animation: trio-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.trio-clear-stage {
  margin: 0;
  font-family: var(--t-ui);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--t-ink-dim);
  opacity: 0.6;
  animation-delay: 0.15s !important;
}
.trio-clear-title {
  margin: 8px 0 0;
  font-size: clamp(26px, 7.5vh, 44px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--t-ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 34px rgba(243, 193, 95, 0.14);
  animation-delay: 0.32s !important;
}
.trio-clear-rule {
  display: block;
  width: 46px;
  height: 1px;
  margin: 13px auto 0;
  background: linear-gradient(90deg, rgba(243, 193, 95, 0), var(--t-gold), rgba(243, 193, 95, 0));
  animation: trio-wipe 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.62s backwards !important;
}
.trio-clear-gems {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: clamp(16px, 4.4vh, 22px);
  min-height: 1em;
  animation-delay: 0.78s !important;
}
.trio-clear-gem { color: rgba(154, 148, 168, 0.3); }
.trio-clear-gem.is-old { color: rgba(243, 193, 95, 0.55); }
.trio-clear-gem.is-new {
  color: var(--t-gold);
  animation: trio-gem-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.5s backwards;
  text-shadow: 0 0 14px rgba(243, 193, 95, 0.6);
}
.trio-clear-gem.is-new:nth-child(2) { animation-delay: 0.62s; }
.trio-clear-gem.is-new:nth-child(3) { animation-delay: 0.74s; }
@keyframes trio-gem-pop { from { transform: scale(0); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .trio-clear.is-open > *, .trio-clear-gem.is-new, .trio-clear-rule { animation: none !important; }
}
.trio-clear-time {
  margin: 12px 0 0;
  font-family: var(--t-ui);
  font-size: 11px;
  color: var(--t-ink-dim);
  opacity: 0.65;
  letter-spacing: 0.1em;
  min-height: 1.2em;
  animation-delay: 1.0s !important;
}
.trio-clear-btns {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: clamp(16px, 4.5vh, 30px);
  animation-delay: 0.7s !important;
}
.trio-clear button {
  font-family: var(--t-ui);
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--t-gold);
  cursor: pointer;
}

/* ---- rotate prompt ---- */
.trio-rotate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--t-bg);
  text-align: center;
  padding: 32px;
}
.trio-rotate p { margin: 0; font-size: 15px; color: var(--t-ink-dim); word-break: keep-all; }
@media (orientation: portrait) {
  .trio-rotate { display: flex; }
}

/* privacy footer on the title screen */

/* install chip on the title screen */

/* one-tap continue on the title screen */
.trio-continue-btn:active { transform: scale(0.97); }

/* pause sheet */
.trio-pause {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(2, 3, 10, 0.9);
  text-align: center;
}
.trio-pause.is-open { display: flex; }
.trio-pause-title {
  margin: 0 0 4px;
  font-size: clamp(13px, 3vh, 15px);
  letter-spacing: 0.2em;
  color: var(--t-ink-dim);
}
.trio-pause button {
  font: inherit;
  font-size: 14px;
  padding: 10px 34px;
  border-radius: 999px;
  border: 1px solid rgba(243, 193, 95, 0.5);
  background: transparent;
  color: var(--t-gold);
  cursor: pointer;
  min-width: 220px;
}
.trio-pause .trio-pause-primary {
  background: var(--t-gold);
  color: var(--t-bg);
  border: none;
  font-weight: 600;
}
.trio-pause .trio-pause-quiet {
  border: none;
  color: var(--t-ink-dim);
  font-size: 12px;
  min-width: 0;
}
.trio-pause-toggles { display: flex; gap: 12px; }
.trio-pause-toggles button {
  min-width: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
}

/* clear screen hierarchy: one primary action, 문살-framed like the
 * title CTA; everything else is quiet text */
.trio-clear-next {
  margin: 8px 0 0;
  font-family: var(--t-ui);
  font-size: 11px;
  color: var(--t-ink-dim);
  opacity: 0.55;
  letter-spacing: 0.12em;
  min-height: 1.2em;
  animation-delay: 1.1s !important;
}
.trio-clear .trio-btn-primary {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-gold);
  background: rgba(243, 193, 95, 0.05);
  border-top: 1px solid rgba(243, 193, 95, 0.78);
  border-bottom: 1px solid rgba(243, 193, 95, 0.78);
  border-radius: 0;
  padding: 12px 30px;
}
.trio-clear .trio-btn-primary::before,
.trio-clear .trio-btn-primary::after {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: rgba(243, 193, 95, 0.32);
}
.trio-clear .trio-btn-primary::before { left: 0; }
.trio-clear .trio-btn-primary::after { right: 0; }
.trio-clear .trio-btn-primary:active { background: rgba(243, 193, 95, 0.16); }
.trio-clear .trio-btn-quiet {
  color: var(--t-ink-dim);
  opacity: 0.6;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 11px 2px;
}

/* the follow (모이기) chip */
.trio-chip-follow {
  background: rgba(8, 10, 22, 0.6);
  font-size: 20px;
}
.trio-chip-follow.is-on {
  opacity: 1;
  border-color: var(--t-gold);
  background: rgba(243, 193, 95, 0.18);
  box-shadow: 0 0 12px rgba(243, 193, 95, 0.3);
}

/* first-night coach pulse on undiscovered chips */
.trio-chip.is-coach {
  animation: trio-frontier 1.6s ease-in-out infinite;
  opacity: 0.85;
}
@media (prefers-reduced-motion: reduce) { .trio-chip.is-coach { animation: none; box-shadow: 0 0 10px rgba(243,193,95,0.4); } }

/* the secret night's slot */
.trio-stage-grid button.is-secret {
  border-style: dashed;
  border-color: rgba(243, 193, 95, 0.55);
  font-size: clamp(9px, 2vh, 12px);
}
.trio-stage-grid button.is-secret:disabled {
  border-color: rgba(243, 193, 95, 0.25);
  color: rgba(243, 193, 95, 0.5);
}

/* the iPhone's road to fullscreen is 홈 화면에 추가, not a button —
 * Safari does not expose the Fullscreen API on iPhone at all */
.trio-ios-tip {
  margin: 12px 0 0;
  font-family: var(--t-ui);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--t-ink-dim);
  opacity: 0.55;
}
.trio-ios-tip b { color: var(--t-gold); font-weight: 600; }

/* beside a stone the guardian's button becomes a GRIP — the pull needs
 * the button HELD and nothing said so, which made a badly-shoved stone
 * look like a ruined night */
.trio-btn.is-grip {
  opacity: 0.9;
  border-color: rgba(243, 193, 95, 0.7);
  background: rgba(243, 193, 95, 0.14);
}
