@font-face {
  font-family: "Big Shoulders Display";
  src: url("assets/fonts/big-shoulders.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("assets/fonts/zen-kaku-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("assets/fonts/zen-kaku-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("assets/fonts/zen-kaku-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Yuji Syuku";
  src: url("assets/fonts/yuji-syuku-brush.woff2") format("woff2");
  font-display: block;
}

:root {
  --night: #1a1220;
  --night-2: #241a2e;
  --night-3: #2f2239;
  --aubergine: #3a2346;
  --plum: #5b3884;
  --plum-2: #7a55a5;
  --plum-3: #b596db;
  --amber: #e2ac4a;
  --amber-2: #c98a1e;
  --amber-glow: #ffd88a;
  --cream: #f4ecdc;
  --cream-2: #e8dcc4;
  --cream-3: #d6c6a8;
  --ink: #241b2e;
  --ink-2: #5b4d66;
  --indigo: #2152a6;
  --indigo-2: #86a9f0;
  --hanko: #c23a2b;
  --good: #7cc79a;
  --good-ink: #2f7a4f;
  --bad: #f08a80;
  --bad-ink: #b3261e;
  --text: #f3ecf7;
  --muted: #b9abc6;

  --f-fruity: #f0915c;
  --f-dry: #6fb0e0;
  --f-rich: #c98a3e;
  --f-sweet: #e59ac0;
  --f-bubbly: #4fc1b0;
  --f-funky: #9b72cf;
  --f-any: #d9c9a6;
  --t-service: #4a6fc2;
  --t-craft: #d4a93c;
  --t-status: #8a8290;
  --t-curse: #6a3a4a;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body:
    "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --brush: "Yuji Syuku", "Hiragino Mincho ProN", serif;

  --hud-h: 52px;
  --cw: 150px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
img {
  display: block;
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.sprites {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.i {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(122, 85, 165, 0.25),
      transparent 60%
    ),
    var(--night);
  user-select: none;
  -webkit-user-select: none;
}
.screen {
  position: absolute;
  inset: 0;
}
.app[data-screen="map"] .screen.map-screen,
.app[data-screen="visit"] .screen.visit-screen,
.app[data-screen="stop"] .screen.stop-screen {
  top: var(--hud-h);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.55em 1.3em;
  border: 1.5px solid rgba(243, 236, 247, 0.28);
  border-radius: 999px;
  background: rgba(26, 18, 32, 0.55);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 0.15s var(--ease-out),
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.btn:hover:not(:disabled) {
  background: rgba(122, 85, 165, 0.35);
  border-color: rgba(243, 236, 247, 0.55);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}
.btn.primary {
  background: linear-gradient(180deg, #f0bd5c, var(--amber-2));
  border-color: #ffd88a;
  color: #2a1a08;
  box-shadow:
    0 6px 22px rgba(226, 172, 74, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffcf70, #d99a2c);
  box-shadow:
    0 8px 28px rgba(226, 172, 74, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn.big {
  font-size: 1.15rem;
  min-height: 54px;
  padding: 0.6em 1.8em;
}
.btn.ghost {
  background: transparent;
}
.btn:disabled {
  opacity: 0.45;
}
.btn.small {
  min-height: 36px;
  padding: 0.3em 0.9em;
  font-size: 0.9rem;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.end {
  justify-content: flex-end;
}
.row.center {
  justify-content: center;
}

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  inset: 0 0 auto;
  height: var(--hud-h);
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0
    max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #2a1c34, #1d1425);
  border-bottom: 1px solid rgba(226, 172, 74, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.hud-right {
  justify-content: flex-end;
  gap: 8px;
}
.hud-stamina,
.hud-money {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hud-stamina {
  color: #ff8f8f;
}
.hud-stamina .v,
.hud-money .v {
  color: var(--text);
}
.hud-money {
  color: var(--amber);
}
.hud-mid {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.hud-hour {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--amber);
}
.hud-act {
  font-family: var(--brush);
  font-size: 1.15rem;
}
.hud-gear {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.hud-gear::-webkit-scrollbar {
  display: none;
}
.gear-icon {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 1px;
  border: 0;
  background: none;
  border-radius: 8px;
  position: relative;
}
.gear-icon img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.gear-icon.pulse {
  animation: gearPulse 0.6s var(--ease-back);
}
.gear-icon.spent img {
  filter: grayscale(1) opacity(0.5);
}
@keyframes gearPulse {
  40% {
    transform: scale(1.35);
    filter: drop-shadow(0 0 10px var(--amber-glow));
  }
}
.hud-snacks {
  display: flex;
  gap: 4px;
  padding: 0 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.snack-slot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px;
}
.snack-slot.full {
  border-style: solid;
  border-color: rgba(226, 172, 74, 0.5);
  background: rgba(226, 172, 74, 0.12);
}
.snack-slot.full:hover {
  background: rgba(226, 172, 74, 0.3);
}
.snack-slot img {
  width: 100%;
  height: 100%;
}
.snack-slot.armed {
  box-shadow: 0 0 0 3px var(--amber);
}
.hud-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
}
.hud-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- title ---------- */

.title-screen {
  display: grid;
  align-items: center;
}
.keyart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
  animation: kenburns 40s ease-in-out infinite alternate;
}
@keyframes kenburns {
  to {
    transform: scale(1.08) translate(-1.5%, 1%);
  }
}
.title-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(26, 18, 32, 0.92) 0%,
      rgba(26, 18, 32, 0.65) 38%,
      rgba(26, 18, 32, 0) 70%
    ),
    linear-gradient(0deg, rgba(26, 18, 32, 0.8), transparent 35%);
  pointer-events: none;
}
.title-inner {
  position: relative;
  z-index: 2;
  padding: 0 clamp(24px, 7vw, 110px);
  max-width: 760px;
}
.kicker {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 0.95rem;
}
.logo {
  position: relative;
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.035em;
  font-size: clamp(3.4rem, 10vw, 7.2rem);
  color: var(--cream);
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.6);
}
.logo span {
  display: block;
}
.logo-a {
  animation: logoIn 0.9s var(--ease-out) both;
}
.logo-b {
  padding-left: 0.55em;
  animation: logoIn 0.9s 0.12s var(--ease-out) both;
}
.logo-seal {
  position: absolute !important;
  right: -0.4em;
  top: 0.05em;
  writing-mode: vertical-rl;
  font-size: 0.34em;
  line-height: 1;
  padding: 0.25em 0.14em;
  color: #fff4ea;
  background: var(--hanko);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(0, 0, 0, 0.4);
  transform: rotate(6deg);
  animation: stampIn 0.5s 0.7s var(--ease-back) both;
}
@keyframes logoIn {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
}
@keyframes stampIn {
  from {
    opacity: 0;
    transform: scale(2.2) rotate(-10deg);
  }
}
.tagline {
  margin: 22px 0 26px;
  font-size: 1.15rem;
  color: #e8ddef;
  max-width: 34em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
#continueBtn {
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}
#continueBtn small {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.8;
}
.menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.menu .btn.ghost {
  min-height: 40px;
  padding-left: 0.2em;
  border-color: transparent;
  color: #e5d8ee;
}
.menu .btn.ghost:hover {
  border-color: transparent;
  background: none;
  color: var(--amber-glow);
}
.best {
  margin-top: 18px;
  font-size: 0.92rem;
  color: var(--muted);
}
.home {
  position: absolute;
  z-index: 3;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.home:hover {
  color: var(--text);
}
.loading {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- brewery choice ---------- */

.kura-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: max(24px, 5vh) 16px 20px;
  overflow-y: auto;
  background:
    radial-gradient(
      ellipse at 50% 30%,
      rgba(91, 56, 132, 0.45),
      transparent 70%
    ),
    var(--night);
}
.kura-head {
  text-align: center;
}
.kura-head h2,
.stop-title {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}
.kura-head p {
  margin: 6px 0 0;
  color: var(--muted);
}
.kura-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 300px));
  gap: 20px;
}
.kura {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: var(--night-2);
  overflow: hidden;
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s,
    box-shadow 0.25s;
}
.kura:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 172, 74, 0.5);
}
.kura[aria-checked="true"] {
  border-color: var(--amber);
  box-shadow:
    0 0 0 3px rgba(226, 172, 74, 0.25),
    0 18px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-6px);
}
.kura-art {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.kura-seal {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-family: var(--brush);
  font-size: 2rem;
  color: #fff4ea;
  background: var(--hanko);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: rotate(4deg);
}
.kura-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kura-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.kura-blurb {
  margin: 0;
  color: #dccfe6;
  font-size: 0.95rem;
}
.kura-kit {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.kura-kit img {
  width: 40px;
  height: 40px;
}
.kura-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.nights {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.nights button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 210px;
  padding: 9px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}
.nights button span {
  font-size: 0.82rem;
  color: var(--muted);
}
.nights button[aria-checked="true"] {
  border-color: var(--amber);
  background: rgba(226, 172, 74, 0.12);
}
.asc {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.asc-label {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.asc-steps {
  display: flex;
  gap: 4px;
}
.asc-steps button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  font-family: var(--display);
  font-weight: 800;
}
.asc-steps button[aria-checked="true"] {
  background: var(--hanko);
  border-color: #ff9d8f;
}
.asc-steps button:disabled {
  opacity: 0.3;
}
.asc-desc {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 16em;
}

/* ---------- map ---------- */

.map-screen {
  background: #1b1322;
}
.map-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.map-scroll::-webkit-scrollbar {
  display: none;
}
.map-paper {
  position: relative;
  margin: 18px auto 40px;
  width: min(720px, calc(100% - 24px));
  border-radius: 6px;
  background:
    url("assets/scenes/washi.webp") center / 360px,
    var(--cream);
  color: var(--ink);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}
.map-paper::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px solid rgba(91, 56, 132, 0.35);
  border-radius: 3px;
  pointer-events: none;
}
.map-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 30px 0;
}
.map-kanji {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--brush);
  font-size: 2.4rem;
  color: #fff4ea;
  background: var(--hanko);
  border-radius: 12px;
  transform: rotate(-4deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.map-time {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--plum);
}
.map-name {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: 2.2rem;
  line-height: 1;
}
.map-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.map-path {
  fill: none;
  stroke: rgba(58, 35, 70, 0.4);
  stroke-width: 2.4;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.map-path.walked {
  stroke: var(--hanko);
  stroke-dasharray: none;
  stroke-width: 3.2;
  opacity: 0.8;
}
.map-path.open {
  stroke: rgba(91, 56, 132, 0.85);
  stroke-width: 3;
}
.stop-node {
  cursor: default;
}
.stop-node .ring {
  fill: #f7f0e1;
  stroke: rgba(58, 35, 70, 0.45);
  stroke-width: 2;
  transition: all 0.2s;
}
.stop-node use {
  color: var(--ink);
  transition: color 0.2s;
}
.stop-node[data-type="elite"] use {
  color: #b3261e;
}
.stop-node[data-type="rest"] use {
  color: #2f7a4f;
}
.stop-node[data-type="shop"] use {
  color: #b07a14;
}
.stop-node[data-type="treasure"] use {
  color: #8a5a17;
}
.stop-node[data-type="event"] use {
  color: var(--plum);
}
.stop-node.past {
  opacity: 0.45;
}
.stop-node.done {
  opacity: 1;
}
.stop-node.done .ring {
  fill: #efe2c7;
}
.stop-node .hanko {
  fill: none;
  stroke: var(--hanko);
  stroke-width: 3.5;
  opacity: 0;
}
.stop-node.done .hanko {
  opacity: 0.85;
}
.stop-node.open {
  cursor: pointer;
}
.stop-node.open .ring {
  stroke: var(--plum);
  stroke-width: 3;
  animation: nodePulse 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.stop-node.open:hover .ring,
.stop-node.open:focus-visible .ring {
  fill: #fff;
  stroke: var(--amber-2);
  stroke-width: 4;
}
.stop-node:focus {
  outline: none;
}
@keyframes nodePulse {
  50% {
    transform: scale(1.12);
  }
}
.stop-node.here .ring {
  fill: #fff6d9;
  stroke: var(--hanko);
  stroke-width: 4;
}
.boss-node image {
  clip-path: circle(50%);
}
.boss-node .ring {
  fill: none;
  stroke: var(--hanko);
  stroke-width: 5;
}
.boss-label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--hanko);
}
.map-legend {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(26, 18, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
  backdrop-filter: blur(6px);
}
.map-legend .lg {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-legend svg {
  width: 22px;
  height: 22px;
  color: var(--cream);
}

/* ---------- a visit ---------- */

.visit-screen {
  overflow: hidden;
}
.visit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
  transform: scale(1.04);
}
.visit-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 18, 32, 0.35), transparent 30%),
    linear-gradient(
      0deg,
      rgba(20, 12, 26, 0.92) 0%,
      rgba(20, 12, 26, 0.55) 26%,
      transparent 48%
    );
  pointer-events: none;
}
.visit-screen.shake {
  animation: shake 0.35s linear;
}
@keyframes shake {
  20% {
    transform: translate(-6px, 3px);
  }
  40% {
    transform: translate(5px, -3px);
  }
  60% {
    transform: translate(-4px, 2px);
  }
  80% {
    transform: translate(3px, -1px);
  }
}

.guests {
  position: absolute;
  left: 0;
  right: 0;
  /* Room above for intent bubbles; the player's zone starts at 56%. */
  top: 58px;
  bottom: 44%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 44px);
  padding: 0 12px;
  pointer-events: none;
}
.guest {
  /* Scale with height too, so short laptop screens keep the row in view. */
  --gw: clamp(110px, min(16vw, 20vh), 210px);
  position: relative;
  width: var(--gw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  transition:
    transform 0.35s var(--ease-out),
    opacity 0.5s,
    filter 0.3s;
  animation: guestIn 0.6s var(--ease-out) both;
}
.guest[data-tier="boss"] {
  --gw: clamp(130px, min(20vw, 25vh), 260px);
}
@keyframes guestIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
}
.guest:focus {
  outline: none;
}
.guest.won,
.guest.left {
  pointer-events: none;
}
.guest.gone {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
}
.g-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  border-radius: 999px 999px 14px 14px;
  overflow: hidden;
  border: 3px solid rgba(244, 236, 220, 0.85);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  background: var(--night-3);
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    transform 0.25s var(--ease-out);
}
.guest[data-tier="elite"] .g-portrait {
  border-color: #e0b35c;
}
.guest[data-tier="boss"] .g-portrait {
  border-color: #ffcf70;
  box-shadow:
    0 0 0 4px rgba(194, 58, 43, 0.75),
    0 16px 40px rgba(0, 0, 0, 0.6);
}
.g-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: scale(1.025) translateY(-0.6%);
  }
}
.guest.targetable .g-portrait {
  border-color: var(--amber-glow);
}
.guest.targeted .g-portrait {
  border-color: var(--amber-glow);
  box-shadow:
    0 0 0 4px rgba(255, 216, 138, 0.6),
    0 0 40px rgba(255, 216, 138, 0.55),
    0 14px 30px rgba(0, 0, 0, 0.55);
  transform: translateY(-4px) scale(1.03);
}
.guest.hit .g-portrait {
  animation: hitGlow 0.45s ease-out;
}
@keyframes hitGlow {
  30% {
    box-shadow:
      0 0 0 5px rgba(255, 216, 138, 0.8),
      0 0 50px rgba(255, 216, 138, 0.8);
    transform: scale(1.04);
  }
}
.guest.acting {
  transform: translateY(18px) scale(1.06);
  z-index: 3;
}
.guest.won .g-portrait {
  border-color: var(--amber-glow);
  box-shadow: 0 0 60px rgba(255, 216, 138, 0.8);
}
.g-won {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.g-won span {
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px solid var(--hanko);
  color: var(--hanko);
  background: rgba(255, 248, 236, 0.85);
  font-family: var(--brush);
  font-size: calc(var(--gw) * 0.28);
  line-height: 1;
  transform: rotate(-12deg);
  animation: stampIn 0.45s var(--ease-back) both;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.g-name {
  margin-top: -2px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.g-traits {
  display: flex;
  gap: 4px;
  margin-top: -2px;
}
.trait {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(194, 58, 43, 0.9);
  color: #fff4ea;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.g-bar {
  position: relative;
  width: 100%;
  height: 20px;
  border-radius: 999px;
  background: rgba(20, 12, 26, 0.85);
  border: 1.5px solid rgba(244, 236, 220, 0.5);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.g-fill,
.g-ghost {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--pct, 0) * 100%);
  border-radius: 999px;
  transition: width 0.5s var(--ease-out);
}
.g-ghost {
  background: rgba(255, 255, 255, 0.55);
  transition-delay: 0s;
}
.g-fill {
  background: linear-gradient(90deg, #d98a3a, #ffc86a 70%, #fff0c4);
  box-shadow: 0 0 12px rgba(255, 200, 106, 0.6);
  transition-delay: 0.15s;
}
.g-finish {
  position: absolute;
  inset: 0 auto 0 0;
  left: calc(var(--pct, 0) * 100%);
  width: calc(var(--fin, 0) * 100%);
  background: repeating-linear-gradient(
    -45deg,
    rgba(240, 145, 92, 0.65) 0 5px,
    rgba(240, 145, 92, 0.3) 5px 10px
  );
  transition: all 0.4s var(--ease-out);
}
.g-bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.g-reserve {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: #6c7a92;
  border: 2px solid #c9d4e6;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.g-barwrap {
  position: relative;
  width: 100%;
}
.g-loves {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.flav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px 1px 3px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--fc);
  color: #1c1222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.flav b {
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--brush);
  font-weight: 400;
  font-size: 0.95em;
}
.flav.hate {
  background: rgba(20, 12, 26, 0.8);
  color: var(--fc);
  border: 1.5px solid var(--fc);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.flav.hate b {
  background: transparent;
}
.flav.stale {
  background: rgba(20, 12, 26, 0.8);
  color: var(--fc);
  border: 1.5px dashed var(--fc);
}
[data-f="fruity"] {
  --fc: var(--f-fruity);
}
[data-f="dry"] {
  --fc: var(--f-dry);
}
[data-f="rich"] {
  --fc: var(--f-rich);
}
[data-f="sweet"] {
  --fc: var(--f-sweet);
}
[data-f="bubbly"] {
  --fc: var(--f-bubbly);
}
[data-f="funky"] {
  --fc: var(--f-funky);
}
[data-f="any"] {
  --fc: var(--f-any);
}
.g-status,
.me-status {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 24px;
}
.st {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px 0 5px;
  border-radius: 7px;
  background: rgba(20, 12, 26, 0.85);
  border: 1.5px solid var(--sc, #999);
  color: var(--sc, #fff);
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.st.pop {
  animation: pop 0.4s var(--ease-back);
}
@keyframes pop {
  40% {
    transform: scale(1.4);
  }
}
.st .glyph {
  font-family: var(--brush);
  font-weight: 400;
  font-size: 0.95rem;
}
.st[data-k="tipsy"] {
  --sc: #f5a7c4;
}
.st[data-k="curious"] {
  --sc: #86d0f0;
}
.st[data-k="finish"] {
  --sc: var(--f-fruity);
}
.st[data-k="picky"] {
  --sc: #ff8a7a;
}
.st[data-k="patience"] {
  --sc: #d9c9a6;
}
.st[data-k="warmth"] {
  --sc: #ffb05a;
}
.st[data-k="flustered"] {
  --sc: #d68ae0;
}
.st[data-k="frazzled"] {
  --sc: #a6a0b3;
}
.st[data-k="craft"] {
  --sc: var(--t-craft);
}
.st[data-k="buff"] {
  --sc: var(--good);
}

.intent {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.95);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  animation: intentIn 0.35s var(--ease-back) both;
  z-index: 2;
}
.intent::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
  z-index: -1;
}
@keyframes intentIn {
  from {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.7);
  }
}
.intent .ip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.intent .ip .i {
  width: 22px;
  height: 22px;
}
.intent .ip[data-k="demand"] {
  color: #c23a2b;
}
.intent .ip[data-k="reserve"] {
  color: #4f6386;
}
.intent .ip[data-k="picky"] {
  color: #c2562b;
}
.intent .ip[data-k="fluster"],
.intent .ip[data-k="frazzle"] {
  color: #8a4fa0;
}
.intent .ip[data-k="add"] {
  color: #6b5d73;
}
.intent .ip[data-k="summon"] {
  color: #2f7a4f;
}
.intent .ip[data-k="tipsy"] {
  color: #c2527e;
}
.intent .x {
  font-size: 0.85em;
  opacity: 0.8;
}
.intent-name {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  z-index: 4;
  animation: intentIn 0.3s var(--ease-back) both;
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 57%;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 20;
}
.banner span {
  padding: 10px 70px;
  font-family: var(--brush);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--cream);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(26, 18, 32, 0.92) 18%,
    rgba(26, 18, 32, 0.92) 82%,
    transparent
  );
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
  animation: bannerSweep 1.1s var(--ease-out) both;
}
.banner span.guestsTurn {
  color: #ffb3a8;
}
@keyframes bannerSweep {
  0% {
    opacity: 0;
    transform: translateX(-40px) scaleY(0.6);
  }
  20% {
    opacity: 1;
    transform: none;
  }
  75% {
    opacity: 1;
    transform: translateX(10px);
  }
  100% {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* player zone */

.player {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  pointer-events: none;
}
.player > * {
  pointer-events: auto;
}
.me {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(var(--cw) * 1.4 * 0.55 + 118px);
  width: min(300px, 26vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.me-bar {
  position: relative;
  height: 26px;
  border-radius: 999px;
  background: rgba(20, 12, 26, 0.9);
  border: 2px solid rgba(255, 179, 168, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.me-bar.low {
  animation: lowPulse 1.2s ease-in-out infinite;
}
@keyframes lowPulse {
  50% {
    box-shadow:
      0 0 0 4px rgba(255, 90, 80, 0.45),
      0 4px 14px rgba(0, 0, 0, 0.5);
  }
}
.me-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--pct, 1) * 100%);
  border-radius: 999px;
  background: linear-gradient(90deg, #a8303a, #e0605a 60%, #ff9d8f);
  transition: width 0.45s var(--ease-out);
}
.me-v {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.me-poise {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #7aa0d8;
  z-index: 2;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}
.me-poise .i {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.me-poise span {
  position: relative;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.me-poise.pop {
  animation: pop 0.4s var(--ease-back);
}
.me-status {
  justify-content: flex-start;
}

.cups {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(var(--cw) * 1.4 * 0.55 + 16px);
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}
.cup-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
  transition: filter 0.3s;
}
.cups.empty .cup-art {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55)) grayscale(0.7)
    brightness(0.7);
}
.cups-v {
  position: relative;
  margin-top: -8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.1rem;
  color: var(--ink);
  line-height: 1;
  -webkit-text-stroke: 5px #fffdf8;
  paint-order: stroke fill;
}
.cups.pop {
  animation: pop 0.45s var(--ease-back);
}
.cups.shake {
  animation: shake 0.3s linear;
}

.flight {
  position: absolute;
  left: 50%;
  bottom: calc(var(--cw) * 1.4 * 0.62 + 18px);
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: none;
  transition: opacity 0.3s;
}
.flight .fd {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--brush);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(20, 12, 26, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s var(--ease-back);
}
.flight .fd.on {
  color: #1c1222;
  background: var(--fc);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--fc);
}

.pile {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: calc(var(--cw) * 0.52);
  aspect-ratio: 5 / 7;
  border: 0;
  padding: 0;
  background: none;
}
.draw-pile {
  left: max(18px, env(safe-area-inset-left));
}
.discard-pile {
  right: max(18px, env(safe-area-inset-right));
}
.empty-pile {
  right: calc(max(18px, env(safe-area-inset-right)) + var(--cw) * 0.62);
  width: 38px;
  height: 38px;
  aspect-ratio: auto;
  bottom: max(20px, env(safe-area-inset-bottom));
  border-radius: 50%;
  background: rgba(20, 12, 26, 0.8);
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
}
.pile-back {
  position: absolute;
  inset: 0;
  border-radius: 8px;
}
.pile-back,
.card-back {
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 17%,
      #e9e1cf 18% 21%,
      transparent 22% 29%,
      #e9e1cf 30% 33%,
      transparent 34%
    ),
    radial-gradient(circle at 50% 50%, #2e4f9a, #1b2f63 70%);
  border: 3px solid #e9e1cf;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.5),
    3px 3px 0 -1px #1b2f63,
    3px 3px 0 1px #e9e1cf;
}
.discard-pile .pile-back {
  filter: saturate(0.3) brightness(0.8);
}
.pile-n {
  position: absolute;
  right: -8px;
  bottom: -6px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--night);
  border: 2px solid var(--cream);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
}
.empty-pile .pile-n {
  position: static;
  border: 0;
  background: none;
  min-width: 0;
  height: auto;
  color: var(--muted);
}
.pile.bump {
  animation: pop 0.3s var(--ease-back);
}

.end-turn {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(var(--cw) * 0.52 * 1.4 + 34px);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #fff4ea;
  background: radial-gradient(
    circle at 40% 35%,
    #e0584a,
    var(--hanko) 60%,
    #8c2218
  );
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.2),
    inset 0 0 0 7px rgba(140, 34, 24, 0.9),
    inset 0 0 0 9px rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.55);
  transition:
    transform 0.2s var(--ease-back),
    filter 0.2s;
}
.end-turn:hover:not(:disabled) {
  transform: scale(1.06) rotate(-4deg);
}
.end-turn:active:not(:disabled) {
  transform: scale(0.94);
}
.end-turn:disabled {
  filter: grayscale(0.8) brightness(0.6);
}
.end-turn.nudge {
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    box-shadow:
      inset 0 0 0 4px rgba(255, 255, 255, 0.2),
      inset 0 0 0 7px rgba(140, 34, 24, 0.9),
      inset 0 0 0 9px rgba(255, 255, 255, 0.18),
      0 0 0 8px rgba(226, 172, 74, 0.35),
      0 10px 24px rgba(0, 0, 0, 0.55);
  }
}
.end-kanji {
  font-family: var(--brush);
  font-size: 2.2rem;
  line-height: 1;
}
.end-label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  z-index: 10;
}
.hand .card {
  position: absolute;
  left: calc(var(--cw) / -2);
  bottom: calc(var(--cw) * -0.2);
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg))
    scale(var(--s, 1));
  transform-origin: 50% 100%;
  transition:
    transform 0.28s var(--ease-out),
    filter 0.2s,
    opacity 0.2s;
  z-index: var(--z, 1);
  touch-action: none;
}
.hand .card.hot {
  z-index: 60;
  transition-duration: 0.16s;
}
.hand .card.dragging {
  transition: none;
  z-index: 70;
}
.hand .card.unplayable {
  filter: saturate(0.55) brightness(0.72);
}
.hand .card.playable .c-frame {
  box-shadow:
    0 0 0 2px rgba(255, 216, 138, 0.85),
    0 0 18px rgba(255, 216, 138, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.55);
}
.hand .card.selected .c-frame {
  box-shadow:
    0 0 0 3px #fff3cf,
    0 0 30px rgba(255, 216, 138, 0.9),
    0 10px 24px rgba(0, 0, 0, 0.55);
}

.aim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
  overflow: visible;
}
.aim path {
  fill: none;
  stroke: var(--amber-glow);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 2 14;
  filter: drop-shadow(0 0 6px rgba(255, 216, 138, 0.9));
  animation: march 0.5s linear infinite;
}
.aim .head {
  fill: var(--amber-glow);
  filter: drop-shadow(0 0 8px rgba(255, 216, 138, 0.9));
}
@keyframes march {
  to {
    stroke-dashoffset: -16;
  }
}

.card-zoom {
  position: absolute;
  z-index: 85;
  left: 50%;
  bottom: calc(var(--cw) * 1.1 + 30px);
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  pointer-events: none;
}
.card-zoom .card {
  --cw: 230px;
}
.kw-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
}
.kw-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(20, 12, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.84rem;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.kw-item b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--amber);
}

.intro {
  position: absolute;
  inset: 0;
  z-index: 87;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 48px);
  padding: 20px;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(26, 18, 32, 0.75),
    rgba(12, 8, 16, 0.95)
  );
  animation: fadeIn 0.35s ease-out;
}
.intro.out {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.intro img {
  width: clamp(150px, 26vw, 300px);
  aspect-ratio: 5 / 6;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 999px 999px 18px 18px;
  border: 4px solid #ffcf70;
  box-shadow:
    0 0 0 6px rgba(194, 58, 43, 0.8),
    0 0 80px rgba(255, 207, 112, 0.35);
  animation: introPortrait 0.9s var(--ease-out) both;
}
.intro.elite img {
  border-color: #e0b35c;
  box-shadow: 0 0 60px rgba(224, 179, 92, 0.3);
}
.intro-text {
  max-width: 26em;
  animation: logoIn 0.8s 0.2s var(--ease-out) both;
}
.intro-kicker {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hanko);
}
.intro.elite .intro-kicker {
  color: var(--amber);
}
.intro h2 {
  margin: 4px 0 10px;
  font-family: var(--brush);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1;
}
.intro {
  cursor: pointer;
}
.intro-hint {
  margin: 16px 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeIn 0.6s 1.5s both;
}
.intro-bio {
  margin: 0;
  color: #e3d8ec;
  font-size: 1.05rem;
}
@keyframes introPortrait {
  from {
    opacity: 0;
    transform: scale(1.15);
    filter: blur(8px) brightness(2);
  }
}
@media (max-width: 640px) {
  .intro {
    flex-direction: column;
    text-align: center;
  }
}

.coach {
  position: absolute;
  z-index: 86;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  box-shadow:
    0 0 0 3px var(--amber),
    0 14px 34px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: coachIn 0.5s var(--ease-back) both;
}
.coach::after {
  content: "";
  position: absolute;
  left: calc(var(--ax, 50%) - 9px);
  width: 18px;
  height: 18px;
  background: var(--cream);
  box-shadow: 3px 3px 0 0 var(--amber);
  transform: rotate(45deg);
}
.coach.above::after {
  bottom: -9px;
}
.coach.below::after {
  top: -9px;
  box-shadow: -3px -3px 0 0 var(--amber);
}
@keyframes coachIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

/* ---------- cards ---------- */

.card {
  --fc: var(--f-any);
  position: relative;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  container-type: inline-size;
  flex: none;
  color: var(--ink);
  text-align: center;
}
.card[data-type="service"] {
  --fc: var(--t-service);
}
.card[data-type="craft"] {
  --fc: var(--t-craft);
}
.card[data-type="status"] {
  --fc: var(--t-status);
}
.card[data-rarity="curse"] {
  --fc: var(--t-curse);
}
.c-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 7cqw;
  padding: 3.2cqw;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.28), transparent 40%),
    var(--fc);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.2s;
}
.card[data-up] .c-frame {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 40%),
    linear-gradient(135deg, #fff1c1, var(--fc) 30%, var(--fc) 70%, #ffe39a);
}
.c-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 5cqw;
  overflow: hidden;
  background:
    url("assets/scenes/washi.webp") center / 140%,
    var(--cream);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.c-art {
  position: relative;
  height: 47%;
  flex: none;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  background: var(--night-3);
}
.c-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card[data-type="craft"] .c-art {
  border-radius: 0 0 50% 50% / 0 0 14% 14%;
}
.c-name {
  position: relative;
  margin: -6.5cqw 4cqw 0;
  padding: 1.5cqw 3cqw 1.3cqw;
  border-radius: 3cqw;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--display);
  font-weight: 800;
  font-size: 9.2cqw;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.card[data-up] .c-name {
  color: #ffe39a;
}
.card[data-rarity="uncommon"] .c-name {
  box-shadow:
    0 0 0 0.9cqw #9fc2e8,
    0 1cqw 3cqw rgba(0, 0, 0, 0.35);
}
.card[data-rarity="rare"] .c-name {
  box-shadow:
    0 0 0 0.9cqw #f0c64e,
    0 1cqw 3cqw rgba(0, 0, 0, 0.35);
  background: linear-gradient(110deg, #2a1d33 40%, #574021 50%, #2a1d33 60%) 0
    0 / 300% 100%;
  animation: sheen 3.5s linear infinite;
}
@keyframes sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
.c-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8cqw;
  margin: 2.2cqw 0 0;
  font-size: 5.6cqw;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1;
}
.c-seal {
  display: grid;
  place-items: center;
  width: 8.5cqw;
  height: 8.5cqw;
  border-radius: 50%;
  font-family: var(--brush);
  font-size: 5.6cqw;
  letter-spacing: 0;
  background: var(--fc);
  color: #1c1222;
}
.c-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5cqw;
  font-size: 7.4cqw;
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink);
}
.c-text p {
  margin: 0;
}
.c-text .num {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.28em;
  line-height: 1;
}
.c-text .num.up {
  color: var(--good-ink);
}
.c-text .num.down {
  color: var(--bad-ink);
}
.c-text .kw {
  font-weight: 700;
  color: var(--plum);
}
.c-bottle {
  margin: 0 3cqw 2.4cqw;
  padding-top: 1.6cqw;
  border-top: 1px solid rgba(36, 27, 46, 0.18);
  font-size: 4.4cqw;
  line-height: 1.2;
  font-style: italic;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-cost {
  position: absolute;
  left: -4cqw;
  top: -4cqw;
  width: 25cqw;
  height: 25cqw;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 900;
  font-size: 15cqw;
  line-height: 1;
  color: var(--ink);
  background: radial-gradient(
    circle,
    #fffdf8 26%,
    var(--indigo) 27% 33%,
    #fffdf8 34% 56%,
    var(--indigo) 57% 64%,
    #fffdf8 65%
  );
  box-shadow:
    0 1.5cqw 4cqw rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 2;
}
.c-cost span {
  display: grid;
  place-items: center;
  width: 12cqw;
  height: 12cqw;
  border-radius: 50%;
  background: #fffdf8;
}
.c-cost.cheaper {
  color: var(--good-ink);
}
.c-cost.pricier {
  color: var(--bad-ink);
}
.card[data-type="status"] .c-cost {
  display: none;
}
.card[data-type="status"][data-playable] .c-cost {
  display: grid;
}
.c-grow {
  position: absolute;
  right: 3cqw;
  top: 3cqw;
  padding: 0.6cqw 3cqw;
  border-radius: 999px;
  background: #3b2a12;
  color: #ffd88a;
  font-family: var(--display);
  font-weight: 800;
  font-size: 7cqw;
  z-index: 2;
}
.c-chill {
  position: absolute;
  right: 3cqw;
  top: 3cqw;
  width: 12cqw;
  height: 12cqw;
  border-radius: 50%;
  background: #cfe8ff;
  color: #1e4f8a;
  display: grid;
  place-items: center;
  font-size: 8cqw;
  z-index: 2;
}
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 7cqw;
}
.card.flip .c-frame,
.card.flip .c-cost {
  visibility: hidden;
}

/* flying cards during animation */
.flycard {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------- floating numbers and fx ---------- */

.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 88;
}
.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 89;
  overflow: hidden;
}
.float {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  color: #ffd88a;
  -webkit-text-stroke: 1.5px rgba(40, 20, 10, 0.8);
  paint-order: stroke fill;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  animation: floatUp 1.25s var(--ease-out) forwards;
}
.float small {
  display: block;
  font-size: 0.42em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
  color: #fff;
}
.float.big {
  font-size: 3.6rem;
}
.float.loved {
  color: #ffc2d8;
}
.float.meh {
  color: #c9c0d4;
  font-size: 2rem;
}
.float.hurt {
  color: #ff7a6e;
}
.float.poise {
  color: #a9c8ff;
  font-size: 2rem;
}
.float.heal {
  color: var(--good);
}
.float.note {
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  -webkit-text-stroke: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(20, 12, 26, 0.85);
}
.float.money {
  color: var(--amber);
}
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.15);
  }
  30% {
    transform: translate(-50%, -70%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -190%) scale(0.95);
  }
}
.bubble {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  max-width: 260px;
  padding: 9px 14px;
  border-radius: 14px;
  background: #fffaf0;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  animation: bubble 2.6s var(--ease-out) forwards;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}
@keyframes bubble {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.8);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -110%);
  }
}

/* ---------- stops ---------- */

.stop-screen.has-bg::before {
  content: "";
  position: fixed;
  inset: var(--hud-h) 0 0;
  background: var(--stop-bg) center / cover;
  filter: blur(14px) brightness(0.38) saturate(0.9);
  transform: scale(1.08);
  pointer-events: none;
}
.stop-screen > * {
  position: relative;
}
.panel.reward-panel {
  overflow: visible;
}
.rw-faces {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: -44px;
  padding: 0 16px;
}
.rw-face {
  position: relative;
  width: 88px;
  height: 88px;
  animation: dealIn 0.5s var(--ease-back) both;
}
.rw-face:nth-child(2) {
  animation-delay: 0.1s;
}
.rw-face:nth-child(3) {
  animation-delay: 0.2s;
}
.rw-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 50%;
  border: 3px solid var(--amber-glow);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
.rw-face b {
  position: absolute;
  right: -8px;
  bottom: -4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--hanko);
  background: #fff8ec;
  color: var(--hanko);
  font-family: var(--brush);
  font-weight: 400;
  font-size: 1.3rem;
  transform: rotate(-12deg);
  animation: stampIn 0.4s 0.5s var(--ease-back) both;
}
.stop-screen {
  overflow-y: auto;
  background:
    radial-gradient(
      ellipse at 50% 20%,
      rgba(91, 56, 132, 0.4),
      transparent 70%
    ),
    var(--night);
}
.stop-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 26px 16px 36px;
}
.panel {
  width: min(560px, 100%);
  border-radius: 20px;
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: panelIn 0.45s var(--ease-out) both;
}
@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
}
.panel-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.panel-art.square {
  aspect-ratio: 16 / 10;
}
.panel-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel h2 {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
}
.panel p {
  margin: 0;
  color: #e3d8ec;
}
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s;
}
.choice:hover:not(:disabled) {
  background: rgba(226, 172, 74, 0.14);
  border-color: rgba(226, 172, 74, 0.6);
  transform: translateX(3px);
}
.choice:disabled {
  opacity: 0.45;
}
.choice b {
  font-size: 1.05rem;
}
.choice span {
  font-size: 0.9rem;
  color: var(--muted);
}
.choice.done {
  opacity: 0.5;
  text-decoration: line-through;
}

.reward-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reward {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  animation: panelIn 0.4s var(--ease-out) both;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.reward:hover:not(:disabled) {
  background: rgba(226, 172, 74, 0.15);
  border-color: var(--amber);
}
.reward:disabled {
  opacity: 0.4;
}
.reward img,
.reward .ri {
  width: 44px;
  height: 44px;
  flex: none;
}
.reward .ri {
  display: grid;
  place-items: center;
  color: var(--amber);
}
.reward .ri svg {
  width: 36px;
  height: 36px;
}
.reward small {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}

.pick-cards {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.pick-cards .card {
  --cw: 190px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out);
  animation: dealIn 0.5s var(--ease-out) both;
}
.pick-cards .card:nth-child(2) {
  animation-delay: 0.08s;
}
.pick-cards .card:nth-child(3) {
  animation-delay: 0.16s;
}
.pick-cards .card:nth-child(4) {
  animation-delay: 0.24s;
}
@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(40px) rotate(-6deg) scale(0.9);
  }
}
.pick-cards .card:hover,
.pick-cards .card:focus-visible {
  transform: translateY(-10px) scale(1.04);
  outline: none;
}
.pick-cards .card:hover .c-frame,
.pick-cards .card:focus-visible .c-frame {
  box-shadow:
    0 0 0 3px var(--amber-glow),
    0 0 30px rgba(255, 216, 138, 0.6),
    0 14px 30px rgba(0, 0, 0, 0.55);
}

.shop {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: start;
}
.shop-side {
  position: sticky;
  top: 0;
}
.shop-side .panel-art {
  border-radius: 18px;
  aspect-ratio: 1;
}
.shop-side p {
  color: #e3d8ec;
}
.shop-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.shop-sec h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}
.shop-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 14px;
}
.ware {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: none;
  position: relative;
  transition: transform 0.2s var(--ease-out);
}
.ware:hover:not(:disabled) {
  transform: translateY(-6px);
}
.ware .card {
  --cw: 150px;
}
.ware:disabled {
  opacity: 0.35;
}
.ware.sold {
  visibility: hidden;
}
.price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(20, 12, 26, 0.85);
  border: 1.5px solid rgba(226, 172, 74, 0.6);
  color: var(--amber);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
}
.price.poor {
  color: #ff8f8f;
  border-color: rgba(255, 143, 143, 0.5);
}
.price .was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.85em;
}
.sale-tag {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--hanko);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.9rem;
  transform: rotate(8deg);
  z-index: 3;
}
.shop-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ware.item {
  width: 150px;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
.ware.item img {
  width: 64px;
  height: 64px;
}
.ware.item b {
  font-size: 0.95rem;
}
.ware.item small {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.rest-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rest-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  transition:
    transform 0.2s var(--ease-out),
    background 0.2s,
    border-color 0.2s;
}
.rest-choice:hover:not(:disabled) {
  transform: translateY(-3px);
  background: rgba(226, 172, 74, 0.14);
  border-color: var(--amber);
}
.rest-choice:disabled {
  opacity: 0.4;
}
.rest-choice .big-glyph {
  font-family: var(--brush);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--amber);
}
.rest-choice b {
  font-size: 1.1rem;
}
.rest-choice span {
  font-size: 0.88rem;
  color: var(--muted);
}

.event {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  animation: panelIn 0.5s var(--ease-out) both;
}
.event-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(244, 236, 220, 0.25);
}
.event-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.event-body h2 {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
}
.event-body p {
  margin: 0;
  font-size: 1.08rem;
  color: #eadff2;
}
.event-result {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(226, 172, 74, 0.1);
  border-left: 4px solid var(--amber);
  animation: panelIn 0.4s var(--ease-out) both;
}
.gained {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.gained .card {
  --cw: 120px;
}
.gained img {
  width: 56px;
  height: 56px;
}

.hour {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hour-kanji {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  font-family: var(--brush);
  font-size: 5.4rem;
  color: #fff4ea;
  background: var(--hanko);
  border-radius: 24px;
  transform: rotate(-4deg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: stampIn 0.6s var(--ease-back) both;
}
.hour-time {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  line-height: 1;
  animation: logoIn 0.7s 0.2s var(--ease-out) both;
}
.hour-name {
  margin: 0;
  font-family: var(--brush);
  font-size: 2.6rem;
  animation: logoIn 0.7s 0.35s var(--ease-out) both;
}
.hour p {
  color: var(--muted);
  max-width: 30em;
  animation: logoIn 0.7s 0.5s var(--ease-out) both;
}

.end-screen {
  width: min(900px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}
.end-art {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: panelIn 0.8s var(--ease-out) both;
}
.end-title {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.stat {
  padding: 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat b {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--amber);
}
.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}
.end-lineup-wrap {
  width: 100%;
}
.end-label {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}
.end-lineup {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 172, 74, 0.5) transparent;
}
.end-lineup .card {
  --cw: 104px;
}
.face-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.face-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber);
}

/* ---------- overlay ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 8, 16, 0.72);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.overlay-card {
  width: min(1100px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: panelIn 0.3s var(--ease-out) both;
  overflow: hidden;
}
.overlay-card.narrow {
  width: min(560px, 100%);
}
.overlay-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.overlay-head h2 {
  flex: 1;
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
}
.close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
}
.overlay-body {
  overflow-y: auto;
  padding: 18px;
}
.overlay-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.overlay-foot:empty {
  display: none;
}
.overlay-foot .hint {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.9rem;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 14px;
  justify-items: center;
}
.deck-grid .card {
  --cw: 150px;
}
.card.unseen {
  display: grid;
  place-items: center;
}
.card.unseen .card-back {
  opacity: 0.45;
  filter: saturate(0.4);
}
.card.unseen span {
  position: relative;
  font-family: var(--brush);
  font-size: 3rem;
  color: rgba(233, 225, 207, 0.6);
}
.deck-grid.pickable .card {
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}
.deck-grid.pickable .card:hover {
  transform: translateY(-6px);
}
.deck-grid .card.chosen .c-frame {
  box-shadow:
    0 0 0 4px var(--amber-glow),
    0 0 26px rgba(255, 216, 138, 0.7);
}
.compare {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.compare .card {
  --cw: 200px;
}
.compare .arrow {
  font-size: 2rem;
  color: var(--amber);
}
.prose {
  max-width: 44em;
  margin: 0 auto;
}
.prose h3 {
  margin: 20px 0 6px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.prose p,
.prose li {
  color: #e3d8ec;
}
.prose ul {
  padding-left: 1.2em;
}
.intent-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px 16px;
  margin: 10px 0;
  font-size: 0.9rem;
  color: #e3d8ec;
}
.intent-legend > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.intent-legend .ip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.95);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
}
.intent-legend .ip .i {
  width: 18px;
  height: 18px;
}
.intent-legend .ip[data-k="demand"] {
  color: #c23a2b;
}
.intent-legend .ip[data-k="reserve"] {
  color: #4f6386;
}
.intent-legend .ip[data-k="picky"] {
  color: #c2562b;
}
.intent-legend .ip[data-k="fluster"] {
  color: #8a4fa0;
}
.intent-legend .ip[data-k="add"] {
  color: #6b5d73;
}
.intent-legend .ip[data-k="summon"] {
  color: #2f7a4f;
}
.flav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 16px;
  margin: 10px 0;
}
.flav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #e3d8ec;
}
.flav-grid .flav {
  font-size: 0.9rem;
  padding: 4px 10px 4px 4px;
}
.book {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.book-entry {
  text-align: center;
  font-size: 0.85rem;
}
.book-entry img {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: 999px 999px 12px 12px;
  border: 2px solid rgba(244, 236, 220, 0.6);
}
.book-entry.unmet img {
  filter: brightness(0) opacity(0.35);
  border-color: rgba(255, 255, 255, 0.15);
}
.book-entry b {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.book-entry span {
  color: var(--muted);
}
.setting {
  display: grid;
  grid-template-columns: 9em 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.setting input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}
.setting input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--amber);
}

/* ---------- tooltip, toast, fade ---------- */

.tip {
  position: absolute;
  z-index: 99;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 12, 26, 0.97);
  border: 1px solid rgba(226, 172, 74, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  font-size: 0.88rem;
  line-height: 1.4;
  pointer-events: none;
}
.tip b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}
.tip-gap {
  display: block;
  height: 8px;
}
.tip .tip-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}
.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--hud-h) + 14px);
  transform: translate(-50%, -20px);
  z-index: 98;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s var(--ease-out);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.fade {
  position: absolute;
  inset: 0;
  z-index: 97;
  background: var(--night);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.fade.on {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- phones and small screens ---------- */

@media (max-width: 900px) {
  :root {
    --cw: 118px;
  }
  .kura-list {
    grid-template-columns: minmax(0, 420px);
  }
  .kura {
    flex-direction: row;
  }
  .kura-art {
    width: 38%;
    aspect-ratio: auto;
  }
  .kura-seal {
    right: auto;
    left: 10px;
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }
  .shop {
    grid-template-columns: 1fr;
  }
  .shop-side {
    position: static;
    display: flex;
    gap: 14px;
    align-items: center;
  }
  .shop-side .panel-art {
    width: 110px;
    flex: none;
  }
  .event {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .event-art {
    max-height: 34vh;
    aspect-ratio: 16 / 10;
  }
  .map-scroll {
    bottom: 54px;
  }
  .map-legend {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 54px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
    margin: 0;
    border-radius: 0;
    border-width: 1px 0 0;
    font-size: 0.78rem;
  }
  .map-legend svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 640px) {
  :root {
    --hud-h: 48px;
    --cw: 106px;
  }
  .hud {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 0 8px;
  }
  .hud-right {
    min-width: 0;
  }
  .hud-mid {
    display: none;
  }
  .hud-snacks {
    gap: 3px;
    padding: 0 4px;
    border: 0;
  }
  .snack-slot {
    width: 30px;
    height: 30px;
  }
  .snack-slot:not(.full) {
    display: none;
  }
  .hud-stamina,
  .hud-money {
    font-size: 1.15rem;
  }
  .hud-left {
    gap: 10px;
  }
  .gear-icon {
    width: 30px;
    height: 30px;
  }
  .hud-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 7px;
  }
  .title-screen {
    align-items: end;
  }
  .keyart {
    object-position: 70% 30%;
    height: 62%;
  }
  .title-screen::after {
    background: linear-gradient(
      0deg,
      var(--night) 42%,
      rgba(26, 18, 32, 0.4) 62%,
      transparent 80%
    );
  }
  .title-inner {
    padding: 0 22px 64px;
  }
  .tagline {
    margin: 14px 0 18px;
    font-size: 1rem;
  }
  .guests {
    top: 54px;
    bottom: 47%;
    gap: 6px;
    padding: 0 6px;
  }
  .guest {
    --gw: min(31vw, 150px);
    gap: 4px;
  }
  .guest[data-tier="boss"] {
    --gw: min(44vw, 190px);
  }
  .guests[data-n="1"] .guest {
    --gw: min(44vw, 180px);
  }
  .g-name {
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
  }
  .g-bar {
    height: 16px;
  }
  .g-bar span {
    font-size: 0.78rem;
  }
  .flav {
    font-size: 0.66rem;
    padding: 0 6px 0 2px;
  }
  .st {
    height: 20px;
    font-size: 0.8rem;
    padding: 0 5px 0 4px;
  }
  .intent {
    font-size: 1rem;
    padding: 3px 7px 3px 5px;
    top: -8px;
  }
  .intent .ip .i {
    width: 16px;
    height: 16px;
  }
  .me {
    left: 84px;
    right: 90px;
    width: auto;
    bottom: calc(var(--cw) * 1.4 * 0.86 + 20px);
  }
  .me-bar {
    height: 22px;
  }
  .me-poise {
    width: 34px;
    height: 38px;
    left: -12px;
  }
  .cups {
    left: 8px;
    bottom: calc(var(--cw) * 1.4 * 0.86 + 4px);
    width: 68px;
    height: 68px;
  }
  .cups-v {
    font-size: 1.45rem;
  }
  .end-turn {
    right: 8px;
    bottom: calc(var(--cw) * 1.4 * 0.86 + 2px);
    width: 74px;
    height: 74px;
  }
  .end-kanji {
    font-size: 1.5rem;
  }
  .end-label {
    font-size: 0.7rem;
  }
  .flight {
    bottom: calc(var(--cw) * 1.4 * 0.86 + 84px);
    left: auto;
    right: 8px;
    transform: none;
    gap: 2px;
  }
  .me {
    flex-direction: column-reverse;
  }
  .flight .fd {
    width: 18px;
    height: 18px;
    font-size: 0.66rem;
  }
  .pile {
    width: 34px;
    bottom: 8px;
  }
  .draw-pile {
    left: 8px;
  }
  .discard-pile {
    right: 8px;
  }
  .empty-pile {
    display: none;
  }
  .pile-n {
    min-width: 22px;
    height: 22px;
    font-size: 0.8rem;
    right: -6px;
  }
  .card-zoom {
    bottom: calc(var(--cw) * 1.4 * 0.6 + 12px);
  }
  .card-zoom .card {
    --cw: 190px;
  }
  .card-zoom .kw-list {
    display: none;
  }
  .banner span {
    padding: 8px 40px;
  }
  .pick-cards {
    gap: 10px;
  }
  .pick-cards .card {
    --cw: min(150px, 42vw);
  }
  .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .deck-grid .card {
    --cw: min(170px, 43vw);
  }
  .ware .card {
    --cw: min(170px, 43vw);
  }
  .ware.item {
    width: min(170px, 43vw);
  }
  .shop-cards,
  .shop-row {
    gap: 12px 8px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rest-choices {
    grid-template-columns: 1fr;
  }
  .overlay {
    padding: 0;
  }
  .overlay-card {
    max-height: 100dvh;
    height: 100%;
    border-radius: 0;
  }
  .compare .card {
    --cw: 140px;
  }
  .map-title {
    padding: 20px 20px 0;
  }
  .map-name {
    font-size: 1.8rem;
  }
}

@media (max-height: 560px) and (min-width: 641px) {
  :root {
    --cw: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.app.reduced *,
.app.reduced *::before,
.app.reduced *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}
