:root {
  --felt: #f5f5f7;
  --felt-dark: #d6dbe3;
  --ink: #1d1d1f;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(0, 0, 0, 0.1);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.16);
  --red: #ff3b30;
  --black-suit: #1d1d1f;
  --muted: rgba(29, 29, 31, 0.58);
  --shadow: 0 18px 55px rgba(45, 55, 72, 0.16);
  --card-depth: 0 3px 0 #d9dde5, 0 13px 22px rgba(45, 55, 72, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: white;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9), transparent 22rem),
    radial-gradient(circle at 82% 0%, rgba(0, 122, 255, 0.16), transparent 24rem),
    linear-gradient(135deg, var(--felt), var(--felt-dark));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select {
  font: inherit;
}

button,
select,
input {
  accent-color: var(--accent);
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 680px;
  padding: 16px;
  perspective: 1200px;
}

.table {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.22) 34rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(226, 231, 238, 0.54));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 28px 80px rgba(86, 98, 119, 0.24);
  overflow: hidden;
}

.table::before {
  position: absolute;
  z-index: 0;
  inset: 17% 9% 11%;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.58), rgba(228, 235, 244, 0.2) 54%, rgba(143, 155, 174, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(167, 181, 201, 0.12));
  box-shadow:
    inset 0 9px 18px rgba(255, 255, 255, 0.58),
    inset 0 -24px 42px rgba(90, 105, 128, 0.13),
    0 32px 80px rgba(45, 55, 72, 0.14);
  content: "";
  pointer-events: none;
  transform: rotateX(62deg) translateY(54px) scale(0.94);
  transform-origin: center;
}

.title-page {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid rgba(36, 30, 24, 0.28);
  border-radius: 24px;
  color: #f7efe5;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(126deg, #17130f 0%, #282018 54%, #5b1f1a 100%);
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 28px 68px rgba(7, 11, 18, 0.3);
}

.title-page::before {
  position: absolute;
  inset: 8% 6% 10%;
  border: 1px solid rgba(247, 239, 229, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(247, 239, 229, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.16));
  content: "";
}

.title-page::after {
  position: absolute;
  inset: auto 44px 34px;
  height: 1px;
  background: rgba(247, 239, 229, 0.22);
  content: "";
  pointer-events: none;
}

.title-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 56px;
}

.title-mark {
  position: relative;
  min-height: 520px;
  perspective: 980px;
}

.title-mark::before {
  position: absolute;
  left: 4%;
  top: 60%;
  width: 76%;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.26);
  content: "";
  filter: blur(18px);
  transform: rotate(-7deg);
}

.title-card {
  position: absolute;
  display: grid;
  width: 190px;
  height: 270px;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(46, 37, 28, 0.18);
  border-radius: 9px;
  padding: 18px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fffdf8, #eee7dc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 0 rgba(171, 151, 126, 0.8),
    0 30px 46px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
}

.title-card span {
  font-size: 34px;
  font-weight: 920;
  line-height: 1;
}

.title-card strong {
  display: grid;
  place-items: center;
  font-size: 94px;
  line-height: 1;
}

.title-card-mighty {
  left: 15%;
  top: 20%;
  z-index: 3;
  transform: rotateZ(-12deg) rotateX(7deg) translateZ(44px);
}

.title-card-joker {
  left: 38%;
  top: 8%;
  z-index: 4;
  color: #3f315f;
  transform: rotateZ(5deg) rotateX(9deg) translateZ(72px);
}

.title-card-trump {
  left: 52%;
  top: 32%;
  z-index: 2;
  color: var(--red);
  transform: rotateZ(15deg) rotateX(5deg) translateZ(28px);
}

.title-card-joker::after {
  display: none;
}

.title-copy {
  display: grid;
  justify-items: start;
  gap: 18px;
  min-width: 0;
}

.title-kicker,
.title-tagline {
  margin: 0;
}

.title-kicker {
  color: rgba(247, 239, 229, 0.68);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0;
}

.title-logo {
  margin: 0;
  max-width: 100%;
  color: #fff8ed;
  font-size: clamp(44px, 5vw, 84px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 42px rgba(0, 0, 0, 0.34);
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.title-tagline {
  max-width: 620px;
  color: rgba(247, 239, 229, 0.78);
  font-size: 19px;
  font-weight: 540;
  line-height: 1.7;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.title-start,
.title-guide {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 760;
  text-decoration: none;
}

.title-start {
  border: 1px solid rgba(247, 239, 229, 0.4);
  color: #211811;
  background: #f8ead6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.title-start:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 36px rgba(0, 0, 0, 0.3);
}

.title-guide {
  border: 1px solid rgba(247, 239, 229, 0.22);
  color: #f7efe5;
  background: rgba(247, 239, 229, 0.08);
}

.title-guide:hover {
  background: rgba(255, 255, 255, 0.16);
}

.status-panel {
  position: absolute;
  z-index: 25;
  left: 18px;
  top: 18px;
  width: min(320px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.trick-log {
  position: absolute;
  z-index: 24;
  right: 18px;
  top: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  max-height: 300px;
  gap: 8px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.trick-log-title {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
}

.trick-log-item {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
}

.trick-log-item strong {
  color: var(--ink);
}

.trick-log-item span {
  color: rgba(29, 29, 31, 0.68);
}

.status-phase-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.status-bar-turn,
.status-bar-trick {
  font-size: 12.5px;
  color: rgba(29, 29, 31, 0.78);
  font-weight: 600;
}

.status-bar-trick {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.status-bar .guide-link {
  margin-left: 4px;
}

.contract-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 8px;
}

.contract-item {
  display: grid;
  min-height: 52px;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.contract-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--accent);
  padding: 4px 0;
  user-select: none;
}

.status-details summary::-webkit-details-marker {
  display: none;
}

.status-details summary::after {
  content: " ▾";
  font-size: 9px;
}

.status-details[open] summary::after {
  content: " ▴";
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.guide-link {
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent);
  background: rgba(0, 122, 255, 0.1);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.guide-link:hover {
  background: rgba(0, 122, 255, 0.16);
}

.status-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 10px;
  align-items: center;
  font-size: 13px;
}

.status-label {
  color: var(--muted);
}

.status-value {
  min-height: 22px;
  font-weight: 700;
  color: var(--ink);
}

.bid-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.bid-summary-title {
  color: var(--accent);
  font-weight: 800;
}

.bid-summary-current,
.bid-history-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
}

.bid-summary-current span,
.bid-history-item span {
  color: var(--muted);
}

.bid-summary-current strong,
.bid-history-item strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 760;
}

.bid-history {
  display: grid;
  gap: 5px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  min-height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 5px 14px rgba(45, 55, 72, 0.1);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.btn:hover:not(:disabled) {
  background: white;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 9px 18px rgba(45, 55, 72, 0.14);
}

.btn.primary {
  color: white;
  border-color: rgba(0, 122, 255, 0.64);
  background: var(--accent);
  font-weight: 760;
}

.btn.primary:hover:not(:disabled) {
  background: #0a84ff;
}

.btn.danger {
  color: white;
  border-color: rgba(255, 59, 48, 0.5);
  background: rgba(255, 59, 48, 0.88);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.select {
  min-height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.lead-watermark {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: min(38vw, 430px);
  font-weight: 900;
  line-height: 1;
  color: rgba(29, 29, 31, 0.055);
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.55);
}

.lead-watermark.idle {
  gap: 0.08em;
  font-size: min(12vw, 150px);
  letter-spacing: 0;
  color: rgba(29, 29, 31, 0.05);
  text-shadow: none;
  transform: rotate(-8deg);
}

.lead-watermark.has-lead {
  transform: none;
}

.suit-black {
  color: var(--black-suit);
}

.suit-red {
  color: var(--red);
}

.card.suit-red,
.mini-card.suit-red {
  color: var(--red);
  border-bottom-width: 3px;
  border-bottom-style: double;
  border-bottom-color: rgba(209, 43, 43, 0.55);
}

.card.suit-black,
.mini-card.suit-black {
  color: var(--black-suit);
}

.suit-glow {
  text-shadow:
    0 0 1px white,
    0 0 4px rgba(255, 255, 255, 0.84),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.players {
  position: absolute;
  z-index: 10;
  inset: 0;
  transform-style: preserve-3d;
}

.player {
  position: absolute;
  display: grid;
  gap: 8px;
  width: 210px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(45, 55, 72, 0.12);
  backdrop-filter: blur(18px) saturate(1.24);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  transform-style: preserve-3d;
}

.player.active {
  border-color: rgba(0, 122, 255, 0.52);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 18px 38px rgba(45, 55, 72, 0.18);
}

.player.active.thinking {
  animation: player-thinking 1.6s ease-in-out infinite;
}

@keyframes player-thinking {
  0%, 100% {
    box-shadow:
      0 0 0 4px var(--accent-soft),
      0 18px 38px rgba(45, 55, 72, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 9px rgba(0, 122, 255, 0.32),
      0 22px 46px rgba(0, 122, 255, 0.28);
  }
}

.player.napoleon {
  background: rgba(255, 244, 238, 0.82);
}

.player.ally {
  background: rgba(235, 244, 255, 0.82);
}

.player.just-revealed {
  animation: ally-reveal 1600ms ease-out;
}

.player.just-revealed .badge {
  animation: ally-badge-pop 720ms ease-out;
}

@keyframes ally-reveal {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    background: rgba(190, 220, 255, 0.95);
  }
  35% {
    box-shadow: 0 0 0 12px rgba(0, 122, 255, 0.42), 0 24px 50px rgba(0, 122, 255, 0.32);
    background: rgba(210, 230, 255, 0.95);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    background: rgba(235, 244, 255, 0.82);
  }
}

@keyframes ally-badge-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.player-0 {
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 36px));
}

.player-1 {
  left: 18px;
  bottom: 220px;
}

.player-2 {
  left: 26%;
  top: 18px;
}

.player-3 {
  right: 26%;
  top: 18px;
}

.player-4 {
  right: 18px;
  bottom: 220px;
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.player-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.badge-row {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.player-bid {
  overflow: hidden;
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--ink);
  background: rgba(0, 122, 255, 0.1);
  font-size: 12px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-badge {
  color: white;
  border-color: rgba(0, 122, 255, 0.72);
  background: var(--accent);
  font-weight: 800;
}

.capture-row {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.mini-card {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 820;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 5px 12px rgba(45, 55, 72, 0.13);
}

.hand-count {
  color: var(--muted);
  font-size: 12px;
}

.center-area {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  display: grid;
  width: min(620px, calc(100vw - 380px));
  min-width: 360px;
  transform: translate(-50%, -50%);
  gap: 12px;
  transform-style: preserve-3d;
}

.message {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-weight: 680;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.trick-zone {
  position: relative;
  height: 300px;
  perspective: 760px;
  transform-style: preserve-3d;
}

.played-card {
  position: absolute;
  transform: translate(-50%, -50%) rotateX(12deg);
  transform-style: preserve-3d;
}

.played-card .card {
  transform: translateZ(12px);
  box-shadow: var(--card-depth);
}

.played-0 {
  left: 50%;
  top: 86%;
  transform: translate(-50%, -50%) rotateX(10deg);
}

.played-1 {
  left: 16%;
  top: 62%;
  transform: translate(-50%, -50%) rotateX(12deg) rotateZ(-12deg);
}

.played-2 {
  left: 33%;
  top: 18%;
  transform: translate(-50%, -50%) rotateX(16deg) rotateZ(-5deg);
}

.played-3 {
  left: 67%;
  top: 18%;
  transform: translate(-50%, -50%) rotateX(16deg) rotateZ(5deg);
}

.played-4 {
  left: 84%;
  top: 62%;
  transform: translate(-50%, -50%) rotateX(12deg) rotateZ(12deg);
}

.played-card.latest .card {
  animation: played-enter 320ms ease-out;
}

@keyframes played-enter {
  from { opacity: 0; transform: translateZ(72px) scale(1.18); }
  to { opacity: 1; transform: translateZ(12px) scale(1); }
}

.played-card.winning .card {
  animation: winning-pulse 1.4s ease-out;
  box-shadow: 0 0 0 3px rgba(255, 211, 102, 0.95), 0 18px 32px rgba(255, 184, 64, 0.45);
  transform: translateZ(28px) scale(1.12);
  z-index: 5;
}

@keyframes winning-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 211, 102, 0); transform: translateZ(12px) scale(1); }
  35% { box-shadow: 0 0 0 8px rgba(255, 211, 102, 0.55), 0 22px 38px rgba(255, 184, 64, 0.55); transform: translateZ(28px) scale(1.16); }
  100% { box-shadow: 0 0 0 3px rgba(255, 211, 102, 0.95), 0 18px 32px rgba(255, 184, 64, 0.45); transform: translateZ(28px) scale(1.12); }
}

.trick-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 16px 20px;
  min-width: 240px;
  max-width: min(88%, 480px);
  border: 1px solid rgba(255, 211, 102, 0.34);
  border-radius: 10px;
  background: rgba(18, 20, 30, 0.92);
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42), 0 0 28px rgba(255, 184, 64, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: trick-banner-in 240ms ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.trick-banner strong {
  font-size: 16px;
  color: #ffd366;
}

.trick-banner span {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.trick-banner .trick-banner-card {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 211, 102, 0.14);
  color: #ffe8a8;
  font-weight: 700;
}

.trick-next {
  min-height: 34px;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid rgba(255, 211, 102, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe29a, #f2b84b);
  color: #2a1a06;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.trick-next:hover {
  filter: brightness(1.05);
}

.trick-next:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

@keyframes trick-banner-in {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.hand {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 18px;
  display: flex;
  width: min(980px, calc(100vw - 36px));
  min-height: 108px;
  justify-content: center;
  gap: 6px;
  transform: translateX(-50%) rotateX(7deg);
  transform-origin: center bottom;
  transform-style: preserve-3d;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.hand.bidding {
  z-index: 45;
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 -10px 30px rgba(45, 55, 72, 0.12);
}

.card {
  position: relative;
  display: grid;
  width: 62px;
  height: 88px;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 8px;
  padding: 6px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 249, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    var(--card-depth);
  transform-style: preserve-3d;
  user-select: none;
}

.card::before {
  position: absolute;
  z-index: -1;
  inset: 5px -3px -5px 3px;
  border-radius: inherit;
  background: linear-gradient(135deg, #c9ced7, #eef1f5 56%, #b9c0cc);
  box-shadow: 0 6px 11px rgba(45, 55, 72, 0.16);
  content: "";
  transform: translateZ(-5px);
}

.hand .card {
  transform: rotateX(-7deg) translateZ(0);
}

.hand .card:nth-child(1) {
  transform: rotateX(-7deg) rotateZ(-6deg) translateY(8px);
}

.hand .card:nth-child(2) {
  transform: rotateX(-7deg) rotateZ(-4deg) translateY(4px);
}

.hand .card:nth-child(3) {
  transform: rotateX(-7deg) rotateZ(-2deg) translateY(1px);
}

.hand .card:nth-child(4) {
  transform: rotateX(-7deg) rotateZ(-1deg);
}

.hand .card:nth-child(7) {
  transform: rotateX(-7deg) rotateZ(1deg);
}

.hand .card:nth-child(8) {
  transform: rotateX(-7deg) rotateZ(2deg) translateY(1px);
}

.hand .card:nth-child(9) {
  transform: rotateX(-7deg) rotateZ(3deg) translateY(3px);
}

.hand .card:nth-child(10) {
  transform: rotateX(-7deg) rotateZ(4deg) translateY(5px);
}

.hand .card:nth-child(11) {
  transform: rotateX(-7deg) rotateZ(5deg) translateY(6px);
}

.hand .card:nth-child(12) {
  transform: rotateX(-7deg) rotateZ(6deg) translateY(7px);
}

.hand .card:nth-child(13) {
  transform: rotateX(-7deg) rotateZ(7deg) translateY(8px);
}

.card.clickable {
  cursor: pointer;
  outline: 2px solid rgba(0, 122, 255, 0.28);
  outline-offset: 2px;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.card.clickable:focus-visible {
  outline: 3px solid #ffd366;
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(255, 211, 102, 0.45);
}

.card.recommended {
  outline: 3px solid #34c759;
  outline-offset: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 22px rgba(52, 199, 89, 0.45);
  position: relative;
}

.card.recommended::before {
  content: "推奨";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #34c759;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  z-index: 5;
}

.hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  margin-right: 6px;
}

.hand .card.clickable:not(.disabled):not(.selected) {
  outline-color: rgba(0, 122, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(0, 122, 255, 0.22);
}

.card.clickable:hover {
  transform: rotateX(-13deg) translateY(-10px) translateZ(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 3px 0 #d9dde5,
    0 24px 34px rgba(45, 55, 72, 0.25);
}

.card.disabled {
  cursor: not-allowed;
  filter: grayscale(0.85) brightness(0.5);
}

.card.selected {
  transform: rotateX(-14deg) translateY(-18px) translateZ(22px);
  outline: 3px solid var(--accent);
}

.card-rank {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.card-suit {
  display: grid;
  place-items: center;
  font-size: 31px;
  font-weight: 900;
}

.card-foot {
  justify-self: end;
  font-size: 13px;
  font-weight: 900;
  transform: rotate(180deg);
}

.joker-card {
  color: #5e35b1;
  background: linear-gradient(145deg, #ffffff, #f1edff);
}

.controls-panel {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 142px;
  display: grid;
  width: min(640px, calc(100vw - 36px));
  transform: translateX(-50%);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 18px 45px rgba(45, 55, 72, 0.2);
}

.action-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hint-inline {
  display: inline;
  text-align: left;
  margin-left: 4px;
}

.adjutant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.adjutant-pick {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.adjutant-pick:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.adjutant-pick.in-hand {
  background: rgba(255, 211, 102, 0.4);
  border-color: rgba(180, 130, 0, 0.4);
}

.adjutant-hand-warn {
  font-size: 10.5px;
  margin-left: 4px;
  color: rgba(120, 80, 0, 0.85);
}

.result {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(245, 245, 247, 0.42);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.result-box {
  width: min(640px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(45, 55, 72, 0.24);
  text-align: center;
}

.result-section-title {
  margin: 18px 0 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(29, 29, 31, 0.7);
  text-align: left;
}

.result-breakdown,
.result-replay {
  margin-top: 12px;
  text-align: left;
}

.result-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  margin-bottom: 6px;
}

.result-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.result-row-head .badge {
  font-size: 11px;
  padding: 2px 8px;
}

.result-points {
  margin-left: auto;
  font-weight: 700;
  color: var(--ink);
}

.result-captures {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.result-empty {
  font-size: 12px;
  color: rgba(29, 29, 31, 0.5);
}

.result-trick {
  margin-bottom: 4px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

.result-trick summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.result-plays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.result-play {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.result-play.suit-red {
  color: #d12b2b;
}

.result-play.suit-black {
  color: #1a1a1a;
}

.result-play.result-play-winner {
  background: #ffd366;
  border-color: rgba(180, 130, 0, 0.4);
  font-weight: 700;
}

.result-reason {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(29, 29, 31, 0.72);
}

.title-stats {
  margin-top: 14px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: rgba(29, 29, 31, 0.72);
}

.title-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
}

.title-stats-row strong {
  color: var(--ink);
}

.result-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 30px;
}

.result-text {
  margin: 0 0 18px;
  color: rgba(29, 29, 31, 0.72);
}

.guide-body {
  min-height: 100vh;
  color: var(--ink);
  overflow: auto;
}

.guide-body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.guide-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.guide-hero {
  min-height: 86vh;
  padding: 22px;
  border-bottom: 1px solid rgba(46, 37, 28, 0.12);
  background:
    linear-gradient(90deg, rgba(46, 37, 28, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(46, 37, 28, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbf7ef, #eef2f7);
  background-size: 36px 36px, 36px 36px, auto;
}

.guide-nav {
  display: flex;
  max-width: 1440px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
}

.guide-brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  text-decoration: none;
}

.guide-hero-inner {
  display: grid;
  max-width: 1440px;
  min-height: calc(86vh - 92px);
  grid-template-columns: minmax(580px, 0.98fr) minmax(340px, 0.76fr);
  align-items: center;
  gap: 40px;
  margin: 0 auto;
  padding: 44px 0 30px;
}

.guide-hero-copy h1,
.guide-section h2,
.guide-cta h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

budoux-ja {
  display: inline;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.guide-hero-copy {
  min-width: 0;
}

.guide-hero-copy h1 {
  max-width: 100%;
  font-size: clamp(42px, 4vw, 64px);
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.guide-hero-line {
  display: block;
}

@media (min-width: 981px) {
  .guide-hero-line {
    white-space: nowrap;
  }
}

.guide-hero-copy p,
.guide-section p,
.guide-tips,
.guide-flow p,
.guide-steps p,
.rulebook-card li,
.rulebook-footnote {
  color: rgba(29, 29, 31, 0.7);
  line-height: 1.75;
}

.guide-hero-copy > p:last-child {
  max-width: 680px;
  margin: 24px 0 0;
  font-size: 18px;
}

.guide-kicker {
  margin: 0 0 10px;
  color: #8a392f;
  font-size: 13px;
  font-weight: 800;
}

.guide-tableau {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: center;
}

.guide-tableau::before {
  position: absolute;
  inset: 13% 4% 18%;
  border: 1px solid rgba(46, 37, 28, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(238, 231, 219, 0.24)),
    linear-gradient(180deg, rgba(46, 37, 28, 0.02), rgba(46, 37, 28, 0.1));
  content: "";
  transform: rotate(-2deg);
}

.guide-card-stack {
  position: relative;
  z-index: 1;
  width: 330px;
  height: 250px;
}

.guide-playing-card {
  position: absolute;
  display: grid;
  width: 128px;
  height: 180px;
  place-items: center;
  border: 1px solid rgba(46, 37, 28, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #eee7dc);
  box-shadow: var(--card-depth);
  font-size: 38px;
  font-weight: 880;
}

.guide-card-a {
  left: 12px;
  top: 34px;
  transform: rotate(-12deg);
}

.guide-card-b {
  left: 104px;
  top: 4px;
  transform: rotate(4deg);
}

.guide-card-c {
  right: 6px;
  top: 52px;
  transform: rotate(14deg);
}

.guide-score-race {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(360px, 100%);
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 14px 34px rgba(45, 55, 72, 0.12);
}

.guide-score-race div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(246, 241, 232, 0.7);
}

.guide-score-race span,
.guide-score-race p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.guide-score-race strong {
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.guide-score-race p {
  grid-column: 1 / -1;
  text-align: center;
}

.guide-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 54px 22px 70px;
}

.guide-section {
  padding: 42px 0;
}

.guide-section + .guide-section {
  border-top: 1px solid rgba(46, 37, 28, 0.12);
}

.guide-section-head {
  max-width: 720px;
  margin-bottom: 22px;
}

.guide-section h2,
.guide-cta h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.guide-steps,
.guide-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guide-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-steps article,
.guide-flow article,
.guide-role,
.guide-strength-list li,
.guide-note,
.rulebook-card,
.rulebook-toc a {
  border: 1px solid rgba(46, 37, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: 0 9px 22px rgba(45, 55, 72, 0.06);
}

.guide-steps article,
.guide-flow article {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.guide-step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #f9efe5;
  background: #8a392f;
  font-weight: 820;
}

.guide-steps h3,
.guide-flow h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.guide-steps p,
.guide-flow p {
  margin: 0;
  font-size: 14px;
}

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  align-items: center;
  gap: 34px;
}

.guide-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.guide-role {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
  padding: 20px;
}

.guide-role strong {
  font-size: 22px;
}

.guide-role span,
.guide-tips li {
  color: rgba(29, 29, 31, 0.66);
}

.napoleon-role {
  background: rgba(255, 241, 232, 0.86);
}

.hidden-role {
  background: rgba(235, 244, 255, 0.82);
}

.coalition-role {
  grid-column: 1 / -1;
}

.guide-strength-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-strength-list li {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.guide-strength-list span {
  color: #8a392f;
  font-weight: 820;
}

.guide-strength-list strong {
  color: var(--ink);
  font-weight: 760;
}

.guide-note {
  margin-top: 14px;
  padding: 16px;
  color: rgba(29, 29, 31, 0.72);
  line-height: 1.7;
}

.guide-note strong {
  color: var(--ink);
}

.rulebook {
  scroll-margin-top: 18px;
}

.rulebook-hero {
  padding: 22px;
  border-bottom: 1px solid rgba(46, 37, 28, 0.12);
  background:
    linear-gradient(90deg, rgba(46, 37, 28, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(46, 37, 28, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbf7ef, #eef2f7);
  background-size: 36px 36px, 36px 36px, auto;
}

.rulebook-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rulebook-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 58px 0 24px;
}

.rulebook-hero h1 {
  max-width: 860px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.rulebook-hero p:not(.guide-kicker) {
  max-width: 720px;
  color: rgba(29, 29, 31, 0.7);
  font-size: 18px;
  line-height: 1.75;
}

.rulebook-main {
  padding-top: 34px;
}

.rulebook-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 18px;
}

.rulebook-toc a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 13px;
  color: #8a392f;
  font-size: 13px;
  font-weight: 820;
  text-decoration: none;
}

.rulebook-toc a:hover {
  background: rgba(255, 246, 232, 0.92);
}

.rulebook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rulebook-card {
  scroll-margin-top: 18px;
  padding: 20px;
}

.rulebook-card h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 22px;
}

.rulebook-card h4 {
  margin: 18px 0 8px;
  color: #8a392f;
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0.02em;
}

.rulebook-card h4:first-of-type {
  margin-top: 4px;
}

.rulebook-card ul,
.rule-rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.15em;
}

.rulebook-wide {
  margin-top: 12px;
}

.rule-rank-list {
  padding-left: 0;
  list-style: none;
}

.rule-rank-list li {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(46, 37, 28, 0.1);
}

.rule-rank-list li:first-child {
  border-top: 0;
}

.rule-rank-list span {
  color: #8a392f;
  font-weight: 820;
}

.rule-rank-list strong {
  color: var(--ink);
  font-weight: 760;
}

.rulebook-footnote {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(46, 37, 28, 0.1);
}

.guide-tips {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-tips li {
  position: relative;
  padding: 12px 12px 12px 34px;
  border: 1px solid rgba(46, 37, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.guide-tips li::before {
  position: absolute;
  left: 14px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a392f;
  content: "";
}

.guide-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 24px;
  border: 1px solid rgba(46, 37, 28, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: 0 14px 34px rgba(45, 55, 72, 0.1);
}

.guide-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    padding: 8px;
  }

  .table {
    display: flex;
    min-height: calc(100vh - 16px);
    height: auto;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    padding: 10px;
  }

  .table::before {
    inset: 15% 2% 22%;
    transform: rotateX(64deg) translateY(24px) scale(1.08);
  }

  .lead-watermark {
    position: fixed;
    font-size: min(48vw, 220px);
  }

  .lead-watermark.idle {
    font-size: min(16vw, 76px);
  }

  .title-page {
    min-height: calc(100vh - 16px);
    height: auto;
  }

  .title-stage {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 36px 24px 24px;
  }

  .title-mark {
    order: 2;
    min-height: 310px;
  }

  .title-copy {
    order: 1;
  }

  .title-card {
    width: 132px;
    height: 188px;
    padding: 14px;
  }

  .title-card span {
    font-size: 25px;
  }

  .title-card strong {
    font-size: 66px;
  }

  .title-card-mighty {
    left: 10%;
    top: 20%;
  }

  .title-card-joker {
    left: 34%;
    top: 8%;
  }

  .title-card-trump {
    left: 55%;
    top: 26%;
  }

  .title-tagline {
    font-size: 17px;
  }

  .status-panel,
  .trick-log,
  .players,
  .center-area,
  .hand,
  .controls-panel {
    position: static;
    width: 100%;
    transform: none;
  }

  .status-panel {
    order: 1;
  }

  .contract-summary {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
  }

  .contract-item {
    min-height: 48px;
  }

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

  .trick-log {
    order: 4;
    max-height: 138px;
  }

  .players {
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    z-index: 18;
  }

  .player {
    position: static;
    width: auto;
    min-width: 0;
  }

  .player-0 {
    grid-column: 1 / -1;
    transform: none;
  }

  .center-area {
    order: 2;
    z-index: 20;
    min-width: 0;
  }

  .message {
    min-height: auto;
  }

  .trick-zone {
    height: 250px;
  }

  .controls-panel {
    order: 5;
    z-index: 32;
    padding: 12px 10px;
  }

  .hand {
    order: 6;
    z-index: 30;
    min-height: 96px;
    overflow-x: auto;
    justify-content: flex-start;
    transform: none;
    padding-bottom: 14px;
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.08);
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 0;
  }

  .controls-panel {
    position: sticky;
    bottom: 110px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.06);
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 0;
  }

  .hand .card,
  .hand .card:nth-child(n) {
    transform: none;
  }

  .card.clickable:hover,
  .card.selected {
    transform: translateY(-8px);
  }

  .card {
    width: 50px;
    height: 74px;
    padding: 5px;
  }

  .card-suit {
    font-size: 25px;
  }

  .controls-row {
    align-items: stretch;
  }

  .controls-row .btn,
  .controls-row .select {
    flex: 1 1 138px;
  }

  .guide-hero {
    min-height: auto;
    padding: 14px;
  }

  .guide-hero-inner,
  .guide-split {
    grid-template-columns: 1fr;
  }

  .guide-hero-inner {
    min-height: auto;
    gap: 24px;
    padding: 46px 0 22px;
  }

  .guide-hero-copy h1 {
    font-size: clamp(34px, 8.5vw, 50px);
    line-height: 1.04;
  }

  .guide-tableau {
    min-height: 330px;
  }

  .guide-steps,
  .guide-flow,
  .rulebook-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-strength-list li,
  .rule-rank-list li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .title-stage {
    padding: 28px 18px 20px;
  }

  .title-mark {
    min-height: 246px;
  }

  .title-logo {
    font-size: clamp(38px, 12.5vw, 58px);
  }

  .title-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .title-start,
  .title-guide {
    width: 100%;
  }

  .title-card {
    width: 104px;
    height: 148px;
    border-radius: 9px;
  }

  .title-card strong {
    font-size: 48px;
  }

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

  .trick-zone {
    height: 220px;
  }

  .played-card .card {
    width: 46px;
    height: 68px;
  }

  .played-1 {
    left: 12%;
  }

  .played-4 {
    left: 88%;
  }

  .guide-nav,
  .guide-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-nav .btn,
  .guide-cta .btn,
  .rulebook-nav-actions .btn {
    width: 100%;
  }

  .guide-cta-actions,
  .rulebook-nav-actions {
    width: 100%;
  }

  .guide-steps,
  .guide-flow,
  .guide-role-grid,
  .rulebook-grid {
    grid-template-columns: 1fr;
  }

  .guide-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-hero-actions .btn {
    width: 100%;
  }

  .coalition-role {
    grid-column: auto;
  }

  .guide-card-stack {
    width: 280px;
    height: 206px;
  }

  .guide-playing-card {
    width: 98px;
    height: 140px;
    font-size: 29px;
  }
}

/* ============================================================
   特殊カード登場フラッシュ
   ============================================================ */
.special-fx {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  --fx-color: rgba(255, 211, 102, 0.6);
  --fx-color-strong: rgba(255, 184, 64, 0.9);
  --fx-text-from: #fff8d6;
  --fx-text-to: #ffb547;
  animation: special-fx-fade 1300ms ease-out forwards;
}

.special-fx-mighty {
  --fx-color: rgba(255, 211, 102, 0.6);
  --fx-color-strong: rgba(255, 184, 64, 0.95);
  --fx-text-from: #fff8d6;
  --fx-text-to: #ffb547;
}

.special-fx-right {
  --fx-color: rgba(80, 140, 255, 0.55);
  --fx-color-strong: rgba(40, 110, 255, 0.95);
  --fx-text-from: #e6efff;
  --fx-text-to: #4a8cff;
}

.special-fx-left {
  --fx-color: rgba(120, 200, 255, 0.55);
  --fx-color-strong: rgba(80, 180, 255, 0.95);
  --fx-text-from: #e9f6ff;
  --fx-text-to: #58b6ff;
}

.special-fx-joker {
  --fx-color: rgba(190, 120, 255, 0.6);
  --fx-color-strong: rgba(160, 80, 255, 0.95);
  --fx-text-from: #f4e6ff;
  --fx-text-to: #b46cff;
}

.special-fx-hunt {
  --fx-color: rgba(255, 90, 90, 0.6);
  --fx-color-strong: rgba(220, 50, 50, 0.95);
  --fx-text-from: #ffe4e0;
  --fx-text-to: #ff5a5a;
}

.special-fx-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, var(--fx-color) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, var(--fx-color-strong) 0%, transparent 22%);
  animation: special-fx-glow 1300ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  filter: blur(2px);
}

.special-fx-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.special-fx-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: var(--fx-color-strong);
  box-shadow: 0 0 18px var(--fx-color-strong);
  opacity: 0;
  animation: special-fx-particle 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
  transform: rotate(var(--angle)) translateX(0) scale(0.4);
}

.special-fx-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: special-fx-text 1300ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
}

.special-fx-icon {
  font-size: clamp(72px, 14vw, 180px);
  font-weight: 900;
  line-height: 0.9;
  background: linear-gradient(180deg, var(--fx-text-from), var(--fx-text-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px var(--fx-color-strong);
}

.special-fx-label {
  font-size: clamp(28px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, var(--fx-text-from), var(--fx-text-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.special-fx-sub {
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

@keyframes special-fx-fade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes special-fx-glow {
  0% { transform: scale(0.35); opacity: 0; }
  28% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes special-fx-text {
  0% { transform: translateY(24px) scale(0.55); opacity: 0; }
  22% { transform: translateY(0) scale(1.02); opacity: 1; }
  78% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-6px) scale(1.06); opacity: 0; }
}

@keyframes special-fx-particle {
  0% { opacity: 0; transform: rotate(var(--angle)) translateX(0) scale(0.4); }
  18% { opacity: 1; transform: rotate(var(--angle)) translateX(60px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--angle)) translateX(min(38vw, 360px)) scale(0.2); }
}

body.shake-mighty,
body.shake-joker,
body.shake-hunt {
  animation: stage-shake 420ms ease-out;
}

@keyframes stage-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -1px); }
}

@media (prefers-reduced-motion: reduce) {
  .special-fx,
  .special-fx-glow,
  .special-fx-text,
  .special-fx-particle {
    animation-duration: 600ms !important;
  }
  body.shake-mighty,
  body.shake-joker,
  body.shake-hunt {
    animation: none;
  }
}

/* ============================================================
   局終了の祝祭／哀愁演出
   ============================================================ */
.endgame-canvas {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.endgame-canvas-ash {
  z-index: 95;
}

.endgame-banner {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 44px;
  pointer-events: none;
  animation: endgame-banner-in 2400ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  text-align: center;
  filter: drop-shadow(0 14px 40px rgba(0, 0, 0, 0.6));
}

.endgame-laurel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: clamp(40px, 8vw, 92px);
  font-weight: 900;
  letter-spacing: 0.22em;
}

.endgame-laurel .laurel-text {
  background: linear-gradient(180deg, #fff8d6, #ffb547);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 36px rgba(255, 184, 64, 0.55);
}

.endgame-laurel .laurel-left,
.endgame-laurel .laurel-right {
  font-size: 0.7em;
  color: rgba(255, 220, 130, 0.85);
}

.endgame-defeat .endgame-laurel .laurel-text {
  background: linear-gradient(180deg, #d8d8e0, #6a6a78);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 28px rgba(0, 0, 0, 0.55);
}

.endgame-defeat .endgame-laurel .laurel-left,
.endgame-defeat .endgame-laurel .laurel-right {
  color: rgba(180, 180, 200, 0.7);
}

.endgame-sub {
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 700;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.endgame-defeat .endgame-sub {
  color: rgba(220, 220, 230, 0.85);
}

@keyframes endgame-banner-in {
  0% { opacity: 0; transform: translate(-50%, -70%) scale(0.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  28% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .endgame-banner {
    animation-duration: 1200ms;
  }
}
