:root {
  --pink: #FF2D6F;
  --pink-deep: #D4005A;
  --yellow: #FFE600;
  --blue: #2EC4FF;
  --text: #1A1A1A;
  --white: #FFFDF7;
  --font-en: "Bagel Fat One", "Impact", sans-serif;
  --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;

  --cream: #FFF5E8;
  --gold: #F7C75F;
  --gold-deep: #BC7A14;
  --wine: #3E1230;
  --wine-deep: #1D0917;
  --plum: #120812;
  --wood: #7A4A28;
  --wood-deep: #3A2010;

  --border-size: 3px;
  --radius: 18px;
  --radius-card: 20px;
  --pill: 999px;
  --shadow-sm: 2px 2px 0 var(--text);
  --shadow-md: 3px 3px 0 var(--text);
  --shadow-lg: 4px 4px 0 var(--text);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.22, 1.18, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  min-width: 320px;
  background: #150812;
  color: var(--text);
  font-family: var(--font-jp);
  font-weight: 700;
  display: flex;
  justify-content: center;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "palt";
}

button {
  font: inherit;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

#app {
  width: min(100%, 460px);
  height: 100vh;
  height: 100svh;
  position: relative;
  overflow: hidden;
  background: #150812;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  max-width: 300px;
  border: var(--border-size) solid var(--text);
  border-radius: var(--pill);
  padding: 14px 22px;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease);
}

.primary-btn {
  color: var(--white);
  background: linear-gradient(180deg, #FF5992 0%, var(--pink) 58%, var(--pink-deep) 100%);
  box-shadow: var(--shadow-lg);
}

.secondary-btn {
  color: var(--text);
  background: linear-gradient(180deg, #FFFDF7 0%, #FDE7CE 100%);
  box-shadow: var(--shadow-md);
}

.primary-btn:active,
.secondary-btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

/* ── Intro ──────────────────────────────────────────────── */

#intro-screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  background: #0D0008;
}

/* background sparkle decoration */
.intro-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ibg-spark {
  position: absolute;
  color: var(--pink);
  font-size: 1.1rem;
  opacity: 0.55;
}
.ibg-spark.s1 { top:  6%; left: 52%; font-size: 1.6rem; color: var(--yellow); }
.ibg-spark.s2 { top: 12%; right: 5%; font-size: 1rem; }
.ibg-spark.s3 { top: 20%; right: 3%; font-size: 1.4rem; color: #FF8AB0; }
.ibg-spark.s4 { top: 42%; left: 3%; font-size: 0.85rem; color: var(--yellow); opacity: 0.5; }
.ibg-spark.s5 { bottom: 32%; right: 5%; font-size: 1rem; opacity: 0.5; }
.ibg-spark.s6 { bottom: 24%; left: 7%; font-size: 1.1rem; color: #FF8AB0; opacity: 0.55; }
.ibg-spark.s7 { top: 48%; right: 8%; font-size: 1.3rem; color: var(--pink); opacity: 0.65; }
.ibg-spark.s8 { top: 30%; left: 48%; font-size: 0.85rem; color: var(--yellow); opacity: 0.45; }
.ibg-spark.s9 { bottom: 45%; left: 44%; font-size: 1.2rem; color: var(--pink); opacity: 0.5; }

/* pink glow blobs — multiple layers for dramatic effect */
.intro-bg::before {
  content: "";
  position: absolute;
  top: -15%;
  right: -15%;
  width: 70%;
  height: 65%;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(ellipse at 40% 40%, rgba(255, 45, 111, 0.38) 0%, transparent 65%);
  transform: rotate(-12deg);
}

.intro-bg::after {
  content: "";
  position: absolute;
  top: 30%;
  right: -5%;
  width: 45%;
  height: 40%;
  border-radius: 55% 45% 40% 60%;
  background: radial-gradient(ellipse at 50% 50%, rgba(200, 0, 80, 0.28) 0%, transparent 65%);
  transform: rotate(8deg);
}

/* ── Hero row: character left + title right ── */
.intro-hero {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  height: min(58svh, 370px);
}

/* intro_milk_crop.png: cropped RGBA, 864×1475. Character fills most of canvas. */
.intro-char {
  flex: 0 0 48%;
  align-self: stretch;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
}

/* right column: speech bubble at top, title at bottom */
.intro-hero-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px 14px 14px 4px;
  position: relative;
}

/* paint splash backdrop behind title area */
.intro-hero-right::before {
  content: "";
  position: absolute;
  inset: 0 -10px -10px -30px;
  background:
    radial-gradient(ellipse 110% 90% at 55% 65%, rgba(100, 0, 35, 0.55) 0%, transparent 65%),
    radial-gradient(ellipse 80% 60% at 70% 30%, rgba(180, 0, 70, 0.3) 0%, transparent 60%);
  border-radius: 30% 40% 40% 30%;
  transform: rotate(-3deg);
  pointer-events: none;
  z-index: -1;
}

/* speech bubble */
.intro-speech {
  position: absolute;
  z-index: 3;
  top: clamp(58px, 13svh, 90px);
  left: clamp(-66px, -13vw, -38px);
  max-width: min(64vw, 230px);
  padding: 7px 12px 6px;
  border: 2px solid rgba(255, 93, 154, 0.96);
  border-radius: var(--pill);
  background:
    linear-gradient(180deg, rgba(64, 7, 40, 0.9) 0%, rgba(16, 0, 11, 0.88) 100%);
  color: var(--white);
  font-size: clamp(0.68rem, 2.35vw, 0.76rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-shadow:
    0 0 9px rgba(255, 255, 255, 0.28),
    0 1px 0 rgba(0, 0, 0, 0.8);
  box-shadow:
    0 0 0 2px rgba(255, 245, 232, 0.08),
    0 0 18px rgba(255, 45, 111, 0.52),
    inset 0 0 14px rgba(255, 45, 111, 0.18);
  white-space: nowrap;
  transform: rotate(-1deg);
}

.intro-speech::after {
  content: "";
  position: absolute;
  top: 58%;
  left: -7px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, rgba(24, 0, 15, 0.92), rgba(58, 7, 37, 0.92));
  border-left: 2px solid rgba(255, 93, 154, 0.96);
  border-bottom: 2px solid rgba(255, 93, 154, 0.96);
  box-shadow: -5px 5px 12px rgba(255, 45, 111, 0.22);
  transform: translateY(-50%) rotate(45deg);
}

.speech-heart {
  color: var(--pink);
}

/* title block */
.intro-title-block {
  width: clamp(260px, 70vw, 440px);
  margin: 0 -8px -8px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  position: relative;
  filter:
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 22px rgba(255, 45, 111, 0.24));
}

.intro-title-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transform: rotate(-2deg);
  transform-origin: 80% 70%;
  animation: titleLogoPop 0.72s var(--ease-bounce) both;
}

.intro-title-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.intro-sub {
  color: var(--pink);
  font-size: clamp(0.95rem, 4.2vw, 1.2rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow:
    1px 1px 0 #0A0005,
    -1px -1px 0 #0A0005,
    0 0 18px rgba(255, 45, 111, 0.8);
}

.intro-title-main {
  font-family: var(--font-jp);
  font-size: clamp(2.5rem, 11vw, 3.3rem);
  line-height: 0.88;
  color: var(--yellow);
  text-shadow:
    0 0 50px rgba(255, 230, 0, 0.7),
    0 0 20px rgba(255, 200, 0, 0.5),
    4px 4px 0 #0A0005,
    -3px -3px 0 #0A0005,
    3px -3px 0 #0A0005,
    -3px 3px 0 #0A0005,
    0 6px 0 rgba(0,0,0,0.7);
  letter-spacing: -0.02em;
}

.intro-card-mode-badge {
  padding: 4px 13px 3px;
  border: var(--border-size) solid var(--text);
  border-radius: var(--pill);
  background: linear-gradient(90deg, #FF2D6F 0%, #A40048 100%);
  color: var(--white);
  font-family: var(--font-en);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-sm);
}

/* ── Scrollable content (copy + cards + notes) ── */
.intro-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(13,0,8,0.6) 0%, rgba(13,0,8,0.85) 20%);
}

.intro-copy {
  text-align: center;
  line-height: 1.5;
  font-size: 0.8rem;
  color: rgba(255, 253, 247, 0.88);
}

/* card previews — real card images */
.intro-preview {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.preview-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.preview-card-img {
  width: 100%;
  aspect-ratio: 10 / 14.5;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.6);
}

.preview-card-wrap:nth-child(1) .preview-card-img { transform: rotate(-2.5deg); }
.preview-card-wrap:nth-child(2) .preview-card-img { transform: translateY(-3px) rotate(-1deg); }
.preview-card-wrap:nth-child(3) .preview-card-img { transform: translateY(-3px) rotate(1deg); }
.preview-card-wrap:nth-child(4) .preview-card-img { transform: rotate(2.5deg); }

.preview-card-cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.preview-card-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  line-height: 1.2;
}

.preview-card-desc {
  font-size: 0.65rem;
  color: rgba(255, 253, 247, 0.68);
  text-align: center;
  line-height: 1.3;
}

/* rules notes */
.intro-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.intro-notes span {
  padding: 6px 13px;
  border: 2px solid rgba(255, 45, 111, 0.65);
  border-radius: var(--pill);
  background: rgba(255, 45, 111, 0.2);
  font-size: 0.72rem;
  color: rgba(255, 200, 220, 0.95);
  box-shadow: 0 0 8px rgba(255, 45, 111, 0.2);
}

.intro-disclaimer {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 253, 247, 0.48);
  font-size: 0.64rem;
  line-height: 1.55;
  text-align: center;
}

/* ── CTA — always pinned at bottom as flex child of #intro-screen ── */
.intro-cta {
  flex-shrink: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 14px max(14px, env(safe-area-inset-bottom));
  background: #0D0008;
}

/* large start button */
.intro-start-btn {
  width: min(96%, 360px);
  padding: 18px 28px 16px;
  border: var(--border-size) solid var(--text);
  border-radius: var(--pill);
  background: linear-gradient(180deg, #FF8FC0 0%, #FF2D6F 45%, #D4005A 100%);
  color: var(--white);
  font-family: var(--font-jp);
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  box-shadow:
    var(--shadow-lg),
    0 0 0 4px rgba(255, 45, 111, 0.35),
    0 0 0 8px rgba(255, 45, 111, 0.15),
    0 0 30px rgba(255, 45, 111, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease);
}

.intro-start-btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.btn-spark {
  color: var(--yellow);
  font-size: 1.1rem;
}

.link-back {
  font-size: 0.78rem;
  color: rgba(255, 253, 247, 0.46);
  letter-spacing: 0.06em;
  padding-bottom: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .intro-start-btn { transition: none; }
}

/* ── Game screen ─────────────────────────────────────────── */

#game-screen {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #1A0A16;
}

.hud,
.stage,
.hand {
  position: relative;
  z-index: 1;
}

/* ── HUD ─────────────────────────────────────────────────── */

.hud {
  padding: 6px 10px 8px;
  background: #1A0A16;
  border-bottom: var(--border-size) solid var(--text);
}

.hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

.hud-logo {
  display: none;
}

.hud-stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 6px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.hud-stat-top {
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}

.hud-stat-icon {
  font-size: 0.85rem;
}

.hud-stat-name {
  display: none;
}

.hud-stat-value {
  font-family: var(--font-en);
  font-size: 0.95rem;
  color: var(--white);
}

.hud-bar {
  width: 36px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.12);
}

.gauge-fill {
  height: 100%;
  width: 0;
  border-radius: var(--pill);
  transition: width 0.35s var(--ease);
}

.hud-stat.is-danger {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.hud-stat.is-critical {
  animation: hudCritical 0.78s ease-in-out infinite;
}

.gauge-fill.drunk {
  background: linear-gradient(90deg, #FFB25C 0%, #FF6A00 100%);
}

.gauge-fill.sus {
  background: linear-gradient(90deg, #FF5FA2 0%, #FFD1E3 100%);
  box-shadow: 0 0 8px rgba(255, 95, 162, 0.44);
}

.gauge-fill.tens {
  background: linear-gradient(90deg, #6BE4FF 0%, #2EC4FF 100%);
}

.gauge-fill.mood {
  background: linear-gradient(90deg, #FFC1D7 0%, var(--pink) 100%);
}

.hud-meta {
  width: 100%;
  order: -1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.top-btn {
  flex: 0 0 auto;
  padding: 5px 10px 4px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 253, 247, 0.88);
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.top-btn:active {
  transform: translate(1px, 1px);
}

.hud-turnline {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.08em;
}

.hud-turnline strong {
  font-family: var(--font-en);
  font-size: 0.9rem;
  color: var(--white);
  letter-spacing: 0.02em;
}

.act-badge {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 10px 4px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--pill);
  background: #FF2D6F;
  color: var(--white);
  font-size: 0.64rem;
  text-align: center;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-sm);
}

.turn-history {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding-inline: 2px;
}

.turn-dot {
  height: 7px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 8px rgba(255, 255, 255, 0.04);
}

.turn-dot.current {
  background: linear-gradient(90deg, #FFFDF7, #FFD14F);
  box-shadow:
    0 0 0 1px rgba(255, 209, 79, 0.42),
    0 0 14px rgba(255, 209, 79, 0.46);
  animation: pulseGlow 0.9s ease-in-out infinite;
}

.turn-dot.played {
  box-shadow: 0 0 10px rgba(255, 45, 111, 0.22);
}

.turn-dot.tone-bust { background: linear-gradient(90deg, #FF2644, #8A0016); }
.turn-dot.tone-counter { background: linear-gradient(90deg, #2EC4FF, #005DAD); }
.turn-dot.tone-toast { background: linear-gradient(90deg, #FFD14F, #FF7A00); }
.turn-dot.tone-freeze { background: linear-gradient(90deg, #BEEBFF, #2C7CA8); }
.turn-dot.tone-drink { background: linear-gradient(90deg, #FF9C46, #C24C00); }
.turn-dot.tone-mood { background: linear-gradient(90deg, #FF89B8, #FF2D6F); }
.turn-dot.tone-neutral { background: linear-gradient(90deg, #A497A8, #5B4D60); }

/* ── Stage ───────────────────────────────────────────────── */

.stage {
  min-height: 0;
  padding: 10px 10px 0;
  display: grid;
  grid-template-rows: minmax(0, 1.95fr) minmax(132px, 0.74fr);
  gap: 10px;
}

/* ── Milk stage ──────────────────────────────────────────── */

.milk-stage {
  position: relative;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 6px;
  border: var(--border-size) solid var(--text);
  border-radius: 28px 28px 24px 24px;
  background: #2A1322;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.milk-overlays {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(138px, 158px);
  gap: 8px;
  align-items: start;
}

.tell-bubble {
  position: relative;
  justify-self: stretch;
  padding: 10px 14px;
  border: var(--border-size) solid var(--text);
  border-radius: 20px;
  background: #FFFDF7;
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  line-height: 1.42;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.tell-bubble::after {
  content: "";
  position: absolute;
  left: 62%;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: #FFFDF7;
  border-right: var(--border-size) solid var(--text);
  border-bottom: var(--border-size) solid var(--text);
  transform: rotate(45deg);
}

.tell-bubble[hidden] {
  display: none;
}

.tell-bubble.tell-in {
  opacity: 1;
  transform: translateY(0);
}

.tell-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  border: var(--border-size) solid var(--text);
  border-radius: 18px;
  background: #FFF6D7;
  box-shadow: var(--shadow-md);
}

.tell-hint[hidden] {
  display: none;
}

.hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--text);
  border-radius: 12px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(180deg, #22131D 0%, #090307 100%);
  color: #FFD14F;
  font-family: var(--font-jp);
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 79, 0.18);
  flex-shrink: 0;
}

.hint-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hint-observation {
  font-size: 0.7rem;
  color: rgba(26, 26, 26, 0.62);
  line-height: 1.35;
}

.hint-prediction {
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--pink-deep);
  white-space: nowrap;
}

/* milk-ambient: element kept in HTML but decorations removed */
.milk-ambient {
  display: none;
}

.character-stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

/* seat-glow: removed */
.seat-glow {
  display: none;
}

.character {
  position: relative;
  width: clamp(190px, 62vw, 265px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.4));
}

/* Expression auras — single drop-shadow per face, flat */
.character[data-face="doubt"] {
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 14px rgba(140, 160, 255, 0.32));
}

.character[data-face="smile"] {
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 14px rgba(255, 225, 80, 0.38));
}

.character[data-face="mood"] {
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 16px rgba(255, 45, 111, 0.34));
}

.character[data-face="cold"] {
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.4)) hue-rotate(-15deg) brightness(0.92) saturate(0.7);
}

.char-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.char-art.loaded {
  opacity: 1;
}

.char-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.char-art.loaded ~ .char-fallback {
  display: none;
}

.char-fallback::before {
  content: "";
  position: absolute;
  top: 14%;
  width: 72%;
  height: 72%;
  border: var(--border-size) solid var(--text);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #FFF3F8 0%, #FFD7E5 32%, #FFC4D6 100%);
}

/* cold fallback face: blue-tinted */
.character[data-face="cold"] .char-fallback::before {
  background: radial-gradient(circle at 50% 30%, #EEF4FF 0%, #D7E3F4 32%, #C4D6F0 100%);
}

.face-eye,
.face-mouth {
  position: absolute;
  background: var(--text);
  border-radius: var(--pill);
}

.face-eye {
  top: 38%;
  width: 10%;
  height: 8%;
}

.face-eye.left  { left: 30%; }
.face-eye.right { right: 30%; }

.face-mouth {
  top: 56%;
  left: 50%;
  width: 24%;
  height: 5%;
  transform: translateX(-50%);
}

.character[data-face="doubt"] .face-eye.left  { transform: rotate(14deg); }
.character[data-face="doubt"] .face-eye.right { transform: rotate(-14deg); }

.character[data-face="smile"] .face-mouth,
.character[data-face="mood"] .face-mouth {
  height: 12%;
  background: transparent;
  border: var(--border-size) solid var(--text);
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

.character[data-face="mood"] .face-eye {
  height: 4%;
  top: 40%;
}

/* cold: half-closed eyes, flat mouth */
.character[data-face="cold"] .face-eye {
  height: 4%;
  top: 39%;
  transform: scaleY(0.6);
}

.character[data-face="cold"] .face-mouth {
  width: 16%;
  height: 3%;
}

.milk-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 7px 12px;
  border: var(--border-size) solid var(--text);
  border-radius: var(--pill);
  background: linear-gradient(180deg, rgba(255, 249, 235, 0.96) 0%, rgba(255, 236, 198, 0.94) 100%);
  box-shadow: var(--shadow-md);
}

.milk-name {
  font-family: var(--font-en);
  font-size: 0.94rem;
  color: var(--pink-deep);
  line-height: 1;
}

.milk-seat {
  font-size: 0.68rem;
  color: rgba(26, 26, 26, 0.62);
}

/* ── Table area ──────────────────────────────────────────── */

.table-area {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px 10px;
  border: var(--border-size) solid var(--text);
  border-radius: 26px 26px 18px 18px;
  background: var(--wood);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 230, 176, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

/* table-surface and chips: hidden (HTML kept for JS compatibility) */
.table-surface {
  display: none;
}

.table-chip {
  display: none;
}

.reveal-row {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 12px;
}

.reveal-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reveal-owner {
  font-family: var(--font-en);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: rgba(255, 244, 220, 0.86);
}

.reveal-caption {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: rgba(255, 244, 220, 0.92);
  text-align: center;
  line-height: 1.2;
}

.flip-card {
  width: clamp(96px, 27vw, 122px);
  aspect-ratio: 10 / 14.5;
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-bounce);
}

.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-size) solid var(--text);
  border-radius: var(--radius-card);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-md);
}

.flip-front {
  background: linear-gradient(140deg, #FF6A9B 0%, var(--pink) 50%, #A40048 100%);
}

.card-back-icon {
  position: relative;
  z-index: 1;
  font-family: var(--font-en);
  font-size: clamp(2rem, 7vw, 2.8rem);
  color: rgba(255, 248, 220, 0.94);
  text-shadow: 2px 2px 0 rgba(26, 26, 26, 0.24);
}

.flip-back {
  padding: 10px;
  background: #FFFDF7;
  transform: rotateY(180deg);
}

.card-reveal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-face-icon,
.card-face-label {
  position: relative;
  z-index: 1;
}

.card-face-icon {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.card-face-label {
  padding-inline: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.vs-label {
  min-width: 68px;
  padding: 10px 8px 8px;
  border: var(--border-size) solid var(--text);
  border-radius: 18px;
  background: #FFE382;
  color: var(--text);
  font-family: var(--font-en);
  font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.vs-label.reveal-hide {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
}

.sfx-text {
  position: relative;
  z-index: 1;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px 6px;
  border: 2px solid var(--text);
  border-radius: var(--pill);
  background: rgba(255, 253, 247, 0.95);
  color: var(--text);
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  box-shadow: var(--shadow-sm);
}

.sfx-text.sfx-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── Hand ────────────────────────────────────────────────── */

.hand {
  padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  border-top: var(--border-size) solid var(--text);
  background: #1A0A16;
}

.hand-head {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.hand-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hand-title {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px 2px;
  border: 1.5px solid rgba(255, 45, 111, 0.64);
  border-radius: var(--pill);
  background: rgba(255, 45, 111, 0.12);
  font-family: var(--font-en);
  font-size: 0.86rem;
  color: var(--white);
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 45, 111, 0.38);
}

.hand-subtitle {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.48);
}

.hand-grid {
  width: min(100%, 370px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.card-slot {
  --slot-accent: var(--pink);
  --slot-accent-2: var(--yellow);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 2px solid var(--text);
  border-radius: 10px;
  background: #FFFDF7;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  transition:
    transform 0.16s var(--ease-bounce),
    box-shadow 0.16s var(--ease),
    opacity 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.card-slot::before {
  content: "";
  display: block;
  height: 5px;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--slot-accent), var(--slot-accent-2));
}

.card-slot[data-card="toast"] { --slot-accent: #FF9A4D; --slot-accent-2: #FFE382; }
.card-slot[data-card="fake"]  { --slot-accent: #FF5A9A; --slot-accent-2: #FFD1EA; }
.card-slot[data-card="watch"] { --slot-accent: #2EC4FF; --slot-accent-2: #B9F2FF; }
.card-slot[data-card="chaser"]{ --slot-accent: #67D5D1; --slot-accent-2: #C9FFF3; }

.card-slot:not(:disabled) {
  cursor: pointer;
}

.card-slot:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.card-img-thumb {
  width: 100%;
  aspect-ratio: 10 / 13.25;
  object-fit: cover;
  display: block;
}

.card-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 3px 5px;
}

.card-label {
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-hint {
  font-size: 0.46rem;
  line-height: 1.3;
  color: rgba(26, 26, 26, 0.62);
}

.card-count {
  position: absolute;
  top: 10px;
  right: 4px;
  min-width: 22px;
  padding: 1px 4px;
  border: 1.5px solid var(--text);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-en);
  font-size: 0.72rem;
  line-height: 1.2;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
  text-align: center;
}

.card-slot.empty,
.card-slot:disabled {
  cursor: not-allowed;
}

.hand.blocked .card-slot:not(:disabled) {
  opacity: 0.58;
  pointer-events: none;
}

.card-slot.empty {
  background: repeating-linear-gradient(
    135deg,
    #D5C9C5 0 9px,
    #C3B7B2 9px 18px
  );
  opacity: 0.72;
  box-shadow: var(--shadow-sm);
}

.card-slot.empty::before {
  background: linear-gradient(90deg, #8E8E8E, #C8C8C8);
}

.card-slot.empty::after {
  content: "売切";
  position: absolute;
  inset: auto;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-11deg);
  border: 2px solid rgba(174, 0, 0, 0.52);
  border-radius: var(--pill);
  padding: 3px 10px 2px;
  background: rgba(255, 255, 255, 0.8);
  color: rgba(174, 0, 0, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  z-index: 2;
}

.card-slot.empty .card-img-thumb,
.card-slot.empty .card-text {
  opacity: 0.36;
}

.card-slot.empty .card-count {
  background: rgba(120, 120, 120, 0.9);
  color: rgba(255, 255, 255, 0.72);
}

.card-slot.last-one {
  border-color: #D92D3A;
  background: #FFF4F5;
  box-shadow:
    var(--shadow-md),
    0 0 0 2px rgba(217, 45, 58, 0.3);
  animation: lastOnePulse 1.2s ease-in-out infinite;
}

.card-slot.last-one .card-count {
  background: #FFF4F5;
  color: #C2182E;
  border-color: #C2182E;
}

/* ── Result screen ───────────────────────────────────────── */

#result-screen {
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #1A0A16 0%, #120711 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.result-frame {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 14px;
  border: var(--border-size) solid var(--text);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(255, 243, 228, 0.96) 100%);
  box-shadow: var(--shadow-lg);
}

.result-frame.true-end {
  background: linear-gradient(180deg, #FFFBE8 0%, #FFF0CF 100%);
  box-shadow:
    var(--shadow-lg),
    0 0 0 3px rgba(255, 230, 0, 0.34);
}

.result-frame.special-end {
  background: linear-gradient(180deg, #F2FBFF 0%, #E4F5FF 100%);
  box-shadow:
    var(--shadow-lg),
    0 0 0 3px rgba(46, 196, 255, 0.28);
}

.result-frame.normal-end {
  background: linear-gradient(180deg, #FFFDF7 0%, #F6ECE2 100%);
}

.result-frame.bad-end {
  background: linear-gradient(180deg, #241017 0%, #170911 100%);
  border-color: #FF4C62;
  box-shadow:
    var(--shadow-lg),
    0 0 0 3px rgba(255, 76, 98, 0.26);
}

.result-verdict {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: rgba(26, 26, 26, 0.56);
}

.result-frame.bad-end .result-verdict {
  color: rgba(255, 200, 208, 0.72);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px 4px;
  border: 2px solid var(--text);
  border-radius: var(--pill);
  background: rgba(255, 45, 111, 0.12);
  color: var(--pink-deep);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.result-frame.bad-end .result-kicker {
  background: rgba(255, 76, 98, 0.16);
  color: #FFC9D1;
}

.result-title-big {
  font-family: var(--font-en);
  font-size: clamp(1.5rem, 7vw, 2.15rem);
  line-height: 1.05;
  color: var(--text);
  text-shadow:
    2px 2px 0 rgba(255, 230, 0, 0.85),
    4px 4px 0 rgba(26, 26, 26, 0.18);
}

.result-frame.special-end .result-title-big {
  text-shadow:
    2px 2px 0 rgba(46, 196, 255, 0.34),
    4px 4px 0 rgba(26, 26, 26, 0.12);
}

.result-frame.bad-end .result-title-big {
  color: #FFD7DE;
  text-shadow:
    2px 2px 0 rgba(255, 76, 98, 0.45),
    4px 4px 0 rgba(0, 0, 0, 0.3);
}

.result-title-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 11px 5px;
  border: 2px solid var(--text);
  border-radius: var(--pill);
  background: linear-gradient(180deg, #FFF1A6 0%, #FFD14F 100%);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
}

.result-frame.bad-end .result-title-badge {
  background: linear-gradient(180deg, #3E1723 0%, #220A14 100%);
  color: #FFE3EA;
  border-color: rgba(255, 210, 220, 0.45);
}

.result-card-img-wrap {
  width: 92px;
  aspect-ratio: 10 / 14.5;
  border: var(--border-size) solid var(--text);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #FFFDF7 0%, #F8E8D8 100%);
}

.result-card-img-wrap:empty {
  display: none;
}

.result-card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-achievements {
  display: grid;
  gap: 6px;
}

.achievement-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  padding: 6px 8px;
  border: 2px solid rgba(26, 26, 26, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(26, 26, 26, 0.78);
  box-shadow: var(--shadow-sm);
}

.achievement-chip::before {
  content: "実績";
  grid-row: 1 / span 2;
  padding: 4px 6px 3px;
  border-radius: var(--pill);
  background: rgba(255, 45, 111, 0.14);
  color: var(--pink-deep);
  font-size: 0.56rem;
  line-height: 1;
}

.achievement-chip.is-new::before {
  content: "NEW";
  background: rgba(255, 209, 79, 0.34);
  color: #7A3C00;
}

.achievement-name {
  min-width: 0;
  font-size: 0.76rem;
  color: var(--text);
  line-height: 1.2;
}

.achievement-desc {
  min-width: 0;
  font-size: 0.62rem;
  line-height: 1.3;
  color: rgba(26, 26, 26, 0.62);
}

.result-frame.bad-end .achievement-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 228, 232, 0.82);
}

.result-frame.bad-end .achievement-chip::before {
  background: rgba(255, 76, 98, 0.2);
  color: #FFC9D1;
}

.result-frame.bad-end .achievement-chip.is-new::before {
  background: rgba(255, 209, 79, 0.26);
  color: #FFE4A3;
}

.result-frame.bad-end .achievement-name {
  color: rgba(255, 253, 247, 0.94);
}

.result-frame.bad-end .achievement-desc {
  color: rgba(255, 228, 232, 0.72);
}

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tab-btn {
  padding: 10px 6px 8px;
  border: var(--border-size) solid var(--text);
  border-radius: 16px;
  background: linear-gradient(180deg, #FFFDF7 0%, #F4E5D6 100%);
  color: rgba(26, 26, 26, 0.64);
  font-size: 0.74rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease-bounce), background 0.14s var(--ease), color 0.14s var(--ease);
}

.tab-btn.active {
  background: linear-gradient(180deg, #FF6297 0%, var(--pink) 100%);
  color: var(--white);
}

.result-frame.bad-end .tab-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 218, 224, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}

.result-frame.bad-end .tab-btn.active {
  background: linear-gradient(180deg, #FF5D72 0%, #C70C28 100%);
  color: var(--white);
}

.result-pov {
  min-height: 108px;
  max-height: min(24svh, 170px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 13px 14px;
  border: var(--border-size) solid var(--text);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  font-size: 0.84rem;
  line-height: 1.75;
}

.result-frame.bad-end .result-pov {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 228, 232, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
}

.pov-line {
  padding: 5px 0;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.14);
}

.pov-line:first-child,
.pov-line:nth-child(2) {
  font-weight: 700;
  color: rgba(26, 26, 26, 0.9);
}

.pov-line:last-child {
  border-bottom: 0;
}

.result-frame.bad-end .pov-line {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.result-frame.bad-end .pov-line:first-child,
.result-frame.bad-end .pov-line:nth-child(2) {
  color: rgba(255, 253, 247, 0.96);
}

.pov-monologue,
.pov-cast {
  color: rgba(26, 26, 26, 0.8);
}

.result-frame.bad-end .pov-monologue,
.result-frame.bad-end .pov-cast {
  color: rgba(255, 228, 232, 0.88);
}

.result-actions {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.result-actions .primary-btn,
.result-actions .secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

#post-x-btn {
  background: linear-gradient(180deg, #20242B 0%, #07090D 100%);
  color: var(--white);
}

/* ── Toast ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  min-width: min(260px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 10px 16px 9px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--pill);
  background: rgba(18, 8, 17, 0.92);
  color: var(--white);
  font-size: 0.78rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Impact layer ────────────────────────────────────────── */

.impact-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.impact-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.04), transparent 36%),
    rgba(8, 0, 7, 0.34);
  opacity: 0;
  pointer-events: none;
}

#app.impact-pulse .impact-layer::before {
  animation: impactStageDim 1.08s ease-out;
}

.impact-wash,
.danger-vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.impact-wash {
  z-index: 1;
  mix-blend-mode: screen;
}

.danger-vignette {
  z-index: 0;
  transition: opacity 0.28s var(--ease);
}

#app[data-danger="drunk"] .danger-vignette {
  opacity: 0.42;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 156, 70, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(255, 108, 0, 0.06), rgba(80, 20, 0, 0.28));
  animation: drunkWobble 1.4s ease-in-out infinite;
}

#app[data-danger="sus"] .danger-vignette {
  opacity: 0.48;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(210, 230, 255, 0.22) 48% 52%, transparent 54% 100%),
    radial-gradient(circle at 50% 35%, rgba(210, 230, 255, 0.12), transparent 55%);
  animation: susScan 1.1s ease-in-out infinite;
}

#app[data-danger="cold"] .danger-vignette {
  opacity: 0.45;
  background:
    linear-gradient(180deg, rgba(190, 235, 255, 0.12), rgba(15, 36, 62, 0.36)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 12px);
}

#app[data-danger="mood"] .danger-vignette {
  opacity: 0.3;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 70, 140, 0.22), transparent 18%),
    radial-gradient(circle at 76% 42%, rgba(255, 200, 225, 0.18), transparent 16%),
    radial-gradient(circle at 50% 12%, rgba(255, 45, 111, 0.16), transparent 34%);
  animation: moodFloat 1.6s ease-in-out infinite;
}

.commit-card {
  position: absolute;
  left: 50%;
  bottom: 130px;
  z-index: 4;
  width: 116px;
  aspect-ratio: 10 / 14.5;
  border: var(--border-size) solid var(--text);
  border-radius: var(--radius-card);
  background: #FFFDF7;
  box-shadow:
    var(--shadow-lg),
    0 0 0 5px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translate(-50%, 38px) scale(0.78) rotate(-5deg);
  overflow: hidden;
}

.commit-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.commit-card-label {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 12px);
  padding: 4px 8px 3px;
  border: 2px solid var(--text);
  border-radius: var(--pill);
  background: rgba(255, 253, 247, 0.95);
  color: var(--text);
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
}

.commit-card.commit-in {
  animation: commitCardFly 0.42s var(--ease-bounce);
}

#app[data-commit="toast"] .impact-wash {
  animation: commitToast 0.46s ease-out;
}

#app[data-commit="fake"] .impact-wash {
  animation: commitFake 0.46s ease-out;
}

#app[data-commit="watch"] .impact-wash {
  animation: commitWatch 0.46s ease-out;
}

#app[data-commit="chaser"] .impact-wash {
  animation: commitChaser 0.46s ease-out;
}

.hand.committing .card-slot:not(.chosen) {
  opacity: 0.38;
  filter: grayscale(0.75) brightness(0.68);
}

.card-slot.chosen {
  z-index: 3;
  animation: chosenCard 0.46s var(--ease-bounce);
}

.reaction-burst {
  position: absolute;
  right: -6px;
  top: 86px;
  z-index: 6;
  width: min(48vw, 210px);
  aspect-ratio: 1 / 1;
  border: var(--border-size) solid var(--text);
  border-radius: 34% 46% 34% 46%;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(255, 45, 111, 0.72), rgba(20, 0, 12, 0.92));
  box-shadow:
    var(--shadow-lg),
    0 0 0 6px rgba(255, 45, 111, 0.2),
    0 0 30px rgba(255, 45, 111, 0.38);
  opacity: 0;
  transform: translateX(28px) scale(0.72) rotate(4deg);
  overflow: hidden;
}

.reaction-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  display: block;
  transform: scale(1.82);
  transform-origin: 50% 18%;
}

.reaction-burst.reaction-in {
  animation: reactionPop 1.08s var(--ease-bounce);
}

.reaction-burst.face-bikkuri,
.reaction-burst.face-utagai {
  right: auto;
  left: -6px;
  transform: translateX(-28px) scale(0.72) rotate(-4deg);
}

.match-cutin {
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 9;
  width: min(80%, 320px);
  padding: 12px 16px 13px;
  border: var(--border-size) solid var(--text);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.99);
  color: var(--text);
  box-shadow:
    var(--shadow-lg),
    0 0 0 6px rgba(255, 255, 255, 0.18),
    0 0 34px rgba(255, 45, 111, 0.28);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72) rotate(-2deg);
  text-align: center;
}

.match-cutin-kicker,
.match-cutin-copy {
  display: block;
}

.match-cutin-kicker {
  margin-bottom: 3px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: rgba(26, 26, 26, 0.58);
}

.match-cutin-title {
  display: block;
  font-family: var(--font-en);
  font-size: clamp(1.55rem, 8vw, 2.45rem);
  line-height: 0.95;
  color: var(--pink-deep);
  text-shadow: 2px 2px 0 rgba(255, 230, 0, 0.64);
}

.match-cutin-copy {
  margin-top: 5px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(26, 26, 26, 0.72);
}

.match-cutin.cutin-in {
  animation: cutinPunch 1.08s var(--ease-bounce);
}

.bust-cutin {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.08);
  background:
    repeating-linear-gradient(-18deg, rgba(255, 38, 68, 0.34) 0 14px, rgba(0, 0, 0, 0.1) 14px 28px),
    radial-gradient(circle at 52% 38%, rgba(255, 38, 68, 0.42), rgba(30, 0, 12, 0.82) 58%, rgba(10, 0, 6, 0.92));
  pointer-events: none;
}

.bust-cutin-img {
  position: absolute;
  right: -34px;
  bottom: -56px;
  width: min(72vw, 340px);
  filter:
    drop-shadow(-16px 18px 0 rgba(0, 0, 0, 0.26))
    drop-shadow(0 0 26px rgba(255, 45, 111, 0.34));
}

.bust-cutin-copy {
  position: relative;
  z-index: 1;
  width: min(88%, 360px);
  padding: 18px 18px 16px;
  border: var(--border-size) solid #FFF0D2;
  border-radius: 24px;
  background: rgba(20, 0, 9, 0.78);
  color: var(--white);
  text-align: center;
  box-shadow:
    var(--shadow-lg),
    0 0 0 6px rgba(255, 38, 68, 0.28),
    0 0 44px rgba(255, 38, 68, 0.58);
  transform: rotate(-2deg);
}

.bust-cutin-kicker,
.bust-cutin-line {
  display: block;
}

.bust-cutin-kicker {
  margin-bottom: 4px;
  color: #FFD14F;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
}

.bust-cutin-title {
  display: block;
  font-family: var(--font-jp);
  font-size: clamp(2.3rem, 12vw, 4.2rem);
  line-height: 0.98;
  color: #FF435D;
  text-shadow:
    2px 2px 0 #000,
    0 0 18px rgba(255, 38, 68, 0.75);
}

.bust-cutin-line {
  margin-top: 7px;
  color: rgba(255, 240, 246, 0.9);
  font-size: 0.8rem;
}

.bust-cutin.bust-cutin-in {
  animation: bustCutin 1.08s var(--ease-bounce);
}

.act-banner {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 45, 111, 0.24), transparent 48%),
    rgba(10, 0, 8, 0.55);
  pointer-events: none;
}

.act-banner-card {
  position: relative;
  width: min(82%, 340px);
  overflow: hidden;
  padding: 17px 18px 15px;
  border: 3px solid var(--text);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 60, 132, 0.92), rgba(132, 12, 61, 0.95)),
    #FF2D6F;
  box-shadow:
    0 18px 0 rgba(0, 0, 0, 0.36),
    0 0 0 6px rgba(255, 45, 111, 0.25),
    0 0 34px rgba(255, 45, 111, 0.42);
  text-align: center;
}

.act-banner-card::before,
.act-banner-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.act-banner-card::before {
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
}

.act-banner-card::after {
  top: 0;
  left: -24%;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-16deg);
  opacity: 0;
}

.act-banner.act-banner-in .act-banner-card::after {
  animation: actBannerShine 0.76s var(--ease-out);
}

.act-banner[data-phase="last"] .act-banner-card {
  background:
    linear-gradient(135deg, rgba(52, 210, 235, 0.9), rgba(26, 42, 92, 0.95)),
    #38CFE7;
  box-shadow:
    0 18px 0 rgba(0, 0, 0, 0.36),
    0 0 0 6px rgba(56, 207, 231, 0.22),
    0 0 34px rgba(56, 207, 231, 0.36);
}

.act-banner[data-phase="final"] .act-banner-card {
  background:
    linear-gradient(135deg, rgba(255, 209, 79, 0.95), rgba(255, 67, 93, 0.95)),
    #FFD14F;
  box-shadow:
    0 18px 0 rgba(0, 0, 0, 0.36),
    0 0 0 6px rgba(255, 209, 79, 0.25),
    0 0 38px rgba(255, 209, 79, 0.44);
}

.act-banner-kicker,
.act-banner-title,
.act-banner-copy {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.act-banner-kicker {
  color: #FFD14F;
  font-family: var(--font-en);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-shadow: 1px 1px 0 #000;
}

.act-banner-title {
  margin-top: 3px;
  color: var(--white);
  font-size: clamp(1.85rem, 8vw, 2.75rem);
  line-height: 0.98;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow:
    3px 3px 0 #000,
    0 0 24px rgba(255, 45, 111, 0.7);
}

.act-banner-copy {
  margin-top: 8px;
  color: rgba(255, 249, 238, 0.92);
  font-size: 0.72rem;
  font-weight: 900;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.74);
}

.act-banner[data-phase="final"] .act-banner-kicker,
.act-banner[data-phase="final"] .act-banner-copy {
  color: #2B0A15;
  text-shadow: none;
}

.act-banner.act-banner-in {
  animation: actBanner 0.76s var(--ease-bounce);
}

.match-bust {
  background: #22070E;
  color: #FFE6EA;
  border-color: #FF435D;
  box-shadow:
    var(--shadow-lg),
    0 0 0 7px rgba(255, 67, 93, 0.24),
    0 0 34px rgba(255, 67, 93, 0.42);
}

.match-bust .match-cutin-title {
  color: #FF435D;
  text-shadow: 2px 2px 0 #000;
}

.match-bust .match-cutin-kicker,
.match-bust .match-cutin-copy {
  color: rgba(255, 230, 235, 0.82);
}

.match-counter {
  background: #EAF8FF;
  box-shadow:
    var(--shadow-lg),
    0 0 0 7px rgba(46, 196, 255, 0.26),
    0 0 34px rgba(46, 196, 255, 0.42);
}

.match-counter .match-cutin-title {
  color: #0078B5;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.match-freeze,
.match-cold {
  background: #F0FAFF;
  box-shadow:
    var(--shadow-lg),
    0 0 0 7px rgba(160, 230, 255, 0.24);
}

.match-toast .match-cutin-title,
.match-fake .match-cutin-title,
.match-chaser .match-cutin-title,
.match-watch .match-cutin-title {
  color: var(--pink-deep);
}

#app[data-tone="bust"] .impact-wash {
  animation: bustFlash 0.68s ease-out;
}

#app[data-tone="counter"] .impact-wash {
  animation: counterFlash 0.68s ease-out;
}

#app[data-tone="toast"] .impact-wash {
  animation: toastFlash 0.68s ease-out;
}

#app[data-tone="freeze"],
#app[data-tone="cold"] {
  filter: saturate(0.88);
}

#app[data-tone="freeze"] .impact-wash,
#app[data-tone="cold"] .impact-wash {
  animation: coldFlash 0.68s ease-out;
}

#app.impact-pulse .stage {
  animation: stageHit 0.28s ease-out;
}

#app[data-final="true"] .stage {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.06);
}

#app[data-final="true"] .table-area {
  animation: finalTablePulse 1.2s ease-in-out infinite;
}

#app[data-final="true"] .hand-title::after {
  content: " FINAL";
  margin-left: 7px;
  padding: 2px 7px 1px;
  border: 1.5px solid rgba(255, 209, 79, 0.9);
  border-radius: var(--pill);
  color: #FFD14F;
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

/* ── Act variants (simplified, single-color shift) ───────── */

#app[data-act="2"] .milk-stage {
  background: #30162A;
}

#app[data-act="2"] .table-area {
  background: #7A4624;
}

#app[data-act="3"] .milk-stage {
  background: #261030;
}

#app[data-act="3"] .vs-label {
  transform: scale(1.04);
}

#app[data-final="true"] .act-badge {
  background: linear-gradient(180deg, #FFD14F 0%, #FF8A00 100%);
  color: var(--text);
  animation: pulseGlow 0.8s ease-in-out infinite;
}

#app[data-final="true"] .milk-stage {
  background: #2A0F28;
}

/* ── Animations ──────────────────────────────────────────── */

@keyframes titleLogoPop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.84) rotate(-5deg);
  }
  62% {
    opacity: 1;
    transform: translateY(-5px) scale(1.04) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(-2deg);
  }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 209, 79, 0); }
  50%       { box-shadow: 0 0 16px rgba(255, 209, 79, 0.4); }
}

@keyframes lastOnePulse {
  0%, 100% { transform: none; }
  50%       { transform: translateY(-2px); }
}

@keyframes commitCardFly {
  0%   { opacity: 0; transform: translate(-50%, 44px) scale(0.68) rotate(-9deg); }
  24%  { opacity: 1; transform: translate(-50%, -20px) scale(1.08) rotate(3deg); }
  70%  { opacity: 1; transform: translate(-50%, -80px) scale(0.92) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -118px) scale(0.72) rotate(5deg); }
}

@keyframes chosenCard {
  0%   { transform: none; }
  42%  { transform: translateY(-12px) scale(1.08) rotate(-2deg); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes commitToast {
  0%   { opacity: 0; background: radial-gradient(circle at 50% 74%, rgba(255, 230, 90, 0), transparent 55%); }
  35%  { opacity: 0.9; background: radial-gradient(circle at 50% 74%, rgba(255, 230, 90, 0.46), transparent 56%); }
  100% { opacity: 0; background: radial-gradient(circle at 50% 38%, rgba(255, 230, 90, 0), transparent 62%); }
}

@keyframes commitFake {
  0%   { opacity: 0; background: repeating-linear-gradient(90deg, rgba(255, 45, 111, 0) 0 8px, transparent 8px 16px); }
  38%  { opacity: 0.62; background: repeating-linear-gradient(90deg, rgba(255, 45, 111, 0.22) 0 8px, rgba(130, 45, 255, 0.16) 8px 16px); }
  100% { opacity: 0; transform: translateX(12px); }
}

@keyframes commitWatch {
  0%   { opacity: 0; background: linear-gradient(90deg, transparent, rgba(46, 196, 255, 0), transparent); }
  38%  { opacity: 0.82; background: linear-gradient(90deg, transparent 8%, rgba(46, 196, 255, 0.38) 48%, transparent 88%); }
  100% { opacity: 0; transform: scaleX(1.4); }
}

@keyframes commitChaser {
  0%   { opacity: 0; background: radial-gradient(circle at 50% 74%, rgba(103, 213, 209, 0), transparent 44%); }
  42%  { opacity: 0.72; background: radial-gradient(circle at 50% 74%, rgba(103, 213, 209, 0.38), transparent 45%); }
  100% { opacity: 0; transform: scale(1.2); }
}

@keyframes reactionPop {
  0%   { opacity: 0; transform: translateX(28px) scale(0.62) rotate(6deg); }
  24%  { opacity: 1; transform: translateX(0) scale(1.06) rotate(-2deg); }
  70%  { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translateX(18px) scale(0.86) rotate(4deg); }
}

.reaction-burst.face-bikkuri.reaction-in,
.reaction-burst.face-utagai.reaction-in {
  animation-name: reactionPopLeft;
}

@keyframes reactionPopLeft {
  0%   { opacity: 0; transform: translateX(-28px) scale(0.62) rotate(-6deg); }
  24%  { opacity: 1; transform: translateX(0) scale(1.06) rotate(2deg); }
  70%  { opacity: 1; transform: translateX(0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translateX(-18px) scale(0.86) rotate(-4deg); }
}

@keyframes cutinPunch {
  0%   { opacity: 0; transform: translate(-50%, -46%) scale(0.68) rotate(-5deg); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); }
  72%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(0.92) rotate(2deg); }
}

@keyframes impactStageDim {
  0%, 100% { opacity: 0; }
  14%      { opacity: 1; }
  72%      { opacity: 1; }
}

@keyframes bustCutin {
  0%   { opacity: 0; transform: scale(1.16); }
  12%  { opacity: 1; transform: scale(1); }
  26%  { opacity: 1; transform: translateX(-7px) scale(1); }
  36%  { opacity: 1; transform: translateX(6px) scale(1); }
  66%  { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: scale(0.96); }
}

@keyframes actBanner {
  0%   { opacity: 0; transform: scale(0.92); }
  18%  { opacity: 1; transform: scale(1.03); }
  66%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.98); }
}

@keyframes actBannerShine {
  0%   { transform: translateX(0) skewX(-16deg); opacity: 0; }
  24%  { opacity: 1; }
  100% { transform: translateX(340%) skewX(-16deg); opacity: 0; }
}

@keyframes bustFlash {
  0%, 100% { opacity: 0; }
  20% { opacity: 0.86; background: repeating-linear-gradient(-18deg, rgba(255, 30, 55, 0.44) 0 12px, rgba(0,0,0,0.1) 12px 24px); }
  54% { opacity: 0.34; background: rgba(255, 30, 55, 0.36); }
}

@keyframes counterFlash {
  0%, 100% { opacity: 0; }
  30% { opacity: 0.82; background: linear-gradient(90deg, transparent 0%, rgba(46, 196, 255, 0.42) 50%, transparent 100%); }
}

@keyframes toastFlash {
  0%, 100% { opacity: 0; }
  30% { opacity: 0.74; background: radial-gradient(circle at 50% 50%, rgba(255, 225, 80, 0.54), transparent 58%); }
}

@keyframes coldFlash {
  0%, 100% { opacity: 0; }
  35% { opacity: 0.7; background: linear-gradient(180deg, rgba(210, 244, 255, 0.5), rgba(20, 58, 90, 0.2)); }
}

@keyframes stageHit {
  0%, 100% { transform: none; }
  36% { transform: translateY(-2px) scale(1.006); }
}

@keyframes finalTablePulse {
  0%, 100% { box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 230, 176, 0.15), inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
  50% { box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 209, 79, 0.24), 0 0 28px rgba(255, 209, 79, 0.3), inset 0 1px 0 rgba(255, 230, 176, 0.15), inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
}

@keyframes drunkWobble {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-1px) rotate(-0.3deg); }
  75% { transform: translateX(1px) rotate(0.3deg); }
}

@keyframes susScan {
  0%, 100% { transform: translateX(-12%); }
  50% { transform: translateX(12%); }
}

@keyframes moodFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes hudCritical {
  0%, 100% { transform: translateY(0); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
  50% { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.42), 0 0 12px rgba(255, 45, 111, 0.28); }
}

/* ── Hover (pointer devices only) ───────────────────────── */

@media (hover: hover) {
  .card-slot:not(:disabled):hover,
  .tab-btn:hover,
  .primary-btn:hover,
  .secondary-btn:hover {
    transform: translateY(-2px);
  }
}

/* ── Small height ────────────────────────────────────────── */

@media (max-height: 740px) {
  .intro-hero {
    height: min(52svh, 320px);
  }

  .intro-title-block {
    width: clamp(238px, 64vw, 380px);
    margin-bottom: -5px;
  }

  .stage {
    padding-top: 8px;
    grid-template-rows: minmax(0, 1.8fr) minmax(126px, 0.72fr);
    gap: 8px;
  }

  .milk-stage {
    padding-top: 6px;
    gap: 6px;
  }

  .character {
    width: clamp(160px, 52vw, 220px);
  }

  .hand {
    padding-top: 8px;
  }

  .hand-head {
    margin-bottom: 5px;
  }

  .card-text {
    padding: 2px 3px 4px;
  }

  .card-label {
    font-size: 0.58rem;
  }

  .card-hint {
    display: none;
  }
}

@media (max-height: 640px) {
  .hud {
    padding-block: 4px 5px;
  }

  .stage {
    padding-top: 6px;
    grid-template-rows: minmax(0, 1.45fr) minmax(118px, 0.85fr);
    gap: 6px;
  }

  .milk-stage {
    padding: 6px 8px 4px;
    gap: 4px;
  }

  .milk-overlays {
    grid-template-columns: minmax(0, 1fr) minmax(108px, 122px);
    gap: 5px;
  }

  .tell-bubble {
    padding: 7px 9px;
    font-size: 0.74rem;
    line-height: 1.32;
  }

  .tell-hint {
    gap: 5px;
    padding: 7px 8px;
  }

  .hint-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .hint-observation {
    display: none;
  }

  .hint-prediction {
    font-size: 0.7rem;
  }

  .character {
    width: clamp(130px, 46vw, 176px);
  }

  .milk-caption {
    margin-top: 0;
    padding: 4px 9px;
  }

  .table-area {
    padding: 8px 8px 7px;
    gap: 6px;
  }

  .flip-card {
    width: clamp(78px, 24vw, 104px);
  }

  .reveal-row {
    gap: 8px;
  }

  .reveal-side {
    gap: 4px;
  }

  .reveal-owner,
  .reveal-caption {
    font-size: 0.68rem;
  }

  .vs-label {
    min-width: 48px;
    padding: 7px 6px 6px;
    font-size: 1rem;
  }

  .sfx-text {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .hand {
    padding-top: 6px;
  }
}

/* ── Small width ─────────────────────────────────────────── */

@media (max-width: 390px) {
  .intro-title-block {
    width: clamp(236px, 72vw, 340px);
    margin-right: -10px;
  }

  .milk-overlays {
    grid-template-columns: minmax(0, 1fr) 130px;
  }

  .tell-bubble {
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .hint-observation {
    font-size: 0.62rem;
  }

  .hint-prediction {
    font-size: 0.78rem;
  }

  .flip-card {
    width: clamp(88px, 25vw, 116px);
  }

  .vs-label {
    min-width: 60px;
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .card-label {
    font-size: 0.58rem;
  }
}

@media (max-width: 340px) {
  .intro-title-block {
    width: min(72vw, 298px);
  }

  .intro-speech {
    padding: 6px 9px 5px;
    font-size: 0.68rem;
  }

  .milk-overlays {
    grid-template-columns: 1fr;
  }

  .tell-hint {
    justify-self: end;
    width: min(100%, 176px);
  }

  .card-label {
    font-size: 0.58rem;
  }
}

/* ── Large display framing ───────────────────────────────── */

@media (min-width: 520px) {
  #app {
    margin: 14px 0;
    height: min(calc(100svh - 28px), 900px);
    border: var(--border-size) solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 28px 48px rgba(0, 0, 0, 0.36);
  }
}

/* ── Reduced motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .screen,
  .gauge-fill,
  .flip-inner,
  .tell-bubble,
  .sfx-text,
  .toast,
  .impact-wash,
  .danger-vignette,
  .intro-title-logo,
  .commit-card,
  .reaction-burst,
  .match-cutin,
  .bust-cutin,
  .act-banner,
  .act-badge,
  .card-slot,
  .turn-dot,
  .hud-stat,
  .table-area,
  .primary-btn,
  .secondary-btn,
  .tab-btn {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
