:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7d0c4;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #b42318;
  --gold: #b7791f;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 36rem),
    linear-gradient(135deg, #f7f3ea 0%, #e8f0ed 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app,
.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hidden {
  display: none !important;
}

.setup-screen {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.hero-panel {
  grid-row: 1 / span 8;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.setup-card,
.setup-actions,
.reset-profile-button {
  grid-column: 2;
}

.screen {
  width: 100%;
}

.title-block h1,
.hero-panel h1,
.game-header h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.8rem);
  line-height: 1;
}

.title-block p,
.hero-panel p {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.kicker,
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-panel,
.setup-card,
.hero-panel,
.matchmaking-card,
.play-panel,
.info-panel,
.result-card,
.table-panel,
.side-panel,
.reaction-panel,
.log-panel,
.result-panel {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setup-panel,
.setup-card,
.hero-panel,
.matchmaking-card,
.play-panel,
.info-panel,
.result-card {
  padding: 24px;
}

h2,
h3 {
  margin: 0;
}

.player-counts,
.match-mode-buttons,
.ai-difficulty-buttons,
.button-grid,
.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.setup-actions {
  display: grid;
  gap: 10px;
}

.reset-profile-button {
  width: 100%;
  min-height: 42px;
  color: var(--muted);
}

.match-mode-setup,
.player-count-setup,
.ai-difficulty-setup,
.name-setup {
  margin: 18px 0;
}

.match-mode-setup h3,
.ai-difficulty-setup h3,
.name-setup h3 {
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.matchmaking-panel {
  padding: 24px;
}

.matchmaking-steps {
  display: grid;
  gap: 10px;
}

.matchmaking-steps span,
.matchmaking-steps li {
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.matchmaking-steps span.is-active,
.matchmaking-steps li.is-active {
  background: #eef8f6;
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--accent-dark);
}

.player-name-inputs {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.player-name-row {
  display: grid;
  gap: 6px;
}

.player-name-row.is-ai input {
  background: #f4f6f5;
  color: var(--muted);
}

.player-name-row label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.player-name-row input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.player-name-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
  outline: none;
}

.audio-settings {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audio-settings-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.audio-settings-heading h3 {
  color: var(--muted);
  font-size: 0.95rem;
}

.audio-toggle-button {
  width: auto;
  min-width: 94px;
  min-height: 40px;
  padding: 0 12px;
}

.audio-slider {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.audio-slider input {
  width: 100%;
  accent-color: var(--accent);
}

.setup-panel .secondary-button {
  width: 100%;
}

.setup-panel .audio-toggle-button {
  width: auto;
}

.count-button,
.mode-button,
.ai-difficulty-button,
.secondary-button,
.ghost-button {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
}

.count-button.is-selected,
.count-button.active,
.mode-button.is-selected,
.mode-button.active,
.ai-difficulty-button.is-selected,
.ai-difficulty-button.active,
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.24);
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.wide-button {
  margin-top: 16px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 8px 0 18px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.audio-settings-compact {
  width: min(270px, 44vw);
  margin: 0;
  box-shadow: none;
}

.audio-settings-compact .audio-settings-heading h3 {
  font-size: 0.85rem;
}

.audio-settings-compact .audio-slider {
  grid-template-columns: 54px minmax(0, 1fr);
}

.game-header h1 {
  font-size: clamp(1.8rem, 7vw, 3.2rem);
}

.ghost-button {
  width: auto;
  min-width: 132px;
  padding: 0 16px;
}

.status-strip,
.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.status-card {
  min-height: 86px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
}

.status-card.highlight {
  background: #e8f5f2;
  border-color: rgba(15, 118, 110, 0.45);
}

.instruction-box {
  margin: 14px 0;
  padding: 14px 16px;
  background: #172026;
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}

.danger-vignette {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, box-shadow 220ms ease;
}

.danger-vignette.danger-watch {
  opacity: 1;
  box-shadow: inset 0 0 60px 16px rgba(185, 28, 28, 0.18);
}

.danger-vignette.danger-risk {
  opacity: 1;
  box-shadow: inset 0 0 92px 26px rgba(220, 38, 38, 0.32);
}

.danger-vignette.danger-over {
  opacity: 1;
  box-shadow: inset 0 0 130px 38px rgba(220, 38, 38, 0.48);
  animation: dangerPulse 900ms ease-in-out infinite alternate;
}

.danger-status {
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.danger-status span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.danger-status strong {
  font-size: 1.1rem;
}

.danger-status.danger-watch strong {
  color: #b7791f;
}

.danger-status.danger-risk strong {
  color: #c2410c;
}

.danger-status.danger-over {
  border-color: rgba(185, 28, 28, 0.45);
}

.danger-status.danger-over strong {
  color: #b91c1c;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.table-panel,
.side-panel,
.reaction-panel,
.log-panel,
.result-panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff0c2;
  color: #7a4a00;
  font-size: 0.85rem;
  font-weight: 900;
}

.hand-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
}

.card-button {
  aspect-ratio: 0.72;
  min-height: 92px;
  padding: 8px;
  background: linear-gradient(160deg, #ffffff 0%, #f9f4e8 100%);
  border: 2px solid #c7bda9;
  color: var(--ink);
  box-shadow: 0 7px 14px rgba(31, 41, 51, 0.12);
  font-size: 1.8rem;
  position: relative;
}

.card-button::before,
.card-button::after {
  content: "◆";
  position: absolute;
  color: var(--accent);
  font-size: 0.78rem;
}

.card-button::before {
  top: 8px;
  left: 9px;
}

.card-button::after {
  right: 9px;
  bottom: 8px;
}

.card-button.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.22), 0 9px 18px rgba(31, 41, 51, 0.16);
}

.card-button.is-banned {
  background: #f1f1f1;
  color: #999;
}

.declare-area {
  margin-top: 16px;
}

.declare-area h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

.number-button {
  min-height: 48px;
  background: #eef6f4;
  color: var(--accent-dark);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.number-button.is-selected {
  background: var(--accent);
  color: #fff;
}

.players-area,
.skills-area,
.accuse-area {
  display: grid;
  gap: 10px;
}

.player-row,
.skill-card,
.accuse-card {
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.player-row.is-current {
  border-color: var(--accent);
  background: #eef8f6;
}

.player-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #172026;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.player-row strong,
.player-row span {
  display: block;
}

.player-row span,
.subtle-text,
.skill-card p,
.accuse-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.skill-panel {
  margin-top: 18px;
}

.declaration-panel {
  margin-top: 18px;
}

.declaration-history-area {
  display: grid;
  gap: 8px;
  max-height: 300px;
  margin-top: 12px;
  overflow: auto;
}

.declaration-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.declaration-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.declaration-row.is-latest {
  border-color: var(--accent);
  background: #eef8f6;
}

.declaration-turn {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.declaration-player {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.declaration-value {
  color: var(--accent-dark);
  font-weight: 900;
}

.skill-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.skill-card h3 {
  font-size: 1rem;
}

.skill-card p {
  margin: 6px 0 0;
}

.skill-action {
  min-width: 96px;
  padding: 0 12px;
}

.reaction-panel,
.log-panel,
.result-panel {
  margin-top: 14px;
}

.reaction-panel {
  display: none !important;
}

.reaction-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 32, 38, 0.58);
}

.reaction-popup {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.reaction-last-play {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 14px 0;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reaction-last-play span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.reaction-last-play strong {
  font-size: 1.1rem;
}

.reaction-timer {
  margin: 14px 0;
}

.reaction-timer-copy {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.reaction-timer-track {
  height: 12px;
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 999px;
}

.reaction-timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #facc15, #ef4444);
  border-radius: inherit;
  transform-origin: left center;
}

.reaction-popup.is-urgent .reaction-timer-fill {
  animation: timerUrgent 240ms ease-in-out infinite alternate;
}

.reaction-popup-actions {
  display: grid;
  gap: 10px;
}

.reaction-popup-section-title {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.reaction-popup-skills {
  margin-top: 4px;
}

.reaction-popup-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reaction-popup-action strong {
  display: block;
}

.reaction-popup-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reaction-popup-buttons .danger-button,
.reaction-popup-buttons .secondary-button {
  width: 100%;
}

.boost-accuse-button {
  color: #7a4a00;
}

.no-accuse-button {
  width: 100%;
  margin-top: 14px;
}

@keyframes timerUrgent {
  from { filter: brightness(1); }
  to { filter: brightness(1.28); }
}

.accuse-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.accuse-card .danger-button {
  min-width: 92px;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.boost-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--gold);
  font-weight: 800;
}

.log-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  margin: 12px 0 0;
  padding-left: 22px;
  overflow: auto;
}

.log-list li {
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.65);
  border-left: 4px solid rgba(15, 118, 110, 0.42);
  border-radius: 6px;
}

.result-panel {
  border-color: rgba(180, 35, 24, 0.28);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 38, 0.62);
}

.peek-modal,
.swap-modal,
.rules-modal {
  width: min(420px, 100%);
  padding: 22px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.swap-modal {
  width: min(620px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  text-align: left;
}

.rules-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  text-align: left;
}

.rules-content {
  display: grid;
  gap: 14px;
}

.rules-content section {
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rules-content h3 {
  color: var(--accent-dark);
  font-size: 1rem;
}

.rules-content p,
.rules-skill-list {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.rules-skill-list {
  display: grid;
  gap: 8px;
}

.rules-skill-list dt {
  color: var(--ink);
  font-weight: 900;
}

.rules-skill-list dd {
  margin: -4px 0 4px;
}

.peek-modal p {
  margin: 16px 0 20px;
  font-size: 1.2rem;
  font-weight: 800;
}

.swap-section {
  margin-top: 18px;
}

.swap-section h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.swap-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.swap-choice-button {
  min-height: 58px;
  padding: 8px;
  background: #eef6f4;
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: var(--accent-dark);
}

.swap-choice-button.is-selected {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.swap-selection {
  margin: 18px 0;
  padding: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.swap-selection p {
  margin: 4px 0;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.accusation-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.12), transparent 22rem),
    linear-gradient(145deg, rgba(10, 18, 28, 0.96), rgba(3, 7, 13, 0.98));
  color: #fff;
  isolation: isolate;
}

.accusation-overlay.is-success {
  background:
    radial-gradient(circle at center, rgba(255, 181, 71, 0.2), transparent 24rem),
    linear-gradient(145deg, rgba(61, 12, 8, 0.98), rgba(11, 6, 5, 0.98));
  animation: limitShake 120ms linear 0s 8;
}

.accusation-overlay.is-failure {
  background:
    radial-gradient(circle at center, rgba(105, 159, 219, 0.18), transparent 24rem),
    linear-gradient(145deg, rgba(16, 28, 43, 0.98), rgba(4, 9, 18, 0.98));
}

.accusation-overlay.is-perfect {
  background:
    radial-gradient(circle at center, rgba(255, 248, 204, 0.28), transparent 25rem),
    linear-gradient(145deg, rgba(91, 61, 8, 0.98), rgba(12, 8, 4, 0.98));
  animation: perfectPulse 420ms ease-in-out infinite alternate;
}

.scan-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 8px
  );
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: scanMove 620ms linear infinite;
}

.burst-lines {
  position: absolute;
  width: 130vmax;
  height: 130vmax;
  z-index: -2;
  background: conic-gradient(
    from 0deg,
    transparent 0 8deg,
    rgba(255, 255, 255, 0.1) 8deg 10deg,
    transparent 10deg 18deg
  );
  opacity: 0.55;
  animation: spinBurst 4s linear infinite;
}

.accusation-stage {
  width: min(680px, 100%);
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 13, 21, 0.72);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  text-align: center;
  backdrop-filter: blur(6px);
  animation: stagePop 360ms ease-out both;
}

.accusation-eyebrow {
  margin: 0 0 10px;
  color: #f8d37b;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.accusation-stage h2 {
  margin: 0;
  font-size: clamp(3rem, 16vw, 7.5rem);
  line-height: 0.95;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.24);
}

.accusation-number {
  display: block;
  margin: 12px 0;
  font-size: clamp(4rem, 22vw, 9rem);
  line-height: 0.9;
  color: #fff;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.34);
}

.accusation-stage p:last-child {
  margin: 12px 0 0;
  font-size: clamp(1rem, 4vw, 1.45rem);
  font-weight: 800;
  line-height: 1.5;
}

.accusation-overlay.is-success .accusation-eyebrow,
.accusation-overlay.is-success .accusation-number {
  color: #ffb347;
}

.accusation-overlay.is-failure .accusation-eyebrow,
.accusation-overlay.is-failure .accusation-number {
  color: #9cc7ff;
}

.accusation-overlay.is-perfect .accusation-eyebrow,
.accusation-overlay.is-perfect .accusation-number {
  color: #fff1a8;
}

.accusation-card-stack {
  position: absolute;
  top: 12%;
  display: flex;
  gap: 12px;
  transform: translateY(-12px);
}

.accusation-card-stack span {
  width: clamp(42px, 10vw, 76px);
  aspect-ratio: 0.72;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
  animation: cardReveal 900ms ease-in-out infinite;
}

.accusation-card-stack span:nth-child(2) {
  animation-delay: 120ms;
}

.accusation-card-stack span:nth-child(3) {
  animation-delay: 240ms;
}

.accusation-card-stack span:nth-child(4) {
  animation-delay: 360ms;
}

@keyframes scanMove {
  from { transform: translateY(0); }
  to { transform: translateY(16px); }
}

@keyframes spinBurst {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes stagePop {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardReveal {
  0%, 100% { transform: rotateY(0deg) translateY(0); }
  45% { transform: rotateY(78deg) translateY(-10px); }
}

@keyframes limitShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(3px, -2px); }
  50% { transform: translate(-3px, 2px); }
  75% { transform: translate(2px, 2px); }
}

@keyframes perfectPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.22); }
}

@keyframes dangerPulse {
  from {
    box-shadow: inset 0 0 110px 32px rgba(220, 38, 38, 0.4);
  }
  to {
    box-shadow: inset 0 0 150px 46px rgba(220, 38, 38, 0.58);
  }
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.result-item {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.result-item strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .setup-screen,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .setup-card,
  .setup-actions,
  .reset-profile-button {
    grid-column: auto;
    grid-row: auto;
  }

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

  .status-card.highlight {
    grid-column: 1 / -1;
  }

  .number-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 560px) {
  .app {
    padding: 12px;
  }

  .game-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .audio-settings-compact {
    width: 100%;
  }

  .ghost-button {
    width: 100%;
  }

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

  .status-card {
    min-height: 76px;
    padding: 12px;
  }

  .status-card strong {
    font-size: 1.2rem;
  }

  .hand-area {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .card-button {
    min-height: 78px;
    font-size: 1.35rem;
  }

  .skill-card,
  .accuse-card {
    grid-template-columns: 1fr;
  }

  .skill-action,
  .accuse-card .danger-button {
    width: 100%;
  }

  .reaction-popup-buttons {
    grid-template-columns: 1fr;
  }

  .reaction-last-play {
    grid-template-columns: 1fr;
  }

  .log-panel .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

}
