@font-face {
  font-family: "M PLUS 1p";
  src: url("../assets/fonts/MPLUS1p-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "M PLUS 1p";
  src: url("../assets/fonts/MPLUS1p-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f1ecf7;
  --muted: #a49ba9;
  --dark: #06040a;
  --panel: #120d1b;
  --panel-2: #1b1427;
  --felt: #241b33;
  --felt-deep: #160f21;
  --gold: #9e77b4;
  --gold-light: #c4a7d5;
  --red: #99406d;
  --red-bright: #c2578d;
  --ivory: #f6f1fb;
  --line: rgba(181, 153, 198, 0.27);
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

/* 日本語の折り返しは文節で切る。「アタリ／牌」のように語の途中で改行させない。
   ここで全体の既定にして、個別に keep-all を指定してある札はそのまま残す。 */
html {
  word-break: auto-phrase;
  line-break: strict;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 50% 18%, rgba(54, 48, 60, 0.26), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 5px),
    #070b0b;
  color: var(--ink);
  font-family: "M PLUS 1p", "Yu Gothic", sans-serif;
  overflow-x: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1600px);
  min-height: calc(100 * var(--shell-vh));
  margin: 0 auto;
  background: #0a100f;
  border-inline: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 55px #000;
}

.top-bar {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 9px 22px;
  border-top: 4px solid #672747;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #100f11;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  background: #703050;
  color: #ede1f3;
  font-family: serif;
  font-size: 26px;
  box-shadow: inset 0 0 0 3px #361c29;
}

.brand-kicker,
.brand h1 {
  margin: 0;
}

.brand-kicker {
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.17em;
}

.brand h1 {
  font-family: serif;
  font-size: 21px;
  letter-spacing: 0.16em;
}

.round-heading {
  min-width: 210px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding: 5px 18px;
  border-inline: 1px solid var(--line);
}

.round-heading span {
  color: var(--gold-light);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.round-heading strong {
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.action-bar button {
  min-height: 34px;
  padding: 5px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1e1c1f;
  color: #cfced0;
  font-size: 12px;
  font-weight: 700;
}

.icon-button:hover,
.action-bar button:not(:disabled):hover {
  border-color: var(--gold);
  color: white;
}

.game-frame {
  min-height: calc(calc(100 * var(--shell-vh)) - 74px);
  display: grid;
  grid-template-columns: minmax(240px, 25%) minmax(480px, 1fr) minmax(220px, 22%);
  grid-template-rows: minmax(510px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    #09100f;
  background-size: 14px 14px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 22px var(--shadow);
}

.character-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.nameplate {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #181619;
}

.nameplate small {
  display: block;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.nameplate h2 {
  margin: 2px 0 0;
  font-size: clamp(16px, calc(1.35 * var(--shell-vw)), 21px);
  letter-spacing: 0.08em;
}

.turn-lamp {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: #444146;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.025);
}

.turn-lamp.active {
  background: #b792cd;
  box-shadow: 0 0 12px rgba(183, 146, 205, 0.75);
}

.seat-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: serif;
  font-size: 18px;
}

.portrait-frame {
  min-height: 0;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(158, 119, 181, 0.14), transparent 35%),
    radial-gradient(circle at 50% 33%, #3c3840 0, #1e1b21 43%, #091411 100%);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 17px;
  border: 1px solid rgba(186, 159, 201, 0.13);
  pointer-events: none;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: contain;
  object-position: center bottom;
  /* 切り抜きに残る白いふちを、黒い影で縁取ると悪目立ちする。白い光で包む。 */
  filter:
    drop-shadow(0 0 3px rgba(255, 252, 255, 0.85))
    drop-shadow(0 0 10px rgba(255, 238, 252, 0.4));
}

.portrait-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 56%, rgba(3, 8, 7, 0.5) 76%, #07100e 100%);
  pointer-events: none;
}

.anna-line {
  min-height: 64px;
  position: absolute;
  inset: auto 12px 11px;
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(4, 10, 9, 0.84);
  font-size: clamp(12px, calc(1 * var(--shell-vw)), 15px);
  line-height: 1.65;
}

.condition-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.stage-pips {
  display: flex;
  gap: 5px;
}

.stage-pips i {
  width: 23px;
  height: 4px;
  background: #3a383c;
}

.stage-pips i.active {
  background: var(--red-bright);
}

.table-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 104px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #463f4c;
  background: var(--felt);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.36), 0 8px 22px var(--shadow);
}

.opponent-hand-wrap {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.17);
}

.hand-label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.56);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.hand-label b {
  width: max-content;
  padding: 3px 8px;
  background: #993e6c;
  color: white;
  font-family: "M PLUS 1p", sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.opponent-hand {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 3px;
}

.tile-back {
  width: clamp(25px, calc(3.1 * var(--shell-vw)), 39px);
  height: clamp(52px, calc(5.2 * var(--shell-vw)), 68px);
  flex: 0 1 39px;
  border: 1px solid #1a181b;
  border-radius: 3px 3px 2px 2px;
  background:
    linear-gradient(180deg, #9a6bb6 0 9%, #764891 10% 88%, #4b2e5c 89% 100%);
  box-shadow: inset 0 0 0 2px rgba(198, 161, 219, 0.28), 1px 2px 2px rgba(0, 0, 0, 0.5);
}

.felt-field {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  padding: 8px 14px 10px;
  background:
    repeating-linear-gradient(27deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 48%, rgba(79, 68, 91, 0.53), transparent 51%);
}

.river-zone {
  width: min(100%, 470px);
  align-self: stretch;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: center;
}

.river-label {
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.river {
  display: grid;
  grid-template-columns: repeat(8, minmax(20px, 36px));
  grid-auto-rows: 49px;
  justify-content: center;
  align-content: center;
  gap: 3px;
}

.center-console {
  display: grid;
  grid-template-columns: repeat(4, auto);
  align-items: stretch;
  border: 2px solid #1c191d;
  outline: 1px solid var(--gold);
  background: #141315;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.48);
}

.center-console > div {
  min-width: 58px;
  display: grid;
  place-items: center;
  padding: 5px 9px;
  border-right: 1px solid var(--line);
}

.center-console > div:last-child {
  border-right: 0;
}

.center-console small,
.center-console span {
  color: var(--muted);
  font-size: 8px;
}

.center-console strong {
  color: var(--gold-light);
  font-size: 18px;
}

.wind-box strong {
  font-family: serif;
  font-size: 24px;
}

.threat-box strong {
  font-size: 12px;
}

.threat-box.danger strong {
  color: #ed82b8;
}

.status-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.score-card {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.score-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.score-heading small {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.score-card > strong {
  display: block;
  margin-top: 1px;
  color: var(--gold-light);
  font-family: ui-monospace, monospace;
  font-size: clamp(22px, calc(2.1 * var(--shell-vw)), 32px);
  text-align: right;
  letter-spacing: 0.03em;
}

.opponent-score {
  border-top: 3px solid #80355b;
}

.player-score {
  border-left: 3px solid #574c62;
}

.seal-row,
.damage-marks {
  display: flex;
  gap: 6px;
}

/* 文字で説明せず、点ったかどうかだけを見せる。3つ点けば勝ち。 */
.seal-row i,
.damage-marks i {
  width: 11px;
  height: 11px;
  border: 1px solid #4e4b50;
  border-radius: 50%;
  background: #1e1c1f;
}



.seal-row i.filled {
  border-color: #9a72b1;
  background: #80375c;
  box-shadow: inset 0 0 0 2px #451f32;
}

.seal-row i.filled::after {
  color: #d9c0e7;
}

.damage-marks i {
  border-radius: 2px;
}

.damage-marks i::after {
  content: "×";
  color: #5b5360;
  font-size: 13px;
}

.damage-marks i.filled {
  border-color: #a9517d;
  background: #492135;
}

.damage-marks i.filled::after {
  color: #ee8abc;
}

.item-rack {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.section-title small {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 8px;
}

.item-buttons {
  display: grid;
  gap: 5px;
}

.item-button {
  width: 100%;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #1b191d;
  text-align: left;
}

.item-button:hover:not(:disabled) {
  border-color: var(--gold);
}

.item-button:disabled {
  opacity: 0.45;
}

.item-symbol {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #574562;
  background: #1e1921;
  color: var(--gold-light);
  font-family: serif;
  font-size: 17px;
}

.item-button strong,
.item-button small {
  display: block;
}

.item-button strong {
  font-size: 10px;
}

.item-button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-state {
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 8px;
}

.log-card {
  min-height: 116px;
  flex: 1;
  padding: 10px 12px;
  overflow: hidden;
}

.log-card ol {
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.log-card li {
  padding: 5px 0 5px 11px;
  border-left: 1px solid #403e43;
  color: #b5aeb9;
  font-size: 9px;
  line-height: 1.45;
}

.log-card li:first-child {
  border-left-color: var(--gold);
  color: white;
}

.log-card time {
  margin-right: 6px;
  color: #6e6474;
  font-family: ui-monospace, monospace;
}

.player-area {
  min-width: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(165px, 1fr) minmax(600px, auto) minmax(190px, 1fr);
  align-items: end;
  gap: 12px;
  padding: 11px 15px 13px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #151416;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.34);
}

.turn-status {
  align-self: stretch;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 3px 8px;
  padding: 6px 0;
}

.turn-status p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.hand-meta {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.hand-meta span {
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-hand {
  min-height: 82px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
}

.tile {
  height: calc(var(--tile-width) * 1.3334);
  width: clamp(38px, calc(4 * var(--shell-vw)), 54px);
  height: clamp(62px, calc(6.4 * var(--shell-vw)), 82px);
  flex: 0 1 54px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #afa9b2;
  border-bottom: 6px solid #896a9b;
  border-radius: 4px 4px 3px 3px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.7), transparent 34%),
    var(--ivory);
  color: #232125;
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.42);
  user-select: none;
}

button.tile:not(:disabled):hover {
  translate: 0 -5px;
  border-color: var(--gold);
}

.tile:disabled {
  cursor: default;
}

.tile.riichi-option {
  border-color: #b792cd;
  box-shadow: 0 0 0 2px #973f6b, 0 0 13px rgba(182, 141, 205, 0.55);
}

.tile.drawn {
  margin-left: 8px;
}

.tile-glyph {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", serif;
  font-size: clamp(27px, calc(3.2 * var(--shell-vw)), 44px);
  line-height: 1;
}

.mini-tile {
  width: 33px;
  height: 46px;
  border-bottom-width: 4px;
  border-radius: 2px;
  box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.34);
}

.mini-tile .tile-glyph {
  font-size: 26px;
}

.mini-tile.riichi-discard {
  rotate: 90deg;
  margin-inline: 7px;
}

.revealed-tile {
  width: clamp(25px, calc(3.1 * var(--shell-vw)), 39px);
  height: clamp(52px, calc(5.2 * var(--shell-vw)), 68px);
  flex-basis: 39px;
  border-bottom-width: 5px;
}

.revealed-tile .tile-glyph {
  font-size: clamp(22px, calc(2.4 * var(--shell-vw)), 31px);
}

.action-bar {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  gap: 7px;
}

.action-bar button:disabled {
  color: #605865;
  opacity: 0.55;
}

.action-bar .primary-action {
  border-color: #b75787;
  background: #783356;
  color: white;
  box-shadow: inset 0 0 0 2px #3d1d2d;
}

.action-bar .primary-action:not(:disabled):hover {
  border-color: #f4afd2;
}

.modal-layer {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 7, 7, 0.88);
}

.modal-card {
  width: min(930px, calc(94 * var(--shell-vw)));
  max-height: calc(92 * var(--shell-vh));
  position: relative;
  overflow: auto;
  border: 1px solid var(--gold);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #141316;
  box-shadow: 0 22px 80px #000, inset 0 0 0 5px #090e0d;
}

.title-card {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 34%, rgba(139, 104, 159, 0.18), transparent 33%),
    linear-gradient(115deg, #1a181c 0 59%, #1a1520 59%);
}

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

.title-card::before {
  inset: 14px;
  border: 1px solid rgba(185, 155, 202, 0.23);
}

.title-card::after {
  width: 220px;
  height: 220px;
  left: -80px;
  top: -90px;
  border: 30px solid rgba(153, 64, 109, 0.12);
  rotate: 45deg;
}

.eyebrow {
  margin: 0 0 19px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.28em;
}

.title-sub {
  margin: 22px 0 26px;
  color: #d7d6d8;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 32px;
}

.rule-chips span {
  padding: 5px 8px;
  border: 1px solid rgba(179, 148, 197, 0.28);
  background: rgba(0, 0, 0, 0.2);
  color: #c5bfc8;
  font-size: 9px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.title-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0 0 0 auto;
  object-fit: contain;
  object-position: 90% bottom;
  filter: drop-shadow(-16px 10px 9px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.large-button {
  min-width: 210px;
  padding: 13px 20px;
  border: 1px solid #bea0d0;
  background: #81375c;
  color: white;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  box-shadow: inset 0 0 0 3px #4b2136, 5px 5px 0 #050808;
}

.large-button:hover {
  background: #97466f;
}

.dialog-card {
  width: min(760px, calc(94 * var(--shell-vw)));
}

.dialog-header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
  font-size: clamp(14px, calc(1.05 * var(--shell-vw)), 18px);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.close-button {
  width: 31px;
  height: 31px;
  background: #262428;
  color: #cccacd;
}

#dialog-content {
  padding: 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 22px 22px;
}

.dialog-actions button {
  min-width: 125px;
  padding: 10px 17px;
  border: 1px solid var(--gold);
  background: #6b304e;
  font-size: clamp(15px, calc(1.05 * var(--shell-vw)), 18px);
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.dialog-actions button.secondary {
  border-color: rgba(255, 255, 255, 0.17);
  background: #201e22;
}

.item-select-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.item-select-intro h3,
.result-heading,
.story-copy h3 {
  margin: 0;
  font-family: serif;
  font-size: clamp(26px, calc(4 * var(--shell-vw)), 42px);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.item-select-intro p,
.story-copy p {
  margin: 8px 0 0;
  color: #bcb6c0;
  font-size: clamp(15px, calc(1.12 * var(--shell-vw)), 19px);
  line-height: 1.75;
}

.result-copy {
  margin: 8px 0 0;
  color: #dbd9dc;
  font-size: clamp(16px, calc(1.3 * var(--shell-vw)), 22px);
  line-height: 1.6;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.item-choice {
  min-height: 105px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a191c;
  text-align: left;
}

.item-choice:hover {
  border-color: var(--gold);
  background: #221f24;
}

.item-choice .item-symbol {
  width: 48px;
  height: 48px;
  font-size: 25px;
}

.item-choice strong,
.item-choice small {
  display: block;
}

.item-choice strong {
  margin-bottom: 4px;
  color: #e0d4e7;
  font-size: clamp(15px, calc(1.12 * var(--shell-vw)), 19px);
}

.item-choice small {
  color: var(--muted);
  font-size: clamp(13px, calc(0.95 * var(--shell-vw)), 16px);
  line-height: 1.55;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) 1fr;
  gap: 22px;
}

.result-mark {
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(157, 120, 179, 0.18), transparent 58%),
    #100f11;
  color: var(--gold-light);
  font-family: serif;
  font-size: 74px;
}

.result-mark.loss {
  color: #d06d9e;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 13px;
}

.result-score strong {
  color: var(--gold-light);
  font-size: 24px;
}

.yaku-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.yaku-list span {
  padding: 4px 7px;
  border: 1px solid rgba(187, 158, 203, 0.2);
  background: rgba(0, 0, 0, 0.22);
  color: #dad8db;
  font-size: 9px;
}

.story-layout {
  min-height: 370px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.2fr;
  gap: 22px;
}

.story-portrait {
  min-height: 340px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 35%, #403c45, #121114 68%);
}

.story-portrait img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: contain;
  object-position: center bottom;
}

.story-copy {
  align-self: center;
}

.story-dialogue {
  margin-top: 21px !important;
  padding: 15px;
  border-left: 3px solid var(--red-bright);
  background: rgba(0, 0, 0, 0.22);
  color: #efeef0 !important;
  font-size: 14px !important;
}

.rules-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-list li {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 10px;
  color: #d0ced1;
  font-size: clamp(14px, calc(1 * var(--shell-vw)), 17px);
  line-height: 1.65;
}

.rules-list b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}


@container shell (max-width: 1120px) {
  .game-frame {
    grid-template-columns: minmax(210px, 27%) 1fr;
    grid-template-rows: 500px auto auto;
  }

  .status-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr 2fr 2fr;
  }

  .status-panel > section {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .log-card {
    min-height: 96px;
  }

  .player-area {
    grid-row: 2;
  }

  .player-area {
    grid-template-columns: 145px minmax(560px, auto) 160px;
  }
}

@container shell (max-width: 860px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }

  .round-heading {
    display: none;
  }

  .game-frame {
    display: flex;
    flex-direction: column;
  }

  .character-panel {
    min-height: 380px;
  }

  .table-panel {
    min-height: 560px;
  }

  .portrait-frame img {
    object-position: 50% 19%;
  }

  .status-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .status-panel .item-rack,
  .status-panel .log-card,
  .status-panel .progress-card {
    grid-column: 1 / -1;
  }

  .player-area {
    order: 3;
    grid-template-columns: 1fr;
    align-items: center;
  }

  .turn-status {
    width: 100%;
  }

  .player-hand {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-top: 7px;
  }

  .tile {
    min-width: 44px;
  }

  .action-bar {
    width: min(100%, 420px);
  }

  .title-card {
    min-height: 580px;
    grid-template-columns: 1fr;
  }

  .title-card img {
    height: 70%;
    object-position: 85% top;
    opacity: 0.72;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }
}

@container shell (max-width: 560px) {
  .top-bar {
    min-height: 60px;
    padding-inline: 12px;
  }

  .brand-kicker,
  .top-actions #sound-button {
    display: none;
  }

  .brand-mon {
    width: 36px;
    height: 36px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .game-frame {
    padding: 5px;
    gap: 6px;
  }

  .character-panel {
    min-height: 330px;
  }

  .table-panel {
    min-height: 510px;
    grid-template-rows: 84px 1fr;
  }

  .center-console {
    grid-template-columns: repeat(3, auto);
  }

  .threat-box {
    display: none !important;
  }

  .center-console > div {
    min-width: 52px;
    padding-inline: 6px;
  }

  .river {
    grid-template-columns: repeat(7, 28px);
    grid-auto-rows: 42px;
  }

  .mini-tile {
    width: 28px;
    height: 39px;
  }

  .mini-tile .tile-glyph {
    font-size: 21px;
  }

  .status-panel {
    grid-template-columns: 1fr 1fr;
  }

  .score-card > strong {
    font-size: 20px;
  }

  .player-area {
    padding-inline: 8px;
  }

  .player-hand {
    min-height: 72px;
  }

  .tile {
    min-width: 38px;
    width: 38px;
    height: 64px;
  }

  .tile-glyph {
    font-size: 29px;
  }

  .modal-layer {
    padding: 8px;
  }

  .title-card {
    min-height: calc(94 * var(--shell-vh));
  }

  .story-layout,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .story-portrait {
    min-height: 270px;
  }

  .dialog-actions {
    flex-direction: column;
  }

  .dialog-actions button {
    width: 100%;
  }
}

/* ── KMG-01 arcade cabinet finish ───────────────────────────────────────── */

:root {
  --cabinet-red: #812d57;
  --cabinet-red-dark: #351324;
  --chrome: #a39ba8;
  --chrome-light: #ebeaec;
  --console-blue: #573377;
  --electric-cyan: #937da9;
}

body::before {
  content: "";
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.34));
  mix-blend-mode: multiply;
}

.app-shell {
  position: relative;
  border-inline: 4px solid #232224;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 8%, transparent 92%, rgba(255, 255, 255, 0.025)),
    #070d0c;
  box-shadow:
    0 0 0 1px #000,
    0 0 0 5px #2e1421,
    0 24px 90px #000;
}

.app-shell::before {
  content: "";
  height: 7px;
  position: absolute;
  z-index: 5;
  top: 0;
  inset-inline: 0;
  background: linear-gradient(90deg, #391226, #bc4782 18%, #631e41 50%, #bc4782 82%, #391226);
  box-shadow: 0 2px 0 #de78ab, 0 5px 12px #000;
}

.top-bar {
  min-height: 86px;
  padding: 14px 25px 10px;
  border-top: 0;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #464447, #e5dee9, #6c4a7f, #e5dee9, #464447) 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 12%, transparent 78%, rgba(0, 0, 0, 0.55)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
    #161417;
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, 0.36);
}

.brand-mon {
  width: 51px;
  height: 51px;
  border: 2px solid #b995ce;
  border-radius: 3px;
  background:
    radial-gradient(circle at 32% 22%, #c66395, transparent 28%),
    linear-gradient(145deg, #943766, #4a1932);
  font-size: 30px;
  text-shadow: 0 2px 0 #371225, 0 0 9px rgba(199, 163, 220, 0.35);
  box-shadow:
    inset 0 0 0 3px #280e1b,
    inset 0 0 0 4px #936ca9,
    0 4px 0 #050807,
    0 7px 16px rgba(0, 0, 0, 0.5);
}

.brand h1 {
  font-size: 24px;
  color: #f0e6f5;
  text-shadow: 0 2px 0 #46182f;
}

.round-heading {
  min-width: 300px;
  position: relative;
  align-items: center;
  padding: 7px 30px;
  border: 1px solid #5a4c63;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    #1a191b;
  box-shadow: inset 0 0 20px #000;
}

.round-heading small {
  color: #827a8b;
  font: 700 8px/1 ui-monospace, monospace;
  letter-spacing: 0.19em;
}

.round-heading span {
  color: #d9c1e7;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(196, 167, 213, 0.25);
}

.arcade-leds {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 6px;
}

.arcade-leds i {
  width: 8px;
  height: 8px;
  display: block;
  border: 1px solid #020303;
  border-radius: 50%;
  background: #937da9;
  box-shadow: inset 0 0 2px #fff, 0 0 7px rgba(147, 125, 169, 0.6);
}

.arcade-leds i:nth-child(2) {
  background: #a37abb;
  box-shadow: inset 0 0 2px #fff, 0 0 7px rgba(163, 122, 187, 0.55);
}

.arcade-leds i:nth-child(3) {
  background: #c55b90;
  box-shadow: inset 0 0 2px #fff, 0 0 7px rgba(197, 91, 144, 0.55);
}

.icon-button,
.action-bar button {
  border: 1px solid #7f7485;
  border-radius: 2px;
  background:
    linear-gradient(180deg, #3a383c 0 46%, #201e21 47% 100%);
  color: #eeecef;
  text-shadow: 0 1px 1px #000;
  box-shadow: inset 0 0 0 1px #151416, 0 3px 0 #080b0a;
}

.game-frame {
  min-height: calc(calc(100 * var(--shell-vh)) - 86px);
  grid-template-columns: minmax(265px, 25%) minmax(510px, 1fr) minmax(245px, 22%);
  grid-template-rows: minmax(540px, 1fr) auto;
  gap: 12px;
  padding: 13px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(128, 94, 148, 0.08) 50%, transparent 50.2%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 7px),
    #080e0d;
}

.panel,
.table-panel,
.player-area {
  position: relative;
  border: 2px solid #504955;
  outline: 1px solid #070909;
  box-shadow:
    inset 0 0 0 1px rgba(204, 187, 214, 0.15),
    0 9px 25px rgba(0, 0, 0, 0.55);
}

.panel::before,
.table-panel::before {
  content: "";
  width: 14px;
  height: 14px;
  position: absolute;
  z-index: 3;
  top: 5px;
  left: 5px;
  border: 1px solid #70597e;
  border-radius: 50%;
  background: radial-gradient(circle, #cbc3cf 0 18%, #6a6170 22% 48%, #1a191a 52%);
  box-shadow: 0 0 0 1px #080a09;
}

.nameplate {
  min-height: 72px;
  padding-inline: 29px 13px;
  border-bottom: 2px solid #655171;
  background:
    linear-gradient(120deg, rgba(149, 54, 102, 0.35), transparent 40%),
    linear-gradient(180deg, #2b292c, #141316);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.45);
}

.nameplate h2 {
  color: #fff8e7;
  text-shadow: 0 2px 0 #4e1a34;
}

.seat-mark {
  border: 2px solid #ae8ec1;
  border-radius: 50%;
  background: #59223e;
  box-shadow: inset 0 0 0 3px #200b16, 0 0 0 1px #0a0a09;
}

.portrait-frame {
  border: 8px solid #201e22;
  border-bottom-width: 5px;
  background:
    radial-gradient(circle at 50% 20%, rgba(114, 101, 126, 0.18), transparent 48%),
    #07100f;
  box-shadow:
    inset 0 0 0 2px #7a5f8a,
    inset 0 0 0 4px #040606;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 2px;
  pointer-events: none;
  border: 1px solid rgba(194, 165, 211, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 12%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.42), transparent 22%);
}

.portrait-frame img {
  filter: saturate(0.97) contrast(1.04);
}

.portrait-code,
.speech-tag {
  position: absolute;
  z-index: 4;
  padding: 4px 8px;
  font: 700 7px/1 ui-monospace, monospace;
  letter-spacing: 0.14em;
}

.portrait-code {
  top: 10px;
  left: 11px;
  border-left: 2px solid var(--electric-cyan);
  background: rgba(5, 17, 17, 0.78);
  color: #b6b0bc;
}

.speech-tag {
  left: 13px;
  bottom: 83px;
  border: 1px solid #7e658c;
  background: #5c223f;
  color: #d7bee6;
}

.anna-line {
  z-index: 4;
  inset-inline: 12px;
  bottom: 11px;
  min-height: 64px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #80668f;
  border-left: 4px solid #c3548c;
  background:
    linear-gradient(90deg, rgba(123, 39, 81, 0.2), transparent 55%),
    rgba(5, 12, 12, 0.93);
  color: #fff8e9;
  font-size: 12px;
  line-height: 1.65;
  text-shadow: 0 1px 2px #000;
  box-shadow: inset 0 0 18px #000, 0 4px 14px rgba(0, 0, 0, 0.5);
}

.condition-strip {
  border-top: 2px solid #594b61;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px),
    #151416;
}

.table-panel {
  border-color: #6d5a78;
  background: #121013;
}

.opponent-hand-wrap {
  border-bottom: 2px solid #695475;
  background:
    linear-gradient(180deg, #2a292b, #131214 70%),
    #19181a;
  box-shadow: inset 0 -11px 20px rgba(0, 0, 0, 0.52);
}

.felt-field {
  overflow: hidden;
  border: 8px solid #1a191c;
  background:
    radial-gradient(circle at center, rgba(80, 67, 93, 0.37), transparent 47%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #342840, #211a29 72%);
  box-shadow:
    inset 0 0 0 2px #6a5675,
    inset 0 0 45px rgba(0, 0, 0, 0.72);
}

.felt-field::before,
.felt-field::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(182, 153, 199, 0.16);
}

.felt-field::before {
  inset: 15px;
}

.felt-field::after {
  width: 310px;
  height: 310px;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  rotate: 45deg;
}

.table-signet {
  width: 90px;
  height: 90px;
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  translate: -50% -50%;
  border: 1px solid rgba(172, 137, 192, 0.28);
  rotate: 45deg;
  color: rgba(206, 182, 220, 0.26);
}

.table-signet > * {
  rotate: -45deg;
  grid-area: 1 / 1;
}

.table-signet strong {
  font: 38px/1 serif;
}

.table-signet span {
  translate: 0 -33px;
  font-size: 8px;
  letter-spacing: 0.2em;
}

.table-signet small {
  translate: 0 33px;
  font: 7px/1 ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.center-console {
  z-index: 2;
  padding: 5px;
  border: 2px solid #9171a4;
  outline: 3px solid #181719;
  background:
    linear-gradient(180deg, #2b2a2d, #0c1110);
  box-shadow: 0 7px 16px #001c16, inset 0 0 0 1px #d8d6d9;
}

.center-console::before,
.center-console::after {
  content: "";
  width: 7px;
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: repeating-linear-gradient(180deg, #836197 0 5px, #2d2034 5px 8px);
}

.center-console::before {
  left: -8px;
}

.center-console::after {
  right: -8px;
}

.center-console > div {
  border-color: #504d52;
  background: linear-gradient(180deg, #1c1a1e, #08110f);
}

.counter-box strong,
.score-card > strong {
  color: #eae2ef;
  font-family: ui-monospace, "M PLUS 1p", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  text-shadow: 0 0 7px rgba(147, 125, 169, 0.24);
}

.river-label {
  padding: 2px 7px;
  border-left: 2px solid #9c7ab0;
  background: rgba(18, 14, 22, 0.76);
  color: #cdc5d1;
  font: 700 8px/1.2 ui-monospace, monospace;
  letter-spacing: 0.13em;
}

.status-panel {
  border-color: #554d59;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    #141215;
}

.score-card {
  border-bottom: 2px solid #54485b;
  background:
    linear-gradient(100deg, rgba(125, 42, 84, 0.21), transparent 52%),
    linear-gradient(180deg, #272629, #141215);
}

.score-card > strong {
  padding: 2px 9px;
  border: 1px solid #403e43;
  background: #050b0a;
  box-shadow: inset 0 0 12px #000;
}

.progress-card,
.item-rack,
.log-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #141315;
}

.section-title {
  border-bottom: 1px solid #5c4c65;
  color: #c2a4d4;
  font-family: ui-monospace, "M PLUS 1p", monospace;
  letter-spacing: 0.12em;
}

.item-button {
  position: relative;
  overflow: hidden;
  border: 1px solid #4e4c50;
  border-left: 3px solid #775a88;
  background:
    linear-gradient(110deg, rgba(129, 45, 87, 0.18), transparent 48%),
    #161417;
  box-shadow: inset 0 0 0 1px #080c0b;
}

.item-button:not(:disabled):hover {
  border-color: #af8fc2;
  background:
    linear-gradient(110deg, rgba(166, 61, 114, 0.32), transparent 52%),
    #1d1b1f;
}

.player-area {
  grid-template-columns: minmax(180px, 0.8fr) minmax(610px, auto) minmax(265px, 1fr);
  padding: 13px 17px 16px;
  border-top-color: #7a6487;
  background:
    linear-gradient(180deg, rgba(131, 45, 88, 0.13), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.017) 0 1px, transparent 1px 5px),
    #151416;
}

.player-hand-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.turn-status {
  padding: 9px 11px;
  border: 1px solid #454347;
  border-left: 4px solid #7a5d8a;
  background: #0a1110;
  box-shadow: inset 0 0 16px #000;
}

.hand-meta span {
  border-color: #5a585d;
  background: #161417;
}

.meld-strip {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.opponent-melds {
  min-height: 47px;
  justify-content: flex-end;
  padding: 3px 10px 5px;
}

.player-melds {
  width: 100%;
  min-height: 0;
  justify-content: flex-end;
}

.player-melds:not(:empty) {
  min-height: 47px;
}

.meld-group {
  display: inline-flex;
  align-items: end;
  gap: 1px;
  padding: 2px 4px 3px;
  border: 1px solid #625868;
  border-bottom: 3px solid #2e2234;
  background: #09130f;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.45);
}

.meld-label {
  align-self: center;
  margin-right: 3px;
  color: #ae92be;
  font: 700 7px/1 ui-monospace, monospace;
  writing-mode: vertical-rl;
}

.tile,
.mini-tile,
.revealed-tile {
  border: 1px solid #c8bfcd;
  border-top-color: #fffef2;
  border-radius: 4px 4px 2px 2px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.85), transparent 14%),
    linear-gradient(180deg, #fffef0 0 80%, #cfc6d4 81% 100%);
  color: #131214;
  text-shadow: 0 1px 0 #fff;
  box-shadow:
    inset -3px 0 3px rgba(70, 59, 76, 0.16),
    inset 0 -4px 4px rgba(82, 69, 89, 0.12),
    0 4px 0 #765c85,
    0 6px 0 #32233b,
    0 8px 8px rgba(0, 0, 0, 0.42);
}

.tile:not(:disabled):hover {
  translate: 0 -5px;
  border-color: #e0ccec;
  box-shadow:
    inset -3px 0 3px rgba(70, 59, 76, 0.16),
    0 4px 0 #88629e,
    0 7px 15px rgba(0, 0, 0, 0.55),
    0 0 13px rgba(196, 167, 213, 0.35);
}

.tile.drawn {
  margin-left: 9px;
  border-color: #a076b9;
}

.tile.riichi-option {
  outline: 2px solid #a47abc;
  outline-offset: 2px;
  box-shadow:
    0 4px 0 #66417b,
    0 0 14px rgba(183, 141, 207, 0.72);
}

.tile-back {
  aspect-ratio: 3 / 4;
  height: auto;
  border: 1px solid #895da2;
  border-bottom: 5px solid #34223f;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 35%),
    repeating-linear-gradient(45deg, rgba(53, 31, 65, 0.22) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #9357b5, #6b3888);
  box-shadow: inset 0 0 0 3px #ae80c9, 0 5px 8px rgba(0, 0, 0, 0.45);
}

.meld-group .tile,
.meld-group .tile-back {
  translate: none;
}

.action-bar {
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid #504f52;
  background: #080e0d;
  box-shadow: inset 0 0 12px #000;
}

.action-bar button {
  min-height: 39px;
  position: relative;
  border-color: #716776;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.action-bar .primary-action {
  border-color: #d573a4;
  background:
    linear-gradient(180deg, #b85486 0 46%, #71284d 47% 100%);
  color: #fff8e6;
  box-shadow: inset 0 0 0 1px #3a1628, 0 3px 0 #270c1a, 0 0 11px rgba(194, 87, 141, 0.22);
}

#ankan-button:not(:disabled) {
  border-color: #9574a8;
  color: #d4b9e4;
}

.modal-layer {
  backdrop-filter: blur(4px) saturate(0.75);
  background: rgba(3, 7, 7, 0.9);
}

.modal-card {
  border: 2px solid #7a6387;
  outline: 6px solid #161518;
  background:
    linear-gradient(135deg, rgba(132, 45, 89, 0.16), transparent 38%),
    #161417;
  box-shadow:
    inset 0 0 0 1px rgba(225, 206, 236, 0.18),
    0 25px 90px #000;
}

.title-card {
  border-color: #9874ad;
  background:
    linear-gradient(90deg, #090e0d 0 42%, transparent 67%),
    radial-gradient(circle at 77% 34%, rgba(144, 50, 97, 0.23), transparent 37%),
    #141315;
}

.call-offer-head,
.shuffle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid #594a61;
}

.call-offer-head h3,
.shuffle-head h3 {
  margin: 0 0 4px;
  color: #e7d8f0;
}

.call-offer-head p,
.shuffle-head p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, calc(1 * var(--shell-vw)), 18px);
}

.call-choice-grid,
.kan-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
}

.call-choice,
.kan-choice {
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid #625569;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    #1a181c;
  color: #d8c2e4;
  box-shadow: inset 0 0 0 1px #080e0d;
}

.call-choice:hover,
.kan-choice:hover {
  border-color: #b18cc7;
  background-color: #222025;
}

.call-tiles {
  display: flex;
  gap: 2px;
}

.call-tile {
  width: 30px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #cbc2d1;
  border-bottom: 4px solid #6e557c;
  border-radius: 3px;
  background: #ede6f1;
  color: #131214;
  font-size: 24px;
}

.shuffle-tray {
  min-height: 88px;
  display: flex;
  align-items: end;
  gap: 4px;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid #605665;
  background:
    radial-gradient(circle at center, rgba(72, 60, 84, 0.38), transparent 55%),
    #18131e;
  box-shadow: inset 0 0 25px #000;
}

#shuffle-countdown {
  min-width: 58px;
  display: inline-block;
  color: #c59fdb;
  font: 700 38px/1 ui-monospace, monospace;
  text-align: center;
  text-shadow: 0 0 12px rgba(178, 128, 207, 0.48);
}

@container shell (max-width: 1120px) {
  .game-frame {
    grid-template-columns: minmax(220px, 27%) 1fr;
    grid-template-rows: 520px auto auto;
  }

  .player-area {
    grid-template-columns: 145px minmax(540px, auto) minmax(210px, 1fr);
  }
}

@container shell (max-width: 860px) {
  .top-bar {
    min-height: 72px;
  }

  .game-frame {
    min-height: calc(calc(100 * var(--shell-vh)) - 72px);
  }

  .player-area {
    grid-template-columns: 1fr;
  }

  .action-bar {
    width: min(100%, 560px);
    grid-template-columns: repeat(5, minmax(60px, 1fr));
  }

  .player-hand-stack {
    width: 100%;
  }
}

@container shell (max-width: 560px) {
  .app-shell {
    border-inline-width: 1px;
  }

  .arcade-leds {
    display: none;
  }

  .action-bar {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .portrait-code {
    display: none;
  }
}

/* ── MOBILE DUEL 16:9 / 2026 visual system ──────────────────────────────── */

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, #252129 0, #07100f 56%, #020504 100%);
}

.app-shell {
  width: min(calc(100 * var(--shell-vw)), calc(177.7778 * var(--shell-vh)));
  height: min(calc(100 * var(--shell-vh)), calc(56.25 * var(--shell-vw)));
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  box-shadow: 0 0 0 1px #2e2c2f, 0 24px 90px #000;
}

.app-shell::before {
  height: 3px;
}

.top-bar {
  height: 7.5%;
  min-height: 0;
  padding: 0.45% 1.25%;
  border-bottom: 1px solid rgba(178, 148, 196, 0.46);
  background:
    linear-gradient(90deg, rgba(126, 41, 84, 0.74), transparent 23%, transparent 76%, rgba(68, 51, 85, 0.2)),
    rgba(5, 12, 11, 0.96);
}

.brand {
  gap: calc(0.7 * var(--shell-vw));
}

.brand-mon {
  width: clamp(30px, calc(2.7 * var(--shell-vw)), 48px);
  height: clamp(30px, calc(2.7 * var(--shell-vw)), 48px);
  font-size: clamp(18px, calc(1.7 * var(--shell-vw)), 29px);
  box-shadow: inset 0 0 0 2px #230d18, 0 3px 10px #000;
}

.brand h1 {
  font-size: clamp(13px, calc(1.3 * var(--shell-vw)), 22px);
}

.brand-kicker {
  font-size: clamp(5px, calc(0.48 * var(--shell-vw)), 8px);
}

.round-heading {
  min-width: 0;
  padding: calc(0.35 * var(--shell-vw)) calc(2 * var(--shell-vw));
  border-color: rgba(162, 127, 182, 0.37);
  background: rgba(16, 14, 18, 0.78);
  box-shadow: inset 0 0 14px #000;
}

.round-heading span {
  font-size: clamp(12px, calc(1.2 * var(--shell-vw)), 20px);
}

.round-heading strong,
.round-heading small {
  font-size: clamp(6px, calc(0.55 * var(--shell-vw)), 10px);
}

.icon-button {
  min-height: 0;
  padding: calc(0.36 * var(--shell-vw)) calc(0.75 * var(--shell-vw));
  font-size: clamp(7px, calc(0.63 * var(--shell-vw)), 11px);
}

.game-frame {
  width: 100%;
  height: 92.5%;
  min-height: 0;
  position: relative;
  display: block;
  padding: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(78, 65, 91, 0.34), transparent 45%),
    linear-gradient(145deg, #071310, #040807);
}

.table-panel {
  position: absolute;
  z-index: 1;
  inset: 1.2% 10.5% 20.5%;
  display: grid;
  grid-template-rows: 18% 82%;
  overflow: hidden;
  border: 1px solid #685971;
  border-radius: calc(1.2 * var(--shell-vw));
  background: #06120f;
  box-shadow: 0 0 0 calc(0.35 * var(--shell-vw)) #171518, 0 calc(1 * var(--shell-vw)) calc(3 * var(--shell-vw)) #000;
}

.table-panel::before {
  display: none;
}

.opponent-hand-wrap {
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0 calc(0.7 * var(--shell-vw));
  padding: 0.35% 4% 0.4%;
  border: 0;
  background:
    linear-gradient(180deg, rgba(7, 13, 12, 0.98), rgba(19, 16, 22, 0.86));
}

.hand-label {
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
  padding: calc(0.35 * var(--shell-vw)) calc(0.6 * var(--shell-vw));
  border: 1px solid rgba(175, 143, 194, 0.42);
  border-left: 3px solid #b2427a;
  background: rgba(4, 8, 8, 0.8);
  font-size: clamp(7px, calc(0.62 * var(--shell-vw)), 11px);
}

.opponent-hand {
  min-width: 0;
  justify-content: center;
  gap: calc(0.15 * var(--shell-vw));
  overflow: hidden;
}

.opponent-melds {
  min-height: 0;
  justify-content: center;
  padding: 0;
}

.felt-field {
  border: 0;
  border-top: 1px solid rgba(176, 145, 194, 0.35);
  border-radius: 0 0 calc(1.1 * var(--shell-vw)) calc(1.1 * var(--shell-vw));
  background:
    radial-gradient(circle at 50% 46%, rgba(92, 77, 107, 0.24), transparent 35%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #32263e, #1f1827);
  box-shadow: inset 0 0 calc(4 * var(--shell-vw)) rgba(0, 0, 0, 0.62);
}

.felt-field::before {
  inset: 2.4%;
  border-color: rgba(207, 175, 225, 0.1);
  border-radius: calc(1 * var(--shell-vw));
}

.felt-field::after {
  width: 37%;
  height: 66%;
  opacity: 0.45;
}

.river-zone {
  z-index: 2;
}

.anna-river-zone {
  top: 7%;
}

.player-river-zone {
  bottom: 6%;
}

.river {
  grid-template-columns: repeat(9, minmax(18px, calc(2.05 * var(--shell-vw))));
  grid-auto-rows: minmax(26px, calc(2.9 * var(--shell-vw)));
  gap: calc(0.18 * var(--shell-vw));
}

.river-label {
  font-size: clamp(5px, calc(0.46 * var(--shell-vw)), 8px);
}

.center-console {
  width: auto;
  max-width: 39%;
  min-height: 0;
  grid-template-columns: repeat(4, minmax(calc(3.2 * var(--shell-vw)), auto));
  padding: calc(0.22 * var(--shell-vw));
  border-width: 1px;
  outline-width: calc(0.18 * var(--shell-vw));
  border-radius: calc(0.45 * var(--shell-vw));
  box-shadow: 0 calc(0.45 * var(--shell-vw)) calc(1 * var(--shell-vw)) rgba(0, 20, 16, 0.9), inset 0 0 0 1px #d8d6d9;
}

.center-console::before,
.center-console::after {
  display: none;
}

.center-console > div {
  min-width: 0;
  padding: calc(0.28 * var(--shell-vw)) calc(0.42 * var(--shell-vw));
}

.center-console small,
.center-console span,
.threat-box span {
  font-size: clamp(5px, calc(0.45 * var(--shell-vw)), 8px);
}

.center-console strong {
  font-size: clamp(10px, calc(1 * var(--shell-vw)), 17px);
}

.table-signet {
  width: min(calc(7 * var(--shell-vw)), calc(12 * var(--shell-vh)));
  height: min(calc(7 * var(--shell-vw)), calc(12 * var(--shell-vh)));
}

.character-panel {
  width: 20.5%;
  position: absolute;
  z-index: 5;
  inset: 3.2% auto 20.5% 0.7%;
  display: block;
  overflow: visible;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.character-panel::before {
  display: none;
}

.nameplate {
  width: 88%;
  min-height: 0;
  position: absolute;
  z-index: 8;
  top: 0;
  left: 2%;
  padding: calc(0.45 * var(--shell-vw)) calc(0.7 * var(--shell-vw));
  grid-template-columns: auto 1fr auto;
  gap: calc(0.45 * var(--shell-vw));
  border: 1px solid rgba(172, 138, 192, 0.65);
  border-left: 4px solid #ab3f75;
  border-radius: calc(0.35 * var(--shell-vw));
  background: rgba(5, 13, 12, 0.9);
  box-shadow: 0 calc(0.5 * var(--shell-vw)) calc(1.3 * var(--shell-vw)) #000;
  pointer-events: auto;
}

.nameplate small {
  font-size: clamp(5px, calc(0.47 * var(--shell-vw)), 8px);
}

.nameplate h2 {
  font-size: clamp(10px, calc(1.12 * var(--shell-vw)), 19px);
}

.seat-mark {
  width: clamp(22px, calc(1.9 * var(--shell-vw)), 33px);
  height: clamp(22px, calc(1.9 * var(--shell-vw)), 33px);
  font-size: clamp(11px, calc(1 * var(--shell-vw)), 17px);
}

.portrait-frame {
  height: 100%;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.portrait-frame::before,
.portrait-frame::after,
.portrait-shade,
.portrait-code,
.speech-tag {
  display: none;
}

.portrait-frame img {
  width: 116%;
  height: 116%;
  max-width: none;
  position: absolute;
  left: -8%;
  bottom: -7%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 0 calc(0.22 * var(--shell-vw)) rgba(255, 252, 255, 0.85))
    drop-shadow(0 0 calc(0.9 * var(--shell-vw)) rgba(255, 238, 252, 0.42))
    saturate(1.08)
    contrast(1.03);
}

.anna-line {
  width: 107%;
  min-height: 0;
  inset: auto auto 1% 2%;
  padding: calc(0.65 * var(--shell-vw)) calc(0.8 * var(--shell-vw)) calc(0.65 * var(--shell-vw)) calc(1 * var(--shell-vw));
  border: 1px solid rgba(199, 172, 215, 0.83);
  border-left: 4px solid #c24e88;
  border-radius: calc(0.45 * var(--shell-vw));
  background:
    linear-gradient(100deg, rgba(125, 39, 82, 0.26), transparent 65%),
    rgba(3, 9, 9, 0.94);
  font-size: clamp(8px, calc(0.77 * var(--shell-vw)), 13px);
  line-height: 1.48;
  box-shadow: 0 calc(0.65 * var(--shell-vw)) calc(1.8 * var(--shell-vw)) #000;
}

.anna-line::before {
  content: "";
  width: 0;
  height: 0;
  position: absolute;
  top: calc(-0.65 * var(--shell-vw));
  left: 24%;
  border-inline: calc(0.55 * var(--shell-vw)) solid transparent;
  border-bottom: calc(0.68 * var(--shell-vw)) solid rgba(199, 172, 215, 0.83);
}

.condition-strip {
  width: 70%;
  position: absolute;
  z-index: 8;
  top: 8.2%;
  left: 6%;
  padding: calc(0.22 * var(--shell-vw)) calc(0.5 * var(--shell-vw));
  border: 0;
  border-radius: 999px;
  background: rgba(4, 11, 10, 0.73);
  font-size: clamp(5px, calc(0.48 * var(--shell-vw)), 8px);
}

.status-panel {
  width: 17.2%;
  position: absolute;
  z-index: 6;
  inset: 2.2% 0.8% 20.5% auto;
  display: flex;
  flex-direction: column;
  gap: calc(0.45 * var(--shell-vw));
  overflow: visible;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.status-panel::before {
  display: none;
}

.score-card,
.progress-card,
.item-rack {
  border: 1px solid rgba(166, 135, 184, 0.45);
  border-radius: calc(0.38 * var(--shell-vw));
  background:
    linear-gradient(105deg, rgba(116, 40, 78, 0.18), transparent 57%),
    rgba(4, 12, 11, 0.9);
  box-shadow: 0 calc(0.45 * var(--shell-vw)) calc(1.2 * var(--shell-vw)) rgba(0, 0, 0, 0.55);
}

.score-card {
  min-height: 0;
  padding: calc(0.45 * var(--shell-vw)) calc(0.65 * var(--shell-vw));
}

.score-heading {
  font-size: clamp(6px, calc(0.54 * var(--shell-vw)), 9px);
}

.score-card > strong {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: clamp(14px, calc(1.55 * var(--shell-vw)), 26px);
  text-align: right;
  box-shadow: none;
}

.progress-card {
  padding: calc(0.45 * var(--shell-vw)) calc(0.6 * var(--shell-vw));
}

.progress-row {
  font-size: clamp(6px, calc(0.55 * var(--shell-vw)), 9px);
}

.seal-row i,
.damage-marks i {
  width: clamp(11px, calc(0.95 * var(--shell-vw)), 16px);
  height: clamp(11px, calc(0.95 * var(--shell-vw)), 16px);
}

.player-score {
  order: 3;
}

.item-rack {
  order: 4;
  min-height: 0;
  padding: calc(0.4 * var(--shell-vw));
}

.section-title {
  margin-bottom: calc(0.28 * var(--shell-vw));
  padding-bottom: calc(0.25 * var(--shell-vw));
  font-size: clamp(6px, calc(0.55 * var(--shell-vw)), 9px);
}

.item-buttons {
  gap: calc(0.25 * var(--shell-vw));
}

.item-button {
  min-height: 0;
  grid-template-columns: auto 1fr auto;
  gap: calc(0.35 * var(--shell-vw));
  padding: calc(0.3 * var(--shell-vw)) calc(0.38 * var(--shell-vw));
  border-left-width: 2px;
}

.item-button .item-symbol {
  width: clamp(18px, calc(1.5 * var(--shell-vw)), 26px);
  height: clamp(18px, calc(1.5 * var(--shell-vw)), 26px);
  font-size: clamp(9px, calc(0.78 * var(--shell-vw)), 13px);
}

.item-button strong {
  font-size: clamp(6px, calc(0.56 * var(--shell-vw)), 9px);
}

.item-button small {
  display: none;
}

.item-state {
  font-size: clamp(5px, calc(0.45 * var(--shell-vw)), 8px);
}

.log-card {
  display: none;
}

.player-area {
  height: 21.8%;
  position: absolute;
  z-index: 10;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: 18.5% minmax(0, 63%) 18.5%;
  align-items: center;
  gap: 0;
  padding: 0.5% 1.1% 0.8%;
  border: 0;
  border-top: 1px solid rgba(172, 138, 192, 0.5);
  outline: 0;
  background:
    linear-gradient(180deg, rgba(20, 18, 23, 0.97), rgba(3, 8, 7, 0.99));
  box-shadow: 0 calc(-0.8 * var(--shell-vw)) calc(2 * var(--shell-vw)) rgba(0, 0, 0, 0.58);
}

.turn-status {
  align-self: center;
  margin-right: calc(0.7 * var(--shell-vw));
  padding: calc(0.55 * var(--shell-vw)) calc(0.65 * var(--shell-vw));
  border-left-width: 3px;
  font-size: clamp(7px, calc(0.64 * var(--shell-vw)), 11px);
}

.turn-status p {
  font-size: clamp(7px, calc(0.67 * var(--shell-vw)), 11px);
}

.hand-meta {
  font-size: clamp(5px, calc(0.49 * var(--shell-vw)), 8px);
}

.player-hand-stack {
  align-self: end;
  gap: calc(0.24 * var(--shell-vw));
}

.player-hand {
  width: 100%;
  min-height: 0;
  justify-content: center;
  gap: calc(0.18 * var(--shell-vw));
  overflow: visible;
}

.player-melds:not(:empty) {
  min-height: min(calc(3.2 * var(--shell-vw)), calc(5.7 * var(--shell-vh)));
}

.action-bar {
  width: 100%;
  align-self: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(0.42 * var(--shell-vw));
  padding: calc(0.48 * var(--shell-vw));
  border-radius: calc(0.5 * var(--shell-vw));
}

.action-bar button {
  min-height: 0;
  padding: calc(0.52 * var(--shell-vw)) calc(0.3 * var(--shell-vw));
  border-radius: calc(0.28 * var(--shell-vw));
  font-size: clamp(7px, calc(0.67 * var(--shell-vw)), 11px);
}

.action-bar .primary-action {
  grid-column: span 2;
  font-size: clamp(9px, calc(0.86 * var(--shell-vw)), 14px);
}

/* Purpose-built vector-like tile faces */

.tile {
  --tile-width: clamp(27px, calc(3.35 * var(--shell-vw)), 56px);
  width: var(--tile-width);
  height: calc(var(--tile-width) * 1.42);
  flex: 0 0 var(--tile-width);
  overflow: visible;
  border: 1px solid #d4ced8;
  border-radius: calc(0.34 * var(--shell-vw)) calc(0.34 * var(--shell-vw)) calc(0.2 * var(--shell-vw)) calc(0.2 * var(--shell-vw));
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.94), transparent 13%),
    linear-gradient(160deg, #fffef1 0 75%, #dad1df 76% 100%);
  box-shadow:
    inset calc(-0.18 * var(--shell-vw)) 0 calc(0.22 * var(--shell-vw)) rgba(66, 60, 70, 0.18),
    inset 0 calc(-0.2 * var(--shell-vw)) calc(0.18 * var(--shell-vw)) rgba(63, 55, 67, 0.15),
    0 calc(0.25 * var(--shell-vw)) 0 #6d5c7e,
    0 calc(0.39 * var(--shell-vw)) 0 #322a3a,
    0 calc(0.48 * var(--shell-vw)) calc(0.65 * var(--shell-vw)) rgba(0, 0, 0, 0.48);
}

.tile-face {
  width: 84%;
  height: 84%;
  display: grid;
  place-items: center;
  color: #1c1a1e;
  line-height: 1;
}

.face-man {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 61% 39%;
  place-items: center;
  font-family: "Yu Mincho", "Noto Serif JP", serif;
}

.face-man b {
  color: #4e3365;
  font-size: calc(var(--tile-width) * 0.53);
  font-weight: 700;
}

.face-man em {
  color: #b13c77;
  font-size: calc(var(--tile-width) * 0.37);
  font-style: normal;
  font-weight: 700;
}

.face-pin,
.face-sou {
  width: 92%;
  height: 92%;
  display: grid;
  place-content: center;
  align-items: center;
  justify-items: center;
  gap: calc(var(--tile-width) * 0.045);
}

.face-pin {
  grid-template-columns: repeat(3, 1fr);
}

.face-pin.rank-2,
.face-pin.rank-3 {
  grid-template-columns: 1fr;
}

.face-pin.rank-4,
.face-pin.rank-6,
.face-pin.rank-8 {
  grid-template-columns: repeat(2, 1fr);
}

.face-pin i {
  width: calc(var(--tile-width) * 0.19);
  height: calc(var(--tile-width) * 0.19);
  display: block;
  border: calc(var(--tile-width) * 0.035) solid #573972;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ebe3ef 0 24%, #bc4782 26% 46%, #ebe3ef 48% 58%, #5c3f76 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.face-pin.rank-1 i {
  width: calc(var(--tile-width) * 0.48);
  height: calc(var(--tile-width) * 0.48);
  border-width: calc(var(--tile-width) * 0.065);
}

.face-pin.rank-5 i:nth-child(3) {
  grid-column: 2;
}

.face-pin.rank-7 i:nth-child(4) {
  grid-column: 2;
}

.face-sou {
  grid-template-columns: repeat(3, 1fr);
}

.face-sou.rank-2,
.face-sou.rank-3 {
  grid-template-columns: 1fr;
}

.face-sou.rank-4,
.face-sou.rank-6,
.face-sou.rank-8 {
  grid-template-columns: repeat(2, 1fr);
}

.face-sou i {
  width: calc(var(--tile-width) * 0.11);
  height: calc(var(--tile-width) * 0.29);
  display: block;
  position: relative;
  border-radius: 60% 60% 45% 45%;
  rotate: 7deg;
  background: linear-gradient(90deg, #40334e, #736483 52%, #2d2337);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.face-sou i::after {
  content: "";
  height: 2px;
  position: absolute;
  top: 48%;
  inset-inline: -18%;
  background: #a3356c;
  rotate: -7deg;
}

.face-sou i:nth-child(3n + 2) {
  background: linear-gradient(90deg, #54386c, #7c5d98 52%, #442d59);
  rotate: -7deg;
}

.sou-one svg {
  width: 92%;
  height: 92%;
  overflow: visible;
  fill: #4c3c5c;
  stroke: #2f2539;
  stroke-width: 1.2;
}

.sou-one .bird-leg {
  fill: none;
  stroke: #ac3e75;
  stroke-width: 2.4;
}

.sou-one .bird-eye {
  fill: #b93c7b;
  stroke: none;
}

.face-honor {
  font-family: "Yu Mincho", "Noto Serif JP", serif;
  font-size: calc(var(--tile-width) * 0.68);
  font-weight: 700;
  color: #47315a;
}

.face-honor.green {
  color: #4b3b5c;
}

.face-honor.red {
  color: #ba3a7a;
}

.face-honor.white {
  width: 58%;
  height: 72%;
  overflow: hidden;
  border: calc(var(--tile-width) * 0.06) double #63487b;
  color: transparent;
  font-size: 0;
  box-shadow: inset 0 0 0 1px #a28fb2;
}

.red-five .face-man b,
.red-five .face-man em {
  color: #c43d81;
}

.red-five .face-pin i,
.red-five .face-sou i {
  filter: hue-rotate(118deg) saturate(1.65);
}

.dora-tile {
  z-index: 3;
  border-color: #ffd67e;
  box-shadow:
    inset 0 0 calc(0.45 * var(--shell-vw)) rgba(255, 190, 80, 0.32),
    0 calc(0.25 * var(--shell-vw)) 0 #b47a1e,
    0 calc(0.38 * var(--shell-vw)) 0 #5b3a08,
    0 0 calc(0.7 * var(--shell-vw)) rgba(255, 186, 60, 0.95),
    0 0 calc(1.5 * var(--shell-vw)) rgba(255, 160, 30, 0.62);
  animation: dora-glow 1.35s ease-in-out infinite alternate;
}

/* ドラの札。紫基調の画面で一番目立つ色（金）を、ここだけに使う。
   大きさは牌の幅に追従させるので、手牌でも河でも結果画面でも同じ見え方になる。 */
.dora-badge {
  position: absolute;
  z-index: 6;
  top: calc(var(--tile-width, 44px) * -0.16);
  right: calc(var(--tile-width, 44px) * -0.14);
  min-width: calc(var(--tile-width, 44px) * 0.5);
  max-width: calc(var(--tile-width, 44px) * 0.86);
  padding: calc(var(--tile-width, 44px) * 0.035) calc(var(--tile-width, 44px) * 0.07);
  border: 2px solid #2b1305;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffdd82, #f2a222);
  color: #2b1305;
  font: 900 max(9px, calc(var(--tile-width, 44px) * 0.24))/1 "M PLUS 1p", "Yu Gothic", sans-serif;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 2px 7px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(255, 170, 40, 0.85);
}

.mini-tile {
  --tile-width: clamp(19px, calc(2.05 * var(--shell-vw)), 34px);
  width: var(--tile-width);
  height: calc(var(--tile-width) * 1.4);
  flex-basis: var(--tile-width);
  border-bottom-width: 1px;
}

.revealed-tile {
  --tile-width: clamp(22px, calc(2.5 * var(--shell-vw)), 42px);
  width: var(--tile-width);
  height: calc(var(--tile-width) * 1.4);
  flex-basis: var(--tile-width);
}

.tile-back {
  width: clamp(20px, calc(2.45 * var(--shell-vw)), 41px);
  height: clamp(30px, calc(3.45 * var(--shell-vw)), 58px);
  flex: 0 1 clamp(20px, calc(2.45 * var(--shell-vw)), 41px);
  border: 1px solid #8e7e9f;
  border-bottom: calc(0.28 * var(--shell-vw)) solid #28222f;
  border-radius: calc(0.28 * var(--shell-vw));
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.19), transparent 24%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px),
    linear-gradient(155deg, #716182, #3e324a);
  box-shadow: inset 0 0 0 calc(0.15 * var(--shell-vw)) #2c2336, 0 calc(0.28 * var(--shell-vw)) calc(0.55 * var(--shell-vw)) rgba(0, 0, 0, 0.45);
}

.call-tile,
.kan-tile-face {
  height: calc(var(--tile-width) * 1.3334);
  --tile-width: clamp(28px, calc(2.5 * var(--shell-vw)), 40px);
  width: var(--tile-width);
  height: calc(var(--tile-width) * 1.4);
  display: grid;
  place-items: center;
  border: 1px solid #cdc4d3;
  border-bottom: calc(0.28 * var(--shell-vw)) solid #534561;
  border-radius: calc(0.2 * var(--shell-vw));
  background: #fffcea;
}

.call-tile .tile-face,
.kan-tile-face > * {
  width: 84%;
  height: 84%;
}

@keyframes dora-glow {
  from { filter: brightness(1) saturate(1); }
  to { filter: brightness(1.16) saturate(1.22); }
}

/* Full-screen win action */

.win-effect {
  position: absolute;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(222, 201, 234, 0.27), transparent 24%),
    rgba(2, 5, 5, 0.78);
  pointer-events: none;
}

.win-effect-rays {
  width: calc(115 * var(--shell-vw));
  height: calc(115 * var(--shell-vw));
  position: absolute;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(204, 171, 223, 0.78) 0 2deg,
    transparent 2deg 9deg
  );
  mix-blend-mode: screen;
}

.anna-win .win-effect-rays {
  background: repeating-conic-gradient(
    from 0deg,
    rgba(232, 92, 162, 0.74) 0 2deg,
    transparent 2deg 9deg
  );
}

.win-effect-slash {
  width: calc(130 * var(--shell-vw));
  height: calc(17 * var(--shell-vh));
  position: absolute;
  rotate: -11deg;
  border-block: 2px solid #dbc4e8;
  background:
    linear-gradient(90deg, transparent 6%, #952b60 22%, #b793cc 50%, #952b60 78%, transparent 94%);
  box-shadow: 0 0 calc(4 * var(--shell-vw)) #a469c6;
}

.win-effect-copy {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  transform: skew(-7deg);
  text-align: center;
  text-shadow:
    0 0.08em #511332,
    0 0.16em #130204,
    0 0 0.35em #9e60c2;
}

.win-effect-copy > small {
  padding: 0.3em 0.8em;
  border-inline: 2px solid #d0b1e2;
  color: #d7bee6;
  font: 800 clamp(10px, calc(1.2 * var(--shell-vw)), 20px)/1 ui-monospace, monospace;
  letter-spacing: 0.28em;
}

.win-effect-copy > strong {
  color: #ede2f4;
  font-family: "Yu Mincho", serif;
  font-size: clamp(94px, calc(19 * var(--shell-vw)), 320px);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.win-effect-copy > span {
  padding: 0.22em 1.2em;
  border: 1px solid #d4b8e4;
  background: rgba(25, 3, 5, 0.78);
  color: #dfcaeb;
  font-size: clamp(17px, calc(2.2 * var(--shell-vw)), 38px);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.win-effect-sparks i {
  width: calc(0.65 * var(--shell-vw));
  height: calc(24 * var(--shell-vh));
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 50% 0;
  background: linear-gradient(#dfcbeb, #9f60c3, transparent);
  box-shadow: 0 0 calc(1 * var(--shell-vw)) #ad77cc;
}

.win-effect-sparks i:nth-child(1) { rotate: 18deg; }
.win-effect-sparks i:nth-child(2) { rotate: 67deg; }
.win-effect-sparks i:nth-child(3) { rotate: 118deg; }
.win-effect-sparks i:nth-child(4) { rotate: 192deg; }
.win-effect-sparks i:nth-child(5) { rotate: 248deg; }
.win-effect-sparks i:nth-child(6) { rotate: 311deg; }

.win-effect.active .win-effect-rays {
  animation: win-rays 1.35s cubic-bezier(.12, .8, .2, 1) both;
}

.win-effect.active .win-effect-slash {
  animation: win-slash 1.2s cubic-bezier(.1, .7, .16, 1) both;
}

.win-effect.active .win-effect-copy {
  animation: win-copy 1.28s cubic-bezier(.08, .8, .18, 1) both;
}

.win-effect.active .win-effect-sparks {
  animation: win-sparks 1.15s ease-out both;
}

@keyframes win-rays {
  0% { scale: 0.05; rotate: -35deg; opacity: 0; }
  23% { opacity: 1; }
  100% { scale: 1.15; rotate: 14deg; opacity: 0.12; }
}

@keyframes win-slash {
  0% { translate: calc(-120 * var(--shell-vw)) 0; opacity: 0; }
  20% { translate: 0 0; opacity: 1; }
  78% { opacity: 1; }
  100% { translate: calc(80 * var(--shell-vw)) 0; opacity: 0; }
}

@keyframes win-copy {
  0% { scale: 4.2; opacity: 0; }
  18% { scale: 0.88; opacity: 1; }
  28% { scale: 1.08; }
  45%, 78% { scale: 1; opacity: 1; }
  100% { scale: 1.3; opacity: 0; }
}

@keyframes win-sparks {
  0% { scale: 0; rotate: -25deg; opacity: 0; }
  24% { scale: 1; opacity: 1; }
  100% { scale: 2.2; rotate: 30deg; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dora-tile,
  .win-effect.active > * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ── Readability-first 16:9 table composition ─────────────────────────── */

.top-bar {
  height: 6.4%;
  padding: 0.42% 1.15%;
  grid-template-columns: 1fr auto 1fr;
  background:
    linear-gradient(90deg, rgba(119, 36, 78, 0.78), transparent 20%, transparent 78%, rgba(57, 41, 73, 0.2)),
    rgba(4, 11, 10, 0.98);
}

.brand {
  gap: calc(0.62 * var(--shell-vw));
}

.brand-mon {
  width: clamp(36px, calc(2.8 * var(--shell-vw)), 52px);
  height: clamp(36px, calc(2.8 * var(--shell-vw)), 52px);
  font-size: clamp(22px, calc(1.9 * var(--shell-vw)), 34px);
}

.brand h1 {
  font-size: clamp(18px, calc(1.55 * var(--shell-vw)), 28px);
  letter-spacing: 0.13em;
}

.brand-kicker,
.arcade-leds {
  display: none;
}

.round-heading {
  gap: calc(0.8 * var(--shell-vw));
  padding: calc(0.25 * var(--shell-vw)) calc(2.4 * var(--shell-vw));
  border: 0;
  border-block: 1px solid rgba(178, 148, 196, 0.42);
  background: linear-gradient(90deg, transparent, rgba(20, 18, 23, 0.94) 20% 80%, transparent);
  box-shadow: none;
}

.round-heading span {
  color: #e7d7f0;
  font-size: clamp(20px, calc(1.75 * var(--shell-vw)), 32px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

.round-heading strong {
  padding-left: calc(0.8 * var(--shell-vw));
  border-left: 1px solid rgba(182, 151, 200, 0.34);
  color: #cbb7d6;
  font-size: clamp(12px, calc(1 * var(--shell-vw)), 18px);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.top-actions {
  gap: calc(0.5 * var(--shell-vw));
}

.icon-button {
  min-height: clamp(32px, calc(2.4 * var(--shell-vw)), 46px);
  padding: calc(0.35 * var(--shell-vw)) calc(0.95 * var(--shell-vw));
  border-color: rgba(197, 178, 208, 0.36);
  background: rgba(27, 25, 29, 0.92);
  color: #e1dde4;
  font-size: clamp(11px, calc(0.82 * var(--shell-vw)), 15px);
  font-weight: 800;
}

.game-frame {
  height: 93.6%;
}

.table-panel {
  inset: 0.7% 1% 18.2%;
  grid-template-rows: 15% 85%;
  border-radius: calc(0.75 * var(--shell-vw));
  box-shadow: 0 0 0 calc(0.22 * var(--shell-vw)) #161417, 0 calc(0.8 * var(--shell-vw)) calc(2.6 * var(--shell-vw)) #000;
}

.opponent-hand-wrap {
  position: relative;
  display: block;
  padding: 0.3% 18% 0.35% 27%;
}

.hand-label {
  position: absolute;
  z-index: 6;
  top: 50%;
  right: 17.5%;
  margin: 0;
  padding: 0;
  translate: 0 -50%;
  border: 0;
  background: transparent;
}

.hand-label b {
  padding: calc(0.38 * var(--shell-vw)) calc(0.78 * var(--shell-vw));
  font-size: clamp(12px, calc(0.9 * var(--shell-vw)), 17px);
  box-shadow: 0 0 calc(1 * var(--shell-vw)) rgba(197, 68, 132, 0.58);
}

.opponent-hand {
  height: 72%;
  align-items: center;
  gap: calc(0.18 * var(--shell-vw));
}

.opponent-melds {
  height: 28%;
  max-width: none;
  justify-content: center;
  padding: 0;
}

.tile-back {
  width: clamp(30px, calc(3.05 * var(--shell-vw)), 52px);
  height: clamp(42px, calc(4.3 * var(--shell-vw)), 73px);
  flex-basis: clamp(30px, calc(3.05 * var(--shell-vw)), 52px);
}

.felt-field {
  grid-template-rows: 1fr auto 1fr;
  padding: 1% 0 1.2%;
  background:
    radial-gradient(circle at 50% 48%, rgba(104, 88, 121, 0.28), transparent 32%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #362943, #221a2a);
}

.felt-field::before {
  inset: 1.4%;
}

.felt-field::after,
.table-signet,
.river-label {
  display: none;
}

.river-zone {
  width: min(51%, 880px);
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  align-self: stretch;
}

.river {
  grid-template-columns: repeat(9, minmax(24px, calc(2.6 * var(--shell-vw))));
  grid-auto-rows: minmax(34px, calc(3.7 * var(--shell-vw)));
  gap: calc(0.22 * var(--shell-vw));
}

.mini-tile {
  --tile-width: clamp(25px, calc(2.5 * var(--shell-vw)), 43px);
}

.anna-river-zone {
  padding-top: 1%;
}

.player-river-zone {
  padding-bottom: 1%;
}

.center-console {
  max-width: none;
  grid-template-columns: repeat(3, auto);
  padding: calc(0.3 * var(--shell-vw));
  border: 1px solid #ac8abf;
  outline: calc(0.2 * var(--shell-vw)) solid #161518;
  border-radius: calc(0.5 * var(--shell-vw));
  background: rgba(5, 14, 13, 0.96);
  box-shadow: 0 calc(0.55 * var(--shell-vw)) calc(1.3 * var(--shell-vw)) rgba(0, 12, 10, 0.9), inset 0 0 0 1px rgba(233, 227, 236, 0.72);
}

.center-console > div {
  min-width: clamp(66px, calc(5.4 * var(--shell-vw)), 102px);
  padding: calc(0.45 * var(--shell-vw)) calc(0.7 * var(--shell-vw));
}

.center-console small,
.center-console span {
  color: #c0bec3;
  font-size: clamp(10px, calc(0.72 * var(--shell-vw)), 14px);
  font-weight: 800;
}

.center-console strong,
.wind-box strong {
  color: #d5bae5;
  font-size: clamp(21px, calc(1.75 * var(--shell-vw)), 32px);
  line-height: 1.05;
}

.threat-box {
  display: none !important;
}

.character-panel {
  width: 31%;
  inset: 0.7% auto 17.2% -1.6%;
  z-index: 8;
}

.nameplate {
  width: 66%;
  top: 1.2%;
  left: 7%;
  padding: calc(0.62 * var(--shell-vw)) calc(0.85 * var(--shell-vw));
  gap: calc(0.6 * var(--shell-vw));
  border-radius: calc(0.42 * var(--shell-vw));
  background:
    linear-gradient(100deg, rgba(117, 35, 76, 0.42), transparent 72%),
    rgba(3, 10, 10, 0.94);
}

.nameplate h2 {
  margin: 0;
  color: #fff8e6;
  font-size: clamp(18px, calc(1.55 * var(--shell-vw)), 29px);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.nameplate small,
.condition-strip {
  display: none;
}

.nameplate .turn-lamp {
  width: clamp(9px, calc(0.7 * var(--shell-vw)), 13px);
  height: clamp(9px, calc(0.7 * var(--shell-vw)), 13px);
}

.seat-mark {
  width: clamp(30px, calc(2.25 * var(--shell-vw)), 42px);
  height: clamp(30px, calc(2.25 * var(--shell-vw)), 42px);
  font-size: clamp(17px, calc(1.35 * var(--shell-vw)), 25px);
}

.portrait-frame img {
  width: 125%;
  height: 125%;
  left: -12%;
  bottom: -16%;
  filter:
    drop-shadow(0 0 calc(0.24 * var(--shell-vw)) rgba(255, 252, 255, 0.88))
    drop-shadow(0 0 calc(1 * var(--shell-vw)) rgba(255, 238, 252, 0.45))
    saturate(1.08)
    contrast(1.03);
}

.status-panel {
  width: 16.4%;
  inset: 1.4% 0.8% 18.2% auto;
  gap: calc(0.58 * var(--shell-vw));
}

.score-card,
.progress-card,
.item-rack {
  border-color: rgba(175, 142, 194, 0.55);
  border-radius: calc(0.46 * var(--shell-vw));
  background:
    linear-gradient(105deg, rgba(123, 41, 82, 0.23), transparent 57%),
    rgba(3, 11, 10, 0.94);
}

.score-card {
  padding: calc(0.62 * var(--shell-vw)) calc(0.8 * var(--shell-vw));
}

.score-heading {
  color: #d0c8d5;
  font-size: clamp(12px, calc(0.86 * var(--shell-vw)), 16px);
  font-weight: 800;
}

.score-heading small {
  display: none;
}

.score-card > strong {
  margin-top: 0.08em;
  color: #f0e6f5;
  font-size: clamp(27px, calc(2.15 * var(--shell-vw)), 40px);
  font-weight: 900;
  line-height: 1.08;
}

.progress-card {
  padding: calc(0.55 * var(--shell-vw)) calc(0.72 * var(--shell-vw));
}

.progress-row {
  min-height: clamp(28px, calc(2.1 * var(--shell-vw)), 40px);
  color: #d7d0db;
  font-size: clamp(11px, calc(0.78 * var(--shell-vw)), 15px);
  font-weight: 800;
}

.seal-row,
.damage-marks {
  gap: calc(0.36 * var(--shell-vw));
}

.seal-row i,
.damage-marks i {
  width: clamp(20px, calc(1.45 * var(--shell-vw)), 27px);
  height: clamp(20px, calc(1.45 * var(--shell-vw)), 27px);
}

.seal-row i::after,
.damage-marks i::after {
  font-size: clamp(10px, calc(0.72 * var(--shell-vw)), 14px);
}

.item-rack {
  padding: calc(0.58 * var(--shell-vw));
}

.section-title {
  margin-bottom: calc(0.42 * var(--shell-vw));
  padding: 0 calc(0.12 * var(--shell-vw)) calc(0.4 * var(--shell-vw));
  color: #cfafe1;
  font-size: clamp(12px, calc(0.86 * var(--shell-vw)), 16px);
  font-weight: 900;
}

.section-title small {
  color: #cfc7d3;
  font-size: clamp(10px, calc(0.72 * var(--shell-vw)), 14px);
}

.item-buttons {
  gap: calc(0.38 * var(--shell-vw));
}

.item-button {
  gap: calc(0.5 * var(--shell-vw));
  padding: calc(0.46 * var(--shell-vw)) calc(0.5 * var(--shell-vw));
  border-left-width: 3px;
}

.item-button .item-symbol {
  width: clamp(27px, calc(2 * var(--shell-vw)), 38px);
  height: clamp(27px, calc(2 * var(--shell-vw)), 38px);
  font-size: clamp(15px, calc(1.08 * var(--shell-vw)), 20px);
}

.item-button strong {
  font-size: clamp(10px, calc(0.75 * var(--shell-vw)), 14px);
  line-height: 1.25;
}

.item-state {
  color: #b88fcf;
  font-size: clamp(9px, calc(0.65 * var(--shell-vw)), 12px);
  font-weight: 900;
}

.player-area {
  height: 22.5%;
  inset: auto 0 0;
  display: block;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(28, 25, 31, 0.97), rgba(2, 7, 6, 0.995));
}

.turn-status {
  width: 19.4%;
  position: absolute;
  left: 1.1%;
  bottom: 8%;
  display: grid;
  margin: 0;
  padding: calc(0.72 * var(--shell-vw)) calc(0.78 * var(--shell-vw));
  border: 1px solid rgba(177, 155, 189, 0.45);
  border-left: 4px solid #9873ad;
  background: rgba(4, 12, 11, 0.96);
}

.turn-status p {
  color: #fffdf1;
  font-size: clamp(12px, calc(0.9 * var(--shell-vw)), 17px);
  font-weight: 900;
  line-height: 1.35;
}

.hand-meta {
  gap: calc(0.35 * var(--shell-vw));
  color: #d6d3d8;
  font-size: clamp(10px, calc(0.7 * var(--shell-vw)), 13px);
}

.hand-meta span {
  padding: calc(0.22 * var(--shell-vw)) calc(0.42 * var(--shell-vw));
}

.assist-controls {
  gap: calc(0.35 * var(--shell-vw));
  margin-top: calc(0.62 * var(--shell-vw));
}

.assist-controls > * {
  min-height: clamp(28px, calc(2 * var(--shell-vw)), 38px);
  padding: calc(0.34 * var(--shell-vw)) calc(0.42 * var(--shell-vw));
  font-size: clamp(9px, calc(0.68 * var(--shell-vw)), 13px);
  font-weight: 800;
}

.player-hand-stack {
  width: 57%;
  position: absolute;
  right: 21.5%;
  bottom: 3.5%;
  gap: calc(0.3 * var(--shell-vw));
}

.player-hand {
  gap: calc(0.2 * var(--shell-vw));
}

.tile {
  --tile-width: clamp(38px, calc(3.75 * var(--shell-vw)), 70px);
}

.tile.drawn {
  margin-left: clamp(8px, calc(0.85 * var(--shell-vw)), 16px);
}

.action-bar {
  width: 18.5%;
  position: absolute;
  right: 1%;
  bottom: 10%;
  gap: calc(0.52 * var(--shell-vw));
  padding: calc(0.58 * var(--shell-vw));
  border: 1px solid rgba(186, 183, 188, 0.34);
  border-radius: calc(0.55 * var(--shell-vw));
}

.action-bar button {
  min-height: clamp(39px, calc(3 * var(--shell-vw)), 56px);
  padding: calc(0.55 * var(--shell-vw)) calc(0.38 * var(--shell-vw));
  font-size: clamp(12px, calc(0.88 * var(--shell-vw)), 17px);
  font-weight: 900;
}

.action-bar .primary-action {
  font-size: clamp(16px, calc(1.15 * var(--shell-vw)), 22px);
}

.anna-speech {
  right: 17.5%;
  bottom: 23.2%;
  left: 27%;
  min-height: clamp(64px, calc(6.2 * var(--shell-vw)), 112px);
  padding: calc(0.85 * var(--shell-vw)) calc(1.4 * var(--shell-vw)) calc(0.9 * var(--shell-vw)) calc(1.7 * var(--shell-vw));
}

.anna-speech > span {
  font-size: clamp(10px, calc(0.78 * var(--shell-vw)), 14px);
}

.anna-speech .anna-line {
  font-size: clamp(18px, calc(1.55 * var(--shell-vw)), 29px);
}

@container shell (max-aspect-ratio: 4 / 3) {
  .character-panel {
    width: 37%;
  }

  .status-panel {
    width: 21%;
  }

  .player-hand-stack {
    width: 62%;
    right: 19%;
  }

  .turn-status {
    width: 22%;
  }

  .action-bar {
    width: 21%;
  }
}

/* Result-hand integrity and Japanese dora badges */


.result-tile > .tile-face {
  width: 100%;
  height: 100%;
  display: block;
}

.result-tile > .tile-face > .tile-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.result-tile.winning-tile {
  margin-left: clamp(7px, calc(0.65 * var(--shell-vw)), 12px);
}

.result-meld {
  margin-left: clamp(9px, calc(0.8 * var(--shell-vw)), 15px);
  padding-left: clamp(7px, calc(0.55 * var(--shell-vw)), 11px);
  border-left: 1px solid rgba(207, 175, 225, 0.42);
}

.result-tile .dora-badge {
  font-size: max(11px, calc(var(--tile-width, 44px) * 0.2));
}

@container shell (max-aspect-ratio: 4 / 3) {
  body {
    align-items: start;
    overflow-y: auto;
  }

  .app-shell {
    width: calc(100 * var(--shell-vw));
    height: calc(56.25 * var(--shell-vw));
    min-height: 360px;
  }
}

/* Standard mahjong controls and result presentation */

[hidden] {
  display: none !important;
}

.anna-speech {
  position: absolute;
  z-index: 32;
  right: 18.5%;
  bottom: 22.8%;
  left: 20.5%;
  min-height: clamp(52px, calc(5.5 * var(--shell-vw)), 92px);
  padding: calc(0.7 * var(--shell-vw)) calc(1.25 * var(--shell-vw)) calc(0.75 * var(--shell-vw)) calc(1.55 * var(--shell-vw));
  overflow: hidden;
  border: 1px solid rgba(205, 173, 224, 0.92);
  border-left: calc(0.42 * var(--shell-vw)) solid #c74888;
  border-radius: calc(0.45 * var(--shell-vw));
  background:
    linear-gradient(100deg, rgba(150, 45, 98, 0.42), transparent 48%),
    rgba(3, 8, 12, 0.96);
  box-shadow:
    0 calc(0.8 * var(--shell-vw)) calc(2.2 * var(--shell-vw)) rgba(0, 0, 0, 0.82),
    inset 0 0 calc(1.1 * var(--shell-vw)) rgba(190, 148, 214, 0.1);
  pointer-events: none;
}

.anna-speech::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(90deg, transparent, rgba(215, 189, 230, 0.12), transparent);
  translate: -100% 0;
}

.anna-speech.fresh::before {
  animation: dialogue-sweep 0.65s ease-out;
}

.anna-speech > span {
  display: block;
  margin-bottom: calc(0.22 * var(--shell-vw));
  color: #b086c8;
  font: 800 clamp(7px, calc(0.7 * var(--shell-vw)), 12px)/1 "M PLUS 1p", sans-serif;
  letter-spacing: 0.15em;
}

.anna-speech .anna-line {
  width: auto;
  min-height: 0;
  position: static;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fffdf1;
  font-size: clamp(14px, calc(1.42 * var(--shell-vw)), 25px);
  font-weight: 800;
  line-height: 1.42;
  text-shadow: 0 2px 0 #000, 0 0 calc(0.8 * var(--shell-vw)) rgba(233, 104, 169, 0.62);
  box-shadow: none;
}

.anna-speech .anna-line::before {
  display: none;
}

/* Third-stage four-tile bukkonuki puzzle */

.player-hand > .tile.bukkonuki-tile {
  filter:
    drop-shadow(0 0 calc(0.26 * var(--shell-vw)) #efffff)
    drop-shadow(0 0 calc(0.78 * var(--shell-vw)) #9e82bb)
    drop-shadow(0 0 calc(1.45 * var(--shell-vw)) rgba(229, 73, 151, 0.72));
  animation: bukkonuki-tile-pulse 0.86s ease-in-out infinite alternate;
}

#dialog-card.bukkonuki-dialog {
  width: min(calc(94 * var(--shell-vw)), 1240px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(150, 119, 182, 0.15), transparent 44%),
    linear-gradient(145deg, #18141c, #090d10 64%, #220810);
  box-shadow: 0 25px 90px #000, 0 0 42px rgba(161, 133, 189, 0.22);
}

.bukkonuki-dialog #dialog-content {
  padding: clamp(22px, calc(2.4 * var(--shell-vw)), 40px);
}

.bukkonuki-select {
  display: grid;
  gap: clamp(22px, calc(2.2 * var(--shell-vw)), 36px);
}

.bukkonuki-select-copy {
  display: grid;
  justify-items: center;
  gap: clamp(7px, calc(0.7 * var(--shell-vw)), 12px);
  text-align: center;
}

.bukkonuki-select-copy > .bukkonuki-cry {
  margin: 0;
  color: #ffc9e2;
  font-size: clamp(16px, calc(1.32 * var(--shell-vw)), 24px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-wrap: balance;
  text-shadow: 0 0 0.7em rgba(229, 73, 151, 0.55);
}

.bukkonuki-select-copy > strong {
  color: #eaddf2;
  font-family: "Yu Mincho", serif;
  font-size: clamp(30px, calc(3 * var(--shell-vw)), 52px);
  text-shadow: 0 0 0.6em rgba(158, 130, 187, 0.58);
}

.bukkonuki-select-copy > p {
  margin: 0;
  color: #eeecf0;
  font-size: clamp(20px, calc(1.6 * var(--shell-vw)), 28px);
  font-weight: 800;
  line-height: 1.35;
}

.bukkonuki-select-hand {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: clamp(2px, calc(0.35 * var(--shell-vw)), 7px);
}

.bukkonuki-select-hand > .tile {
  width: 100%;
  height: auto;
  aspect-ratio: 0.69;
  min-width: 0;
}

.bukkonuki-select-hand > .tile.selected-discard {
  translate: 0 -12px;
  filter:
    drop-shadow(0 0 4px #fff)
    drop-shadow(0 0 16px #9e82bb)
    drop-shadow(0 0 27px #d64990);
}

.bukkonuki-dialog .dialog-actions {
  justify-content: center;
}

.bukkonuki-dialog .dialog-actions button {
  min-width: min(calc(70 * var(--shell-vw)), 560px);
  padding: 0.8em 1.4em;
  background: linear-gradient(180deg, #bb4882, #601c3e);
  font-size: clamp(22px, calc(2 * var(--shell-vw)), 34px);
}

.call-cutin.bukkonuki .call-cutin-band {
  width: min(calc(94 * var(--shell-vw)), 1420px);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(8px, calc(1.1 * var(--shell-vh)), 18px);
  padding: clamp(26px, calc(4 * var(--shell-vh)), 62px) clamp(20px, calc(4 * var(--shell-vw)), 70px);
  border-block: 3px solid #bfacd2;
  background:
    linear-gradient(90deg, transparent, rgba(33, 22, 42, 0.95) 11% 89%, transparent),
    linear-gradient(180deg, rgba(199, 61, 130, 0.42), transparent 55%);
}

.call-cutin.bukkonuki .call-cutin-band > strong {
  color: #cba9df;
  font-size: clamp(30px, calc(3.2 * var(--shell-vw)), 58px);
}

.call-cutin.bukkonuki .call-cutin-band > b {
  color: #fff;
  font-size: clamp(60px, calc(7.4 * var(--shell-vw)), 132px);
  line-height: 1;
  text-shadow: 0 0.08em #9e2461, 0 0 0.42em #9677b5;
}

.call-cutin.bukkonuki .call-cutin-tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, calc(2 * var(--shell-vw)), 34px);
}

.bukkonuki-pair {
  display: flex;
  gap: clamp(4px, calc(0.5 * var(--shell-vw)), 9px);
}

.bukkonuki-pair .call-cutin-tile {
  width: clamp(56px, calc(6 * var(--shell-vw)), 104px);
  height: clamp(76px, calc(8 * var(--shell-vw)), 138px);
}

.bukkonuki-pair.incoming .call-cutin-tile {
  filter: drop-shadow(0 0 calc(0.8 * var(--shell-vw)) #a489c0);
}

.bukkonuki-swap-arrow {
  color: #d9c0e7;
  font-size: clamp(50px, calc(6 * var(--shell-vw)), 108px);
  line-height: 1;
  text-shadow: 0 0 0.38em #da4a92;
}

@keyframes bukkonuki-tile-pulse {
  to {
    translate: 0 -7px;
    filter:
      drop-shadow(0 0 calc(0.34 * var(--shell-vw)) #fff)
      drop-shadow(0 0 calc(1 * var(--shell-vw)) #9e82bb)
      drop-shadow(0 0 calc(1.7 * var(--shell-vw)) rgba(229, 73, 151, 0.9));
  }
}

/* Final exhaustive-draw contract: never collapse into the generic dialog. */

#dialog-card.draw-result-dialog,
#dialog-card:has(> #dialog-content > .draw-result) {
  width: min(calc(94 * var(--shell-vw)), 1280px);
  height: min(calc(88 * var(--shell-vh)), 760px);
  height: min(calc(88 * var(--shell-vh)), 760px);
  max-height: calc(calc(100 * var(--shell-vh)) - 24px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
  border: clamp(3px, calc(0.28 * var(--shell-vw)), 6px) solid #a27fb7;
  background: #061014;
  box-shadow:
    0 26px 90px #000,
    inset 0 0 0 4px #141316,
    0 0 calc(2.4 * var(--shell-vw)) rgba(142, 117, 168, 0.18);
}

#dialog-card.draw-result-dialog > .dialog-header,
#dialog-card:has(> #dialog-content > .draw-result) > .dialog-header {
  display: none;
}

#dialog-card.draw-result-dialog > #dialog-content,
#dialog-card:has(> #dialog-content > .draw-result) > #dialog-content {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#dialog-card.draw-result-dialog .draw-result,
#dialog-card:has(> #dialog-content > .draw-result) .draw-result {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
  padding: clamp(28px, calc(3 * var(--shell-vw)), 54px);
  background:
    radial-gradient(circle at 50% 34%, rgba(139, 115, 164, 0.23), transparent 38%),
    repeating-linear-gradient(116deg, transparent 0 44px, rgba(183, 168, 199, 0.032) 45px 46px),
    linear-gradient(145deg, #061014, #1f1627 58%, #070d11);
}

#dialog-card.draw-result-dialog .draw-result-title,
#dialog-card:has(> #dialog-content > .draw-result) .draw-result-title {
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
}

#dialog-card.draw-result-dialog .draw-result-title > strong,
#dialog-card:has(> #dialog-content > .draw-result) .draw-result-title > strong {
  color: #dfcbeb;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(112px, calc(16 * var(--shell-vw)), 240px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: 0.12em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-indent: 0.12em;
  -webkit-text-stroke: clamp(1px, calc(0.1 * var(--shell-vw)), 2px) #6b497e;
  text-shadow:
    0 0.05em 0 #472c56,
    0 0.12em 0 #061014,
    0 0 0.42em rgba(142, 117, 168, 0.44);
}

#dialog-card.draw-result-dialog .draw-status-grid,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status-grid {
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, calc(1.4 * var(--shell-vw)), 26px);
}

#dialog-card.draw-result-dialog .draw-status,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status {
  /* 「鬼怒川さん ノーテン」は一番長い組み合わせ。字数から大きさを決めて、
     どの組み合わせでも枠からはみ出さないようにする。 */
  container-type: inline-size;
  min-width: 0;
  min-height: clamp(94px, calc(8 * var(--shell-vw)), 138px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: clamp(18px, calc(1.6 * var(--shell-vw)), 30px) clamp(22px, calc(2 * var(--shell-vw)), 38px);
  border: 2px solid rgba(176, 160, 193, 0.56);
  background: rgba(2, 12, 17, 0.88);
  box-shadow:
    inset 0 0 calc(1.4 * var(--shell-vw)) rgba(147, 125, 169, 0.1),
    0 calc(0.7 * var(--shell-vw)) calc(1.5 * var(--shell-vw)) rgba(0, 0, 0, 0.35);
}

#dialog-card.draw-result-dialog .draw-status > span,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status > span {
  color: #e0dde4;
  font-size: min(clamp(24px, calc(2 * var(--shell-vw)), 38px), calc(38cqw / var(--draw-name-chars, 5)));
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

#dialog-card.draw-result-dialog .draw-status > strong,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status > strong {
  color: #f8feff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: min(clamp(52px, calc(5 * var(--shell-vw)), 86px), calc(46cqw / var(--draw-state-chars, 4)));
  font-weight: 900;
  line-height: 0.9;
  white-space: nowrap;
}

#dialog-card.draw-result-dialog .draw-status.player,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status.player {
  border-color: #a87fbf;
}

#dialog-card.draw-result-dialog .draw-status.player > strong,
#dialog-card:has(> #dialog-content > .draw-result) .draw-status.player > strong {
  color: #d3b6e3;
}

#dialog-card.draw-result-dialog .draw-result:has(.draw-tenpai-reveal),
#dialog-card:has(> #dialog-content > .draw-result) .draw-result:has(.draw-tenpai-reveal) {
  grid-template-rows: minmax(108px, 0.72fr) auto auto auto;
  align-content: center;
  gap: clamp(12px, calc(1.15 * var(--shell-vw)), 22px);
  padding-block: clamp(20px, calc(2 * var(--shell-vw)), 36px);
}

#dialog-card.draw-result-dialog .draw-tenpai-reveal,
#dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-reveal {
  z-index: 2;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, calc(1.8 * var(--shell-vw)), 34px);
  padding: clamp(14px, calc(1.25 * var(--shell-vw)), 22px) clamp(18px, calc(1.8 * var(--shell-vw)), 34px);
  border: 2px solid rgba(164, 145, 184, 0.66);
  background: linear-gradient(90deg, rgba(17, 12, 21, 0.96), rgba(33, 22, 43, 0.9));
  box-shadow: inset 0 0 calc(1.8 * var(--shell-vw)) rgba(139, 114, 165, 0.12);
}

#dialog-card.draw-result-dialog .draw-tenpai-reveal > strong,
#dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-reveal > strong {
  color: #d4c9df;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(28px, calc(2.45 * var(--shell-vw)), 44px);
  line-height: 1.1;
  white-space: nowrap;
}

#dialog-card.draw-result-dialog .draw-tenpai-hand,
#dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-hand {
  min-width: 0;
  justify-content: center;
  margin: 0;
  overflow: hidden;
}

#dialog-card.draw-result-dialog .draw-tenpai-hand .result-tile,
#dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-hand .result-tile {
  --result-tile-width: clamp(42px, calc(4 * var(--shell-vw)), 64px);
  flex: 1 1 var(--result-tile-width);
  max-width: var(--result-tile-width);
}

#dialog-card.draw-result-dialog .draw-tenpai-hand .result-meld,
#dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-hand .result-meld {
  min-width: 0;
  flex: 1 1 auto;
}

#dialog-card.draw-result-dialog .draw-penalty,
#dialog-card:has(> #dialog-content > .draw-result) .draw-penalty {
  z-index: 2;
  min-height: clamp(64px, calc(5.8 * var(--shell-vw)), 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, calc(2 * var(--shell-vw)), 38px);
  padding: clamp(10px, calc(0.9 * var(--shell-vw)), 16px) clamp(18px, calc(1.8 * var(--shell-vw)), 34px);
  border: 2px solid #976caf;
  background: linear-gradient(90deg, rgba(84, 27, 56, 0.94), rgba(21, 20, 22, 0.94));
}

#dialog-card.draw-result-dialog .draw-penalty > span,
#dialog-card:has(> #dialog-content > .draw-result) .draw-penalty > span {
  color: #d3b6e3;
  font-size: clamp(25px, calc(2.1 * var(--shell-vw)), 38px);
  font-weight: 900;
}

#dialog-card.draw-result-dialog .draw-penalty > strong,
#dialog-card:has(> #dialog-content > .draw-result) .draw-penalty > strong {
  color: #fff;
  font-size: clamp(38px, calc(3.9 * var(--shell-vw)), 68px);
  line-height: 1;
  white-space: nowrap;
}

#dialog-card.draw-result-dialog .draw-penalty > b,
#dialog-card:has(> #dialog-content > .draw-result) .draw-penalty > b {
  color: #e2ceed;
  font-size: clamp(24px, calc(2 * var(--shell-vw)), 36px);
  white-space: nowrap;
}

#dialog-card.draw-result-dialog .draw-penalty.none,
#dialog-card:has(> #dialog-content > .draw-result) .draw-penalty.none {
  border-color: rgba(176, 160, 193, 0.42);
  background: rgba(2, 12, 17, 0.82);
}

#dialog-card.draw-result-dialog > .dialog-actions,
#dialog-card:has(> #dialog-content > .draw-result) > .dialog-actions {
  min-height: clamp(82px, calc(8 * var(--shell-vh)), 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, calc(0.9 * var(--shell-vw)), 16px);
  border-top: 2px solid rgba(184, 151, 203, 0.44);
  background: #050c0d;
}

#dialog-card.draw-result-dialog > .dialog-actions button,
#dialog-card:has(> #dialog-content > .draw-result) > .dialog-actions button {
  width: min(calc(72 * var(--shell-vw)), 480px);
  min-height: clamp(58px, calc(5.5 * var(--shell-vh)), 70px);
  padding: 0.55em 1.8em;
  border-width: 2px;
  font-size: clamp(22px, calc(1.75 * var(--shell-vw)), 31px);
  font-weight: 900;
  letter-spacing: 0.16em;
}

@container shell (max-width: 760px) or (max-height: 620px) {
  #dialog-card.draw-result-dialog,
  #dialog-card:has(> #dialog-content > .draw-result) {
    width: calc(calc(100 * var(--shell-vw)) - 12px);
    height: calc(calc(100 * var(--shell-vh)) - 12px);
    max-height: calc(calc(100 * var(--shell-vh)) - 12px);
  }

  #dialog-card.draw-result-dialog .draw-result,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-result {
    padding: 18px;
  }

  #dialog-card.draw-result-dialog .draw-result-title > strong,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-result-title > strong {
    font-size: clamp(86px, calc(17 * var(--shell-vw)), 150px);
  }

  #dialog-card.draw-result-dialog .draw-status > span,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-status > span {
    font-size: min(clamp(20px, calc(3 * var(--shell-vw)), 28px), calc(38cqw / var(--draw-name-chars, 5)));
  }

  #dialog-card.draw-result-dialog .draw-status > strong,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-status > strong {
    font-size: min(clamp(40px, calc(7 * var(--shell-vw)), 62px), calc(46cqw / var(--draw-state-chars, 4)));
  }

  #dialog-card.draw-result-dialog .draw-result:has(.draw-tenpai-reveal),
  #dialog-card:has(> #dialog-content > .draw-result) .draw-result:has(.draw-tenpai-reveal) {
    grid-template-rows: auto auto auto auto;
    gap: 9px;
    padding-block: 12px;
  }

  #dialog-card.draw-result-dialog .draw-tenpai-reveal,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-reveal {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 9px 12px;
  }

  #dialog-card.draw-result-dialog .draw-tenpai-reveal > strong,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-reveal > strong {
    font-size: clamp(24px, calc(3.4 * var(--shell-vw)), 31px);
  }

  #dialog-card.draw-result-dialog .draw-tenpai-hand .result-tile,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-tenpai-hand .result-tile {
    --result-tile-width: clamp(32px, calc(5 * var(--shell-vw)), 48px);
  }

  #dialog-card.draw-result-dialog .draw-penalty,
  #dialog-card:has(> #dialog-content > .draw-result) .draw-penalty {
    min-height: 52px;
    gap: 14px;
    padding: 7px 12px;
  }
}

.anna-speech.fresh {
  animation: dialogue-pop 0.4s cubic-bezier(.17, .8, .2, 1);
}

@keyframes dialogue-pop {
  0% { translate: calc(-3 * var(--shell-vw)) 0; scale: 0.94; opacity: 0; }
  100% { translate: 0 0; scale: 1; opacity: 1; }
}

@keyframes dialogue-sweep {
  to { translate: 100% 0; }
}

.call-prompt {
  position: absolute;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(20px, calc(3 * var(--shell-vw)), 58px);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  background: rgba(0, 5, 8, 0.82);
  box-shadow: inset 0 0 0 2px rgba(188, 154, 207, 0.28);
}

.call-prompt::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(-35 * var(--shell-vw));
  background:
    repeating-conic-gradient(from -8deg, rgba(186, 142, 212, 0.2) 0 4deg, transparent 4deg 15deg),
    radial-gradient(circle at center, rgba(173, 46, 110, 0.42) 0 18%, transparent 58%);
  animation: call-prompt-rays 18s linear infinite;
}

.call-prompt-panel {
  width: min(calc(94 * var(--shell-vw)), 1480px);
  max-height: calc(92 * var(--shell-vh));
  display: grid;
  justify-items: center;
  gap: clamp(18px, calc(1.7 * var(--shell-vw)), 32px);
  padding: clamp(28px, calc(3 * var(--shell-vw)), 58px);
  border: clamp(2px, calc(0.18 * var(--shell-vw)), 4px) solid #bc99d1;
  background: linear-gradient(125deg, rgba(82, 19, 50, 0.97), rgba(5, 14, 18, 0.98) 48%, rgba(22, 18, 26, 0.98));
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.72),
    0 0 55px rgba(230, 79, 155, 0.58),
    inset 0 0 48px rgba(168, 118, 197, 0.12);
  animation: call-prompt-arrive 0.26s cubic-bezier(.12, .78, .2, 1) both;
}

.call-prompt-title {
  width: 100%;
  display: grid;
  place-items: center;
  padding-bottom: clamp(12px, calc(1 * var(--shell-vw)), 20px);
  border-bottom: 2px solid rgba(186, 147, 208, 0.72);
  text-align: center;
}

.call-prompt-title strong {
  color: #e7d8f0;
  font-size: clamp(38px, calc(4.6 * var(--shell-vw)), 82px);
  line-height: 1.05;
  letter-spacing: 0.07em;
  text-shadow: 0 4px #631c40, 0 0 24px rgba(199, 162, 220, 0.72);
}

.call-prompt-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(16px, calc(1.35 * var(--shell-vw)), 28px);
}

.call-prompt .call-choice,
.call-pass-button {
  min-width: clamp(280px, calc(25 * var(--shell-vw)), 430px);
  min-height: clamp(150px, calc(12 * var(--shell-vw)), 220px);
  display: grid;
  place-items: center;
  gap: clamp(10px, calc(0.8 * var(--shell-vw)), 16px);
  padding: clamp(18px, calc(1.5 * var(--shell-vw)), 28px);
  border: 3px solid #bda0cd;
  border-radius: clamp(8px, calc(0.7 * var(--shell-vw)), 14px);
  background: linear-gradient(155deg, #37333c, #081215 70%);
  color: #efe5f5;
  box-shadow: inset 0 2px rgba(255, 255, 255, 0.16), 0 12px 30px rgba(0, 0, 0, 0.58);
  transition: translate 0.12s ease, scale 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.call-prompt .call-choice:hover,
.call-prompt .call-choice:focus-visible,
.call-pass-button:hover {
  border-color: #d9c0e7;
  background: linear-gradient(155deg, #c24081, #531a37 72%);
  translate: 0 -7px;
  scale: 1.025;
  outline: none;
  box-shadow: 0 0 28px rgba(232, 93, 163, 0.72), inset 0 2px rgba(255, 255, 255, 0.2);
}

.call-prompt .call-choice strong {
  color: #d3b7e3;
  font-size: clamp(44px, calc(4 * var(--shell-vw)), 72px);
  line-height: 1;
  letter-spacing: 0.12em;
  text-shadow: 0 4px #621d40, 0 0 20px rgba(204, 171, 223, 0.45);
}

.call-prompt .call-tiles {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(3px, calc(0.24 * var(--shell-vw)), 6px);
}

.call-prompt .call-tile {
  --tile-width: clamp(62px, calc(5.25 * var(--shell-vw)), 94px);
  width: var(--tile-width);
  height: calc(var(--tile-width) * 1.4);
  flex: 0 0 var(--tile-width);
  filter: drop-shadow(0 7px 5px rgba(0, 0, 0, 0.58));
}

.call-pass-button {
  min-width: min(calc(52 * var(--shell-vw)), 640px);
  min-height: clamp(76px, calc(6 * var(--shell-vw)), 108px);
  padding: clamp(14px, calc(1.1 * var(--shell-vw)), 22px);
  border-color: rgba(209, 207, 211, 0.58);
  background: linear-gradient(180deg, #242028, #071013);
  color: #eef3ef;
  font-size: clamp(28px, calc(2.2 * var(--shell-vw)), 40px);
  letter-spacing: 0.05em;
}

.call-pass-button:hover,
.call-pass-button:focus-visible {
  border-color: #dbc4e8;
  background: linear-gradient(180deg, #444146, #19151c);
  translate: 0 -3px;
  outline: none;
}

@keyframes call-prompt-arrive {
  0% { opacity: 0; scale: 0.72 0.86; translate: 0 22px; }
  72% { opacity: 1; scale: 1.035 1; translate: 0 0; }
  100% { opacity: 1; scale: 1; }
}

@keyframes call-prompt-rays {
  to { rotate: 360deg; }
}

.assist-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(0.22 * var(--shell-vw));
  margin-top: calc(0.45 * var(--shell-vw));
}

.assist-controls > * {
  min-height: calc(1.45 * var(--shell-vw));
  padding: calc(0.2 * var(--shell-vw)) calc(0.28 * var(--shell-vw));
  border: 1px solid rgba(180, 176, 184, 0.3);
  border-radius: calc(0.2 * var(--shell-vw));
  background: rgba(0, 0, 0, 0.28);
  color: #b4b3b6;
  font-size: clamp(5px, calc(0.46 * var(--shell-vw)), 8px);
  line-height: 1.15;
  text-align: center;
}

.assist-controls button {
  cursor: pointer;
}

.assist-controls button.active,
.assist-fixed {
  border-color: rgba(142, 122, 163, 0.72);
  background: rgba(70, 57, 84, 0.35);
  color: #dcd2e7;
}

.assist-fixed {
  display: grid;
  place-items: center;
}

.action-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-bar .primary-action {
  grid-column: auto;
}

.meld-strip,
.meld-group,
.opponent-melds,
.player-melds {
  overflow: visible;
}

.meld-group {
  width: max-content;
  min-width: max-content;
  flex: 0 0 auto;
}

.meld-group .mini-tile {
  flex: 0 0 var(--tile-width);
}

.opponent-melds {
  max-width: 76%;
  flex-wrap: nowrap;
}

.item-button:not(:disabled) {
  border-color: rgba(192, 151, 215, 0.72);
  background:
    linear-gradient(100deg, rgba(156, 53, 105, 0.36), transparent 60%),
    rgba(8, 18, 18, 0.96);
  box-shadow: 0 0 calc(0.65 * var(--shell-vw)) rgba(172, 119, 203, 0.16);
}

/* Large character-driven win sequence */

.win-effect {
  grid-template-columns: 44% 56%;
  padding: calc(3 * var(--shell-vh)) calc(4 * var(--shell-vw)) 0;
  background:
    linear-gradient(100deg, rgba(4, 10, 15, 0.98) 0 31%, transparent 57%),
    radial-gradient(circle at 68% 48%, rgba(189, 146, 213, 0.3), transparent 28%),
    rgba(2, 5, 8, 0.92);
}

.win-effect-character {
  width: calc(48 * var(--shell-vw));
  height: calc(94 * var(--shell-vh));
  z-index: 2;
  align-self: end;
  justify-self: start;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(calc(1.4 * var(--shell-vw)) calc(1 * var(--shell-vw)) calc(1 * var(--shell-vw)) rgba(0, 0, 0, 0.78));
}

.win-effect-copy {
  width: 100%;
  justify-self: end;
  transform: skew(-5deg);
}

.win-effect.active .win-effect-copy {
  animation-duration: 2.25s;
}

.win-effect-copy > strong {
  font-size: clamp(72px, calc(11 * var(--shell-vw)), 188px);
}

.win-effect-copy > span {
  max-width: 90%;
  font-size: clamp(14px, calc(1.7 * var(--shell-vw)), 30px);
}

.win-effect-hand,
.result-hand-strip {
  display: flex;
  justify-content: center;
  align-items: end;
  flex-wrap: nowrap;
  gap: calc(0.08 * var(--shell-vw));
}

.win-effect-hand {
  max-width: calc(51 * var(--shell-vw));
  margin-top: calc(0.8 * var(--shell-vw));
}

.result-tile {
  height: calc(var(--result-tile-width) * 1.3334);
  --result-tile-width: clamp(18px, calc(2.15 * var(--shell-vw)), 36px);
  width: var(--result-tile-width);
  height: calc(var(--result-tile-width) * 1.4);
  flex: 0 0 var(--result-tile-width);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #cac1d0;
  border-radius: calc(0.2 * var(--shell-vw));
  background: linear-gradient(155deg, #fffef2 0 77%, #cdc2d4 78%);
  color: #1c1a1d;
  box-shadow: 0 calc(0.18 * var(--shell-vw)) 0 #50445d, 0 calc(0.27 * var(--shell-vw)) calc(0.4 * var(--shell-vw)) rgba(0, 0, 0, 0.5);
}

.result-tile .tile-face {
  --tile-width: var(--result-tile-width);
}

.result-meld {
  display: flex;
  gap: calc(0.05 * var(--shell-vw));
  margin-left: calc(0.45 * var(--shell-vw));
}

.win-effect-score {
  display: block;
  color: #fff;
  font-family: "M PLUS 1p", sans-serif;
  font-size: clamp(35px, calc(5.2 * var(--shell-vw)), 88px);
  line-height: 1;
  text-shadow: 0 0.06em #62183d, 0 0.12em #180204, 0 0 0.3em #a368c6;
}

.win-effect-line {
  max-width: 85%;
  margin: calc(0.55 * var(--shell-vw)) auto 0;
  color: #e6d6f0;
  font-size: clamp(11px, calc(1.12 * var(--shell-vw)), 19px);
  font-weight: 700;
  line-height: 1.5;
}

.win-effect.active .win-effect-character {
  animation: win-character 2.25s cubic-bezier(.15, .8, .18, 1) both;
}

@keyframes win-character {
  0% { translate: calc(-22 * var(--shell-vw)) calc(4 * var(--shell-vh)); scale: 0.82; opacity: 0; }
  18% { translate: 0 0; scale: 1.03; opacity: 1; }
  72% { translate: 0 0; scale: 1; opacity: 1; }
  100% { translate: calc(-2 * var(--shell-vw)) 0; scale: 1.03; opacity: 0; }
}

.win-result-dialog {
  width: min(calc(94 * var(--shell-vw)), 1480px);
  max-height: calc(88 * var(--shell-vh));
  padding-bottom: 0;
  overflow: hidden;
}

.win-result-dialog .dialog-header,
.win-result-dialog .dialog-actions {
  position: relative;
  z-index: 4;
}

.win-result-dialog #dialog-content {
  padding: 0;
}

.win-result-dialog .dialog-actions {
  justify-content: flex-end;
  padding: calc(0.55 * var(--shell-vw)) calc(0.8 * var(--shell-vw)) calc(0.75 * var(--shell-vw));
  background: #071012;
}

.result-showcase {
  min-height: min(calc(68 * var(--shell-vh)), 720px);
  display: grid;
  grid-template-columns: 38% 62%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 50%, rgba(176, 62, 119, 0.3), transparent 38%),
    linear-gradient(135deg, #16111a, #281f30 63%, #081014);
}

.result-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(198, 161, 220, 0.26);
  background:
    repeating-linear-gradient(112deg, transparent 0 34px, rgba(255, 255, 255, 0.018) 35px 36px);
  pointer-events: none;
}

.result-character {
  min-width: 0;
  position: relative;
  z-index: 2;
  align-self: stretch;
}

.result-character img {
  width: 124%;
  height: 108%;
  position: absolute;
  right: -8%;
  bottom: -8%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(calc(1 * var(--shell-vw)) calc(0.8 * var(--shell-vw)) calc(0.8 * var(--shell-vw)) rgba(0, 0, 0, 0.8));
}

.result-character > span {
  position: absolute;
  z-index: 2;
  bottom: 3%;
  left: 5%;
  padding: 0.28em 0.8em;
  border-left: 4px solid #c14684;
  background: rgba(0, 0, 0, 0.78);
  color: #e4d2ee;
  font-size: clamp(10px, calc(0.9 * var(--shell-vw)), 16px);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.result-board {
  min-width: 0;
  position: relative;
  z-index: 3;
  align-self: center;
  padding: calc(1.5 * var(--shell-vw)) calc(2.2 * var(--shell-vw)) calc(1.4 * var(--shell-vw)) calc(0.7 * var(--shell-vw));
}

.result-call-row {
  display: flex;
  align-items: end;
  gap: calc(1.2 * var(--shell-vw));
  margin-bottom: calc(1 * var(--shell-vw));
  border-bottom: 1px solid rgba(199, 162, 220, 0.52);
}

.result-call-row strong {
  color: #c8a4dd;
  font-family: "Yu Mincho", serif;
  font-size: clamp(58px, calc(7 * var(--shell-vw)), 118px);
  line-height: 0.9;
  white-space: nowrap;
  word-break: keep-all;
  text-shadow: 0 0.08em #7e204f, 0 0.14em #000, 0 0 0.32em #a063c4;
}

.result-call-row span {
  padding-bottom: calc(0.7 * var(--shell-vw));
  color: #fff;
  font-size: clamp(13px, calc(1.35 * var(--shell-vw)), 23px);
  font-weight: 800;
}

.result-hand-strip {
  justify-content: flex-start;
  margin-block: calc(0.8 * var(--shell-vw)) calc(1.1 * var(--shell-vw));
}

.result-hand-strip .result-tile {
  --result-tile-width: clamp(20px, calc(2.45 * var(--shell-vw)), 41px);
}

.result-showcase .yaku-list {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: calc(0.38 * var(--shell-vw));
  margin: calc(0.4 * var(--shell-vw)) 0 calc(0.8 * var(--shell-vw));
}

.result-showcase .yaku-list span {
  padding: 0.28em 0.62em;
  border: 1px solid rgba(196, 159, 218, 0.48);
  border-radius: calc(0.2 * var(--shell-vw));
  background: rgba(4, 12, 17, 0.72);
  color: #e2cfed;
  font-size: clamp(9px, calc(0.82 * var(--shell-vw)), 14px);
  font-weight: 700;
}

.result-showcase .result-score {
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0;
  padding: calc(0.55 * var(--shell-vw)) calc(0.9 * var(--shell-vw));
  border: 1px solid rgba(199, 162, 220, 0.54);
  background: linear-gradient(90deg, rgba(128, 40, 84, 0.72), rgba(7, 16, 20, 0.88));
}

.result-showcase .result-score strong {
  color: #be94d7;
  font-family: "Yu Mincho", serif;
  /* 役が二行三行になるときは、この字を詰めて成立役の欄へ高さを回す。 */
  font-size: calc(clamp(27px, calc(3 * var(--shell-vw)), 52px) * var(--yaku-row-shrink, 1));
  white-space: nowrap;
  word-break: keep-all;
}

.result-showcase .result-score span {
  color: #fff;
  font-size: calc(clamp(38px, calc(4.6 * var(--shell-vw)), 78px) * var(--yaku-row-shrink, 1));
  font-weight: 900;
  line-height: 0.9;
  text-shadow: 0 0 0.45em rgba(159, 96, 195, 0.72);
}

.result-showcase .result-score small {
  margin-left: 0.12em;
  font-size: 0.36em;
}

.result-dialogue {
  margin: calc(0.9 * var(--shell-vw)) 0 0;
  padding: calc(0.7 * var(--shell-vw)) calc(0.9 * var(--shell-vw));
  border-left: 4px solid #c24986;
  background: rgba(0, 0, 0, 0.46);
  color: #f1e8f6;
  font-size: clamp(12px, calc(1.22 * var(--shell-vw)), 21px);
  font-weight: 800;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .anna-speech.fresh,
  .anna-speech.fresh::before,
  .win-effect.active .win-effect-character {
    animation-duration: 0.01ms !important;
  }
}

/* Public-domain FluffyStuff riichi tile artwork */

.tile {
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: url("../assets/tiles/regular/Front.png") center / 100% 100% no-repeat;
  box-shadow: none;
}

.tile-face {
  width: 100%;
  height: 100%;
  display: block;
}

.tile-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 calc(0.22 * var(--shell-vw)) calc(0.16 * var(--shell-vw)) rgba(0, 0, 0, 0.56));
}

button.tile:not(:disabled) {
  cursor: pointer;
}

button.tile:not(:disabled):hover {
  translate: 0 calc(-0.34 * var(--shell-vw));
  filter: brightness(1.08);
}

.tile.drawn {
  margin-left: clamp(5px, calc(0.72 * var(--shell-vw)), 13px);
}

.tile.riichi-option .tile-art {
  filter:
    drop-shadow(0 0 calc(0.18 * var(--shell-vw)) #ccacdf)
    drop-shadow(0 0 calc(0.55 * var(--shell-vw)) #a16cc0);
}

.tile.dora-tile {
  border: 0;
  box-shadow: none;
  filter:
    drop-shadow(0 0 calc(0.14 * var(--shell-vw)) #fff2cf)
    drop-shadow(0 0 calc(0.6 * var(--shell-vw)) #ffb736)
    drop-shadow(0 0 calc(1.3 * var(--shell-vw)) rgba(255, 158, 26, 0.8));
}


.tile-back {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tile-back img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter:
    hue-rotate(118deg)
    saturate(0.9)
    brightness(0.74)
    drop-shadow(0 calc(0.22 * var(--shell-vw)) calc(0.16 * var(--shell-vw)) rgba(0, 0, 0, 0.62));
}

.call-tile,
.kan-tile-face {
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.call-tile .tile-face,
.kan-tile-face > .tile-art {
  width: 100%;
  height: 100%;
}

.result-tile {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.result-tile .tile-face {
  width: 100%;
  height: 100%;
}

.result-tile .tile-art {
  width: 100%;
  height: 100%;
}

.result-tile.dora-tile {
  filter:
    drop-shadow(0 0 calc(0.18 * var(--shell-vw)) #d6bce5)
    drop-shadow(0 0 calc(0.55 * var(--shell-vw)) #a367c6);
}

/* ── Win reward roulette ───────────────────────────────────────────────── */

.win-reward-badge {
  width: min(94%, 920px);
  display: grid;
  justify-items: center;
  gap: 0.2em;
  margin: clamp(14px, calc(1.2 * var(--shell-vw)), 22px) auto;
  padding: clamp(15px, calc(1.25 * var(--shell-vw)), 24px);
  border-block: 2px solid #bc97d2;
  background:
    linear-gradient(90deg, transparent, rgba(117, 31, 74, 0.92) 14%, rgba(66, 7, 22, 0.96) 50%, rgba(117, 31, 74, 0.92) 86%, transparent);
  box-shadow: 0 0 calc(2 * var(--shell-vw)) rgba(227, 62, 145, 0.26);
  text-align: center;
}

.reward-ready-dialog .result-showcase {
  min-height: min(calc(55 * var(--shell-vh)), 590px);
}

.reward-ready-dialog .dialog-actions button {
  min-width: min(calc(36 * var(--shell-vw)), 360px);
  border-color: #d1b3e2;
  background: linear-gradient(#b95788, #681f44);
  color: #efe5f5;
  font-size: clamp(13px, calc(1 * var(--shell-vw)), 18px);
  box-shadow: inset 0 0 0 3px #3c1026, 0 0 calc(1.2 * var(--shell-vw)) rgba(159, 96, 195, 0.32);
}

.win-reward-badge small {
  color: #c5a5d7;
  font: 900 clamp(8px, calc(0.72 * var(--shell-vw)), 13px)/1 ui-monospace, monospace;
  letter-spacing: 0.3em;
}

.win-reward-badge strong {
  color: #eee3f5;
  font-family: "Yu Mincho", serif;
  font-size: clamp(27px, calc(3 * var(--shell-vw)), 52px);
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 0.06em #64163d, 0 0 0.44em rgba(161, 101, 196, 0.82);
}

.win-reward-badge span {
  color: rgba(228, 210, 238, 0.82);
  font-size: clamp(10px, calc(0.85 * var(--shell-vw)), 15px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reward-roulette {
  position: absolute;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 45%, rgba(179, 32, 72, 0.34), transparent 35%),
    linear-gradient(135deg, rgba(3, 7, 10, 0.96), rgba(17, 3, 10, 0.98));
  isolation: isolate;
}

.reward-roulette::before,
.reward-roulette::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.reward-roulette::before {
  inset: 0;
  z-index: -1;
  opacity: 0.32;
  background: linear-gradient(90deg, transparent, rgba(194, 155, 217, 0.08), transparent);
}

.reward-roulette::after {
  width: min(calc(88 * var(--shell-vw)), 1520px);
  height: min(calc(79 * var(--shell-vh)), 790px);
  border: 1px solid rgba(198, 161, 220, 0.2);
  border-radius: 14px;
  box-shadow: inset 0 0 80px rgba(232, 92, 162, 0.12), 0 0 80px rgba(0, 0, 0, 0.72);
}

.reward-roulette-rays {
  width: calc(118 * var(--shell-vw));
  height: calc(118 * var(--shell-vw));
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  opacity: 0.2;
  background: repeating-conic-gradient(
    from -5deg,
    rgba(204, 171, 223, 0.68) 0 1.5deg,
    transparent 1.5deg 8deg
  );
  animation: reward-rays-idle 24s linear infinite;
}

.reward-roulette.is-spinning .reward-roulette-rays {
  opacity: 0.38;
  animation-duration: 2.8s;
}

.reward-roulette.is-won .reward-roulette-rays {
  opacity: 0.54;
  animation: reward-rays-win 1.1s cubic-bezier(.16, .8, .18, 1) both;
}

.reward-roulette-flash {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #ede2f4;
}

.reward-roulette.is-won .reward-roulette-flash {
  animation: reward-flash 0.7s ease-out both;
}

.reward-roulette-panel {
  width: min(calc(82 * var(--shell-vw)), 1360px);
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: clamp(17px, calc(2.1 * var(--shell-vh)), 30px);
  padding: clamp(30px, calc(4 * var(--shell-vw)), 70px);
  border-block: 2px solid rgba(195, 159, 215, 0.76);
  background:
    linear-gradient(90deg, transparent, rgba(77, 4, 23, 0.84) 12%, rgba(10, 8, 13, 0.95) 50%, rgba(77, 4, 23, 0.84) 88%, transparent);
  text-align: center;
}

.reward-roulette-header p {
  margin: 0 0 0.65em;
  color: #b99bca;
  font: 800 clamp(9px, calc(0.78 * var(--shell-vw)), 14px)/1 ui-monospace, monospace;
  letter-spacing: 0.28em;
}

.reward-roulette-header h2 {
  margin: 0;
  color: #fff9e6;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, calc(4.6 * var(--shell-vw)), 78px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.07em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-shadow: 0 0.07em #6c1a43, 0 0 0.45em rgba(232, 96, 164, 0.72);
}

.reward-roulette-header > span {
  display: block;
  margin-top: 0.85em;
  color: rgba(241, 232, 246, 0.68);
  font-size: clamp(11px, calc(0.92 * var(--shell-vw)), 16px);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.reward-reel-shell {
  width: 100%;
  position: relative;
  padding-block: clamp(13px, calc(1.2 * var(--shell-vw)), 20px);
  overflow: hidden;
  border: 1px solid rgba(209, 180, 226, 0.42);
  background:
    linear-gradient(90deg, rgba(4, 7, 9, 0.96), transparent 16% 84%, rgba(4, 7, 9, 0.96)),
    rgba(3, 7, 9, 0.92);
  box-shadow:
    inset 0 0 calc(3 * var(--shell-vw)) rgba(0, 0, 0, 0.9),
    0 0 calc(2 * var(--shell-vw)) rgba(197, 62, 130, 0.18);
}

.reward-reel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(7px, calc(0.8 * var(--shell-vw)), 14px);
  padding-inline: clamp(13px, calc(2 * var(--shell-vw)), 34px);
}

.reward-reel-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  gap: 0.42em;
  padding: clamp(12px, calc(1.25 * var(--shell-vw)), 22px) clamp(5px, calc(0.7 * var(--shell-vw)), 12px);
  border: 1px solid rgba(218, 194, 232, 0.16);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(28, 12, 17, 0.82));
  color: rgba(220, 207, 228, 0.46);
  filter: saturate(0.48);
  transform: scale(0.9);
  transition: transform 90ms linear, filter 90ms linear, color 90ms linear;
}

.reward-reel-card .reward-symbol {
  width: clamp(48px, calc(4.3 * var(--shell-vw)), 74px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.38);
  font-family: "Yu Mincho", serif;
  font-size: clamp(27px, calc(2.8 * var(--shell-vw)), 48px);
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.34);
}

.reward-reel-card strong {
  min-width: 0;
  font-size: clamp(8px, calc(0.85 * var(--shell-vw)), 15px);
  line-height: 1.35;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.reward-reel-card.is-center {
  border-color: #d3b6e3;
  background:
    linear-gradient(135deg, rgba(196, 63, 130, 0.92), rgba(64, 16, 40, 0.96));
  color: #ede1f3;
  filter: none;
  transform: scale(1);
  box-shadow:
    inset 0 0 0 3px rgba(200, 164, 221, 0.14),
    0 0 calc(1.2 * var(--shell-vw)) rgba(160, 98, 196, 0.46);
}

.reward-pointer {
  position: absolute;
  z-index: 4;
  left: 50%;
  translate: -50% 0;
  width: 0;
  height: 0;
  border-inline: clamp(10px, calc(1 * var(--shell-vw)), 17px) solid transparent;
  filter: drop-shadow(0 0 calc(0.55 * var(--shell-vw)) #a368c6);
}

.reward-pointer-top {
  top: 0;
  border-top: clamp(15px, calc(1.35 * var(--shell-vw)), 23px) solid #cdace0;
}

.reward-pointer-bottom {
  bottom: 0;
  border-bottom: clamp(15px, calc(1.35 * var(--shell-vw)), 23px) solid #cdace0;
}

.reward-result {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.32em;
  padding: clamp(18px, calc(2 * var(--shell-vw)), 34px);
  border-radius: 14px;
  border: 1px solid #c199d9;
  background:
    radial-gradient(circle at 50% 0, rgba(203, 169, 222, 0.28), transparent 48%),
    linear-gradient(120deg, rgba(80, 6, 25, 0.96), rgba(15, 8, 14, 0.98) 50%, rgba(80, 6, 25, 0.96));
  box-shadow: 0 0 calc(3 * var(--shell-vw)) rgba(159, 97, 195, 0.34);
}

.reward-result small {
  color: #c097d7;
  font: 900 clamp(17px, calc(1.5 * var(--shell-vw)), 27px)/1 ui-monospace, monospace;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.reward-result strong {
  color: #fff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(42px, calc(5 * var(--shell-vw)), 86px);
  font-weight: 900;
  line-height: 1.12;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-shadow: 0 0.06em #6a1540, 0 0 0.4em rgba(162, 101, 197, 0.9);
}

.reward-result p {
  margin: 0;
  color: #e5d4ef;
  font-size: clamp(13px, calc(1.1 * var(--shell-vw)), 19px);
  font-weight: 700;
  line-height: 1.55;
}

.reward-roulette.is-won .reward-roulette-header,
.reward-roulette.is-won .reward-reel-shell {
  display: none;
}

.reward-roulette.is-won .reward-result {
  animation: reward-card-reveal 0.8s cubic-bezier(.12, .8, .18, 1) both;
}

.reward-confirm-button {
  min-width: min(calc(70 * var(--shell-vw)), 420px);
  padding: 0.9em 2em;
  border: 1px solid #d3b6e3;
  background: linear-gradient(#b65385, #661f43);
  color: #f1e8f6;
  font-size: clamp(15px, calc(1.3 * var(--shell-vw)), 23px);
  font-weight: 900;
  letter-spacing: 0.16em;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  box-shadow: inset 0 0 0 3px rgba(48, 10, 29, 0.55), 0 0.4em 1.2em rgba(0, 0, 0, 0.54);
  cursor: pointer;
}

/* ── Kinugawa-game dialogue scene port ─────────────────────────────────── */

.kinugawa-story-scene {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 170;
  inset: 0;
  margin: auto;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  box-shadow: 0 0 0 calc(100 * var(--shell-vw)) #000;
  isolation: isolate;
}

.kinugawa-story-scene::after {
  content: "";
  position: absolute;
  z-index: 60;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity 1.05s ease;
}

.kinugawa-story-scene.cheat-caught-blackout {
  pointer-events: none;
}

.kinugawa-story-scene.cheat-caught-blackout::after {
  opacity: 1;
}

.kinugawa-story-bg {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  position: absolute;
  z-index: 0;
  inset: -1px;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

/* 会話シーンの背景はぼかさない。絵をそのまま見せる。
   立ち絵と重なる部分だけ、明るさを少し落として文字と人物を立たせる。 */
.kinugawa-story-scene {
  --story-bg-saturate: 1;
  --story-bg-brightness: 0.92;
}

.kinugawa-story-scene:not(.reward-cg-scene) .kinugawa-story-bg {
  filter:
    saturate(var(--story-bg-saturate))
    brightness(var(--story-bg-brightness));
}

.kinugawa-story-scene.story-intro .kinugawa-story-anna {
  animation-delay: 0.46s;
}

.kinugawa-story-scene.reward-cg-scene {
  background: #000;
}

.kinugawa-story-scene.reward-cg-scene .kinugawa-story-bg {
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: contain;
  transform-origin: 50% 50%;
  animation: reward-cg-pan-to-full 9.6s linear both;
}

/* 見終わるまではクリックで飛ばせない。解禁したら合図を出す。 */
.kinugawa-story-scene.reward-cg-scene.reward-cg-ready .kinugawa-story-hint {
  display: block !important;
  animation: kinugawa-continue-blink 1.1s ease-in-out infinite alternate;
}

.kinugawa-story-scene.reward-cg-scene .kinugawa-story-shade,
.kinugawa-story-scene.reward-cg-scene .kinugawa-story-anna,
.kinugawa-story-scene.reward-cg-scene .kinugawa-message-window,
.kinugawa-story-scene.reward-cg-scene .kinugawa-story-hint {
  display: none !important;
}

/* 台詞が始まったら、右クリックの案内も一緒に出す。絵だけ見たいときに使う。 */
.kinugawa-story-scene.reward-cg-scene.reward-cg-talking .kinugawa-story-hint {
  display: block !important;
  z-index: 9;
}

/* 白く飛んで全体が出たら、その絵の上で台詞を始める。 */
.kinugawa-story-scene.reward-cg-scene.reward-cg-talking .kinugawa-message-window {
  display: block !important;
  z-index: 8;
  animation: reward-cg-window-in 0.5s ease-out both;
}

@keyframes reward-cg-window-in {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

.kinugawa-story-scene.story-bedroom-ending {
  /* 寝室の絵はもともと夜の暗さなので、ここでは落としすぎない。 */
  --story-bg-saturate: 0.86;
  --story-bg-brightness: 0.9;
}

.kinugawa-story-scene.story-bedroom-ending .kinugawa-story-shade {
  background:
    radial-gradient(circle at 70% 32%, transparent 0 16%, rgba(18, 0, 20, 0.28) 54%),
    linear-gradient(90deg, rgba(21, 0, 22, 0.68), transparent 50%),
    linear-gradient(0deg, rgba(8, 0, 12, 0.76), transparent 62%);
}

.kinugawa-story-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 4, 13, 0.42), transparent 36%),
    linear-gradient(0deg, rgba(11, 3, 17, 0.54), transparent 56%);
}

.kinugawa-story-scene.cheat-caught-scene .kinugawa-story-shade {
  background:
    radial-gradient(circle at 72% 34%, transparent 0 19%, rgba(29, 4, 17, 0.28) 53%),
    linear-gradient(90deg, rgba(28, 0, 8, 0.62), transparent 42%),
    linear-gradient(0deg, rgba(14, 0, 5, 0.76), transparent 58%);
}

.kinugawa-story-scene.cheat-caught-scene .kinugawa-message-panel {
  border-color: rgba(233, 100, 167, 0.62);
  background:
    linear-gradient(104deg, rgba(57, 11, 34, 0.94), rgba(18, 3, 17, 0.96) 58%, rgba(12, 8, 22, 0.96));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(203, 48, 126, 0.3),
    inset 0 1px 0 rgba(255, 236, 255, 0.09);
}

.kinugawa-story-scene.cheat-caught-scene .kinugawa-speaker {
  background: linear-gradient(102deg, #c2357c, #641348);
}

.kinugawa-story-anna {
  height: 100%;
  max-width: 66%;
  position: absolute;
  z-index: 2;
  top: 0;
  right: 4%;
  object-fit: contain;
  object-position: top center;
  filter:
    drop-shadow(0 0 calc(0.24 * var(--shell-vw)) rgba(255, 252, 255, 0.88))
    drop-shadow(0 0 calc(1.1 * var(--shell-vw)) rgba(255, 238, 252, 0.45));
  animation: kinugawa-character-enter 0.5s cubic-bezier(.2, .8, .2, 1) both;
}

.kinugawa-message-window {
  height: 43%;
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(9, 2, 15, 0.96) 0, rgba(12, 3, 20, 0.66) 60%, transparent 100%);
}

.kinugawa-message-panel {
  height: clamp(155px, calc(31 * var(--shell-vh)), 340px);
  position: absolute;
  right: 3.5%;
  bottom: 3.5%;
  left: 3.5%;
  padding: clamp(29px, calc(3.5 * var(--shell-vh)), 52px) clamp(24px, calc(3 * var(--shell-vw)), 52px) clamp(22px, calc(2.5 * var(--shell-vh)), 38px);
  border: 1px solid rgba(255, 86, 196, 0.42);
  border-radius: 3px;
  background:
    linear-gradient(172deg, rgba(19, 9, 34, 0.91), rgba(6, 2, 13, 0.95) 62%),
    radial-gradient(140% 120% at 8% 0, rgba(144, 104, 234, 0.16), transparent 46%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(150, 18, 148, 0.26),
    inset 0 1px 0 rgba(255, 236, 255, 0.09),
    inset 0 0 34px rgba(117, 49, 151, 0.12);
  backdrop-filter: blur(3px) saturate(1.05);
}

/* 会話シーンの窓は、立ち絵を隠さないところまで薄くする。
   読みやすさはぼかしと文字の影で補う。対局中の台詞欄は別指定なのでそのまま。 */
.kinugawa-story-scene .kinugawa-message-window {
  background: linear-gradient(0deg, rgba(9, 2, 15, 0.7) 0, rgba(12, 3, 20, 0.32) 60%, transparent 100%);
}

.kinugawa-story-scene .kinugawa-message-panel {
  background:
    linear-gradient(172deg, rgba(19, 9, 34, 0.54), rgba(6, 2, 13, 0.62) 62%),
    radial-gradient(140% 120% at 8% 0, rgba(144, 104, 234, 0.12), transparent 46%);
  backdrop-filter: blur(7px) saturate(1.05);
}

.kinugawa-story-scene .kinugawa-message-text,
.kinugawa-story-scene .kinugawa-speaker {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 24px rgba(0, 0, 0, 0.75);
}

/* 会話の文字は大きいほど読みやすい。いちばん長い台詞（43字）が二行で収まる
   ぎりぎりまで上げ、窓の幅が狭いときは幅なりに縮める。 */
.kinugawa-story-scene .kinugawa-message-panel {
  container-type: inline-size;
}

/* 画面が小さいほど比率で、大きいほど頭打ちで。iPhoneで豆粒にせず、PCで巨大にもしない。 */
.kinugawa-story-scene .kinugawa-message-panel {
  height: clamp(150px, 23cqw, 272px);
  padding: clamp(14px, 2.6cqw, 40px) clamp(16px, 2.8cqw, 44px) clamp(12px, 2cqw, 30px);
}

.kinugawa-story-scene .kinugawa-message-text {
  font-size: clamp(20px, 3.6cqw, 50px);
  line-height: 1.45;
  text-wrap: pretty;
}

.kinugawa-story-scene .kinugawa-speaker {
  left: clamp(16px, 3cqw, 44px);
  padding: clamp(5px, 0.7cqw, 10px) clamp(14px, 2.2cqw, 30px) clamp(6px, 0.8cqw, 11px) clamp(12px, 1.8cqw, 26px);
  font-size: clamp(12px, 1.9cqw, 24px);
}

.kinugawa-message-panel::before {
  content: "";
  position: absolute;
  inset: 9px;
  opacity: 0.85;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) left top / 30px 1px no-repeat,
    linear-gradient(180deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) left top / 1px 14px no-repeat,
    linear-gradient(270deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) right top / 30px 1px no-repeat,
    linear-gradient(180deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) right top / 1px 14px no-repeat,
    linear-gradient(90deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) left bottom / 30px 1px no-repeat,
    linear-gradient(0deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) left bottom / 1px 14px no-repeat,
    linear-gradient(270deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) right bottom / 30px 1px no-repeat,
    linear-gradient(0deg, rgba(200, 172, 216, 0.42), rgba(200, 172, 216, 0.42)) right bottom / 1px 14px no-repeat;
}

.kinugawa-message-panel::after {
  content: "";
  height: 2px;
  position: absolute;
  top: -1px;
  right: 34%;
  left: 16px;
  background: linear-gradient(90deg, #ff2da6, rgba(163, 115, 244, 0.66) 52%, rgba(173, 132, 209, 0.3) 82%, transparent);
  box-shadow: 0 0 12px rgba(255, 45, 166, 0.45);
}

.kinugawa-speaker {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 30px;
  transform: translateY(-62%);
  margin: 0;
  padding: 7px 25px 8px 20px;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 100%, 13px 100%);
  background: linear-gradient(102deg, rgba(255, 45, 166, 0.96), rgba(128, 71, 224, 0.96));
  color: #fff;
  font-size: clamp(13px, calc(1 * var(--shell-vw)), 18px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.kinugawa-message-text {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #f8f0ff;
  font-size: clamp(20px, calc(2.05 * var(--shell-vw)), 36px);
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.62), 0 0 14px rgba(40, 4, 56, 0.58);
  line-break: strict;
}

.kinugawa-continue {
  position: absolute;
  z-index: 3;
  /* 送りの印も枠のふちから離す。 */
  right: clamp(30px, 3.4%, 74px);
  bottom: clamp(19px, 2.4%, 40px);
  color: rgba(255, 143, 219, 0.98);
  font-size: clamp(15px, calc(1.3 * var(--shell-vw)), 23px);
  text-shadow: 0 2px 6px #000, 0 0 14px rgba(255, 45, 166, 0.85);
  animation: kinugawa-continue-blink 0.82s ease-in-out infinite alternate;
}

/* 絵を見たいときは右クリックで文字の枠を消す。もう一度クリックで戻る。 */
.kinugawa-story-scene.message-hidden .kinugawa-message-window {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease-out, visibility 0s linear 0.18s;
}

/* 右クリックで枠を消したときは、右下の案内も一緒に消す。
   案内だけ残ると消し忘れのように見える。点滅で opacity を動かす指定があるので、
   ここは visibility で確実に消す。 */
.kinugawa-story-scene.message-hidden .kinugawa-story-hint {
  visibility: hidden;
}

.kinugawa-story-hint {
  position: absolute;
  z-index: 6;
  /* 枠の角にも、送りの印（▼）にも重ねない。印の左へ十分に離して置く。 */
  right: 11%;
  bottom: 4.2%;
  color: rgba(255, 255, 255, 0.46);
  font: 700 clamp(11px, calc(0.8 * var(--shell-vw)), 17px)/1 ui-monospace, monospace;
  letter-spacing: 0.18em;
}

@keyframes reward-rays-idle {
  to { rotate: 360deg; }
}

@keyframes reward-rays-win {
  0% { scale: 0.25; rotate: -20deg; opacity: 0; }
  35% { opacity: 0.72; }
  100% { scale: 1.25; rotate: 18deg; opacity: 0.42; }
}

@keyframes reward-flash {
  0% { opacity: 0; }
  12% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes reward-card-reveal {
  0% { scale: 0.48; translate: 0 calc(3 * var(--shell-vh)); opacity: 0; filter: blur(10px); }
  35% { scale: 1.08; opacity: 1; filter: none; }
  100% { scale: 1; translate: 0 0; opacity: 1; }
}

@keyframes reward-hint-blink {
  to { opacity: 0.5; }
}

@keyframes kinugawa-character-enter {
  from { translate: 5% 0; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}

/* 足元から顔へすっと上がり、白く飛ばしてから全体をぱっと見せる。
   引いて見せる動きは入れない。止まって見えないよう、各区間を linear にしてある。 */
@keyframes reward-cg-pan-to-full {
  0% {
    transform: scale(1.95) translate3d(0, -15%, 0);
    animation-timing-function: linear;
  }
  56% {
    transform: scale(1.95) translate3d(7%, 13%, 0);
    animation-timing-function: linear;
  }
  /* ここは白幕の裏。引いていく動きは見せず、全体像へ切り替える。 */
  58% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1) translate3d(0, 0, 0);
  }
}

/* 白幕。顔まで上がりきったところで一度飛ばす。 */
.kinugawa-story-scene .reward-cg-veil {
  position: absolute;
  z-index: 6;
  inset: 0;
  opacity: 0;
  background: #fff;
  pointer-events: none;
}

.kinugawa-story-scene.reward-cg-scene .reward-cg-veil {
  animation: reward-cg-veil 9.6s linear both;
}

@keyframes reward-cg-veil {
  0%,
  50% { opacity: 0; }
  56% { opacity: 1; }
  61% { opacity: 1; }
  /* ぱっと明ける。ここで全体像が出る。 */
  66% { opacity: 0; }
  100% { opacity: 0; }
}

/* ハートときらめき。全体像が出てから舞う。 */
.kinugawa-story-scene .reward-cg-sparkles {
  position: absolute;
  z-index: 7;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.kinugawa-story-scene.reward-cg-scene .reward-cg-sparkles {
  animation: reward-cg-sparkles-in 9.6s linear both;
}

@keyframes reward-cg-sparkles-in {
  0%,
  61% { opacity: 0; }
  68% { opacity: 1; }
  100% { opacity: 1; }
}

.reward-cg-sparkles > span {
  position: absolute;
  left: var(--x);
  bottom: -8%;
  color: var(--tone, #ff9ecb);
  font-size: var(--size, 22px);
  line-height: 1;
  text-shadow: 0 0 0.5em rgba(255, 180, 220, 0.9), 0 0 1.2em rgba(255, 255, 255, 0.7);
  animation: reward-cg-float var(--dur, 4.2s) linear var(--delay, 0s) infinite;
}

@keyframes reward-cg-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.6) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, calc(3 * var(--shell-vw))), calc(-78 * var(--shell-vh)), 0) scale(1.15) rotate(var(--spin, 14deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-cg-sparkles > span { animation: none; opacity: 0.8; }
}

@keyframes kinugawa-continue-blink {
  to { translate: 0 5px; opacity: 0.45; }
}

@container shell (max-width: 720px) {
  .reward-roulette-panel {
    width: calc(94 * var(--shell-vw));
    padding-inline: 14px;
  }

  .reward-reel-card:nth-child(1),
  .reward-reel-card:nth-child(5) {
    opacity: 0.38;
  }

  .kinugawa-message-panel {
    right: 2%;
    left: 2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-roulette-rays,
  .reward-roulette.is-won .reward-roulette-rays,
  .reward-roulette.is-won .reward-roulette-flash,
  .reward-roulette.is-won .reward-result,
  .kinugawa-story-anna,
  .kinugawa-story-scene.reward-cg-scene .kinugawa-story-bg,
  .kinugawa-continue {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Final table overlay correction: never reuse the white tile face as a panel. */

.character-panel,
.portrait-frame {
  background: transparent !important;
  background-image: none !important;
}

.portrait-frame img {
  background: transparent !important;
}

.anna-speech {
  border: 1px solid rgba(201, 166, 221, 0.82);
  border-left: calc(0.42 * var(--shell-vw)) solid #c74888;
  background:
    linear-gradient(105deg, rgba(132, 37, 85, 0.5), transparent 48%),
    linear-gradient(180deg, rgba(5, 12, 17, 0.98), rgba(2, 8, 11, 0.98)) !important;
  box-shadow:
    0 calc(0.9 * var(--shell-vw)) calc(2.4 * var(--shell-vw)) rgba(0, 0, 0, 0.84),
    inset 0 1px 0 rgba(226, 208, 237, 0.08),
    inset 0 0 calc(1.4 * var(--shell-vw)) rgba(150, 44, 97, 0.13);
}

.anna-speech .anna-line {
  width: auto;
  min-height: 0;
  position: static;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  background-image: none !important;
  color: #fffdf1;
  font-size: clamp(18px, calc(1.55 * var(--shell-vw)), 29px);
  font-weight: 800;
  line-height: 1.42;
  text-shadow: 0 2px 0 #000, 0 0 calc(0.8 * var(--shell-vw)) rgba(233, 104, 169, 0.62);
  box-shadow: none;
}

.anna-speech .anna-line::before {
  display: none;
}

/* 全牌待ちで放銃したときだけ出る、主人公の声 */
.trap-cry {
  margin: 0 0 14px;
  color: #ffd2e4;
  font-size: clamp(16px, calc(1.3 * var(--shell-vw)), 24px);
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 0.7em rgba(229, 73, 151, 0.5);
}

/* 送り中の未読ぶん。場所は取ったまま見えなくして、行の形を変えない。 */
.story-text-rest {
  visibility: hidden;
}
