:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1f2933;
  background: #f4f7fb;
}

header,
main,
footer {
  width: min(90%, 960px);
  margin: 0 auto;
}

header,
footer {
  padding: 1rem 0;
  text-align: center;
  color: #4a5568;
}

main {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.4);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.message {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.message-info {
  background: #e0f2fe;
  color: #075985;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

.message-success {
  background: #dcfce7;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.35);
}

.message-warning {
  background: #fef9c3;
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.35);
}

.message-error {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

h1,
h2,
h3 {
  font-weight: 600;
  margin-top: 0;
  color: #0f172a;
}

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

a:hover,
a:focus {
  text-decoration: underline;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 12px 30px -18px rgba(37, 99, 235, 0.9);
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 35px -20px rgba(29, 78, 216, 0.8);
}

button:active,
.button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

button:disabled,
.button:disabled {
  cursor: not-allowed;
  background: #a5b4fc;
  box-shadow: none;
}

.easter-egg-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 18px 40px -22px rgba(15, 23, 42, 0.45);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.easter-egg-toggle:hover,
.easter-egg-toggle:focus {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px -24px rgba(15, 23, 42, 0.8);
}

.easter-egg-toggle:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.easter-egg-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.play-action-container {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.table-bottom-actions {
  width: min(100%, 820px);
  margin: clamp(1.25rem, 4vw, 2.25rem) auto clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.15rem);
  text-align: center;
}

.table-bottom-actions__error {
  width: 100%;
  flex: 1 0 100%;
  color: #b91c1c;
  font-weight: 600;
}

.table-bottom-actions__error:empty {
  display: none;
}

.table-bottom-actions .play-action-container {
  margin-bottom: 0;
  align-items: center;
  gap: 0.75rem;
}

.action-btn.collect-highlight {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.58), 0 18px 36px -18px rgba(245, 158, 11, 0.55);
  filter: brightness(1.08);
}

ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

ul li {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

ul li a {
  display: inline-block;
  font-weight: 600;
}

#players li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#players li strong {
  flex: 0 0 auto;
}

#players li .status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
  margin-right: auto;
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
}

#players li .ready-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

#players li.player-ready {
  background: #ecfdf5;
  border-left-color: #10b981;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}

#players li.player-waiting {
  background: #fff7ed;
  border-left-color: #f97316;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.2);
}

#players li.player-ready .status {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

#players li.player-waiting .status {
  background: rgba(249, 115, 22, 0.2);
  color: #b45309;
}

#players li.current-turn {
  border-left-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

#players li.current-turn strong {
  color: #1d4ed8;
}

.card-visual {
  width: 96px;
  height: 134px;
  border-radius: 12px;
  border: 2px solid #1f2937;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 700;
  color: #1f2937;
  box-shadow: 0 18px 30px -22px rgba(30, 41, 59, 0.65);
  position: relative;
}

.card-visual.red {
  border-color: #ef4444;
  color: #ef4444;
}

.card-corner {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-corner.top-left {
  top: 4px;
  left: 4px;
}

.card-corner.bottom-right {
  bottom: 4px;
  right: 4px;
  transform: rotate(180deg);
}

.card-name {
  margin: 0;
  font-weight: 600;
}

.error-message,
.messages .error,
.messages .errorlist,
.errorlist {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

form {
  display: grid;
  gap: 1rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* --- Game table layout -------------------------------------------------- */

#table,
.table {
  position: relative;
  margin: clamp(2rem, 6vw, 3.5rem) auto;
  width: min(100%, 820px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: clamp(1.75rem, 5vw, 3.25rem);
  background: radial-gradient(circle at 35% 25%, rgba(30, 58, 138, 0.22), rgba(15, 23, 42, 0.92));
  box-shadow: 0 28px 70px -38px rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: box-shadow 0.35s ease, filter 0.35s ease;
}

#table::before,
.table::before {
  content: "";
  position: absolute;
  inset: clamp(1.25rem, 4vw, 2.4rem);
  border-radius: 50%;
  border: 2px dashed rgba(148, 163, 184, 0.35);
  pointer-events: none;
}

#player-decks {
  position: absolute;
  inset: clamp(0.75rem, 6vw, 3rem);
  pointer-events: none;
}

#player-decks .player-deck {
  --deck-padding-y: clamp(0.45rem, 1.4vw, 0.85rem);
  --deck-padding-x: clamp(0.6rem, 2vw, 1.15rem);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center;
  width: clamp(110px, 30vw, 180px);
  height: calc(clamp(68px, 18vw, 96px) + var(--deck-padding-y) * 2);
  padding: var(--deck-padding-y) var(--deck-padding-x);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  box-shadow: 0 22px 38px -26px rgba(15, 23, 42, 0.8);
  pointer-events: auto;
  z-index: 5;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

#player-decks .player-deck .deck-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 0.95rem);
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  height: 100%;
}

#player-decks .player-deck.current-turn {
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.55),
    0 28px 60px -26px rgba(59, 130, 246, 0.65);
  transform: translate(-50%, -50%) scale(1.04);
}

#player-decks .player-deck.current-turn:hover,
#player-decks .player-deck.current-turn:focus-within {
  transform: translate(-50%, -50%) scale(1.06);
}

#player-decks .player-deck.current-turn .deck-count {
  color: #dbeafe;
}

#player-decks .player-deck.player-deck-solo {
  left: 50%;
  top: 78%;
  transform: translate(-50%, -50%);
}

#player-decks .player-deck:hover,
#player-decks .player-deck:focus-within {
  box-shadow: 0 26px 52px -28px rgba(59, 130, 246, 0.55);
  transform: translate(-50%, -50%) scale(1.03);
}

#player-decks .player-deck.player-deck-self-clickable {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, outline 0.2s ease;
}

#player-decks .player-deck.player-deck-self-clickable:focus {
  outline: none;
}

#player-decks .player-deck.player-deck-self-clickable:hover,
#player-decks .player-deck.player-deck-self-clickable:focus-visible {
  box-shadow:
    0 0 0 3px rgba(251, 191, 36, 0.6),
    0 30px 68px -28px rgba(245, 158, 11, 0.55),
    0 22px 38px -26px rgba(15, 23, 42, 0.72);
  transform: translate(-50%, -50%) scale(1.07);
}

#player-decks .player-deck.player-deck-self-clickable:focus-visible {
  outline: 3px solid rgba(251, 191, 36, 0.9);
  outline-offset: 6px;
}

#player-decks .player-deck.player-deck-self-clickable:active {
  box-shadow:
    0 0 0 2px rgba(251, 191, 36, 0.55),
    0 24px 54px -30px rgba(245, 158, 11, 0.5),
    0 22px 38px -26px rgba(15, 23, 42, 0.68);
  transform: translate(-50%, -50%) scale(1.02);
}

#player-decks .player-deck .deck-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 100%;
}

#player-decks .player-deck .deck-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
}

#player-decks .player-deck h3 {
  margin: 0;
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: inherit;
  line-height: 1.3;
}

#player-decks .player-deck .deck-count {
  margin: 0;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: rgba(226, 232, 240, 0.8);
  font-weight: 500;
  line-height: 1.3;
}

.card-back {
  position: relative;
  width: clamp(60px, 18vw, 88px);
  height: clamp(80px, 24vw, 120px);
  border-radius: 14px;
  background: linear-gradient(145deg, #312e81, #1e3a8a);
  border: 2px solid rgba(226, 232, 240, 0.35);
  box-shadow: 0 22px 35px -24px rgba(15, 23, 42, 0.9);
}

.card-back::before,
.card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  border: inherit;
  opacity: 0.65;
  transform: translate(-8px, -6px);
  z-index: -1;
}

.card-back::after {
  opacity: 0.4;
  transform: translate(-16px, -12px);
}

.slap-overlay {
  position: absolute;
  inset: clamp(0.65rem, 3.5vw, 2rem);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  pointer-events: none;
  z-index: 20;
  padding: clamp(1rem, 4vw, 1.75rem);
  gap: clamp(0.45rem, 2vw, 0.75rem);
  opacity: 0;
}

.slap-overlay-visible {
  opacity: 1;
}

.slap-overlay-content {
  display: grid;
  gap: clamp(0.4rem, 1.8vw, 0.7rem);
  max-width: clamp(220px, 58%, 320px);
}

.slap-overlay-content h3 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.how-to-play-button {
  position: fixed;
  bottom: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 150;
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 24px 44px -20px rgba(14, 165, 233, 0.6);
}

.how-to-play-button:hover,
.how-to-play-button:focus-visible {
  box-shadow:
    0 0 0 4px rgba(14, 165, 233, 0.24),
    0 28px 50px -22px rgba(14, 165, 233, 0.65);
}

.how-to-play-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 2.75rem);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  z-index: 200;
}

.how-to-play-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.how-to-play-dialog {
  position: relative;
  width: min(100%, 640px);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 32px 70px -34px rgba(15, 23, 42, 0.75);
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
}

.how-to-play-dialog::-webkit-scrollbar {
  width: 0.55rem;
}

.how-to-play-dialog::-webkit-scrollbar-track {
  background: transparent;
}

.how-to-play-dialog::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.how-to-play-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #1f2937;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}

.how-to-play-close:hover,
.how-to-play-close:focus-visible {
  background: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.how-to-play-dialog h2 {
  margin: 0 0 0.75rem 0;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
}

.how-to-play-dialog h3 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  color: #1d4ed8;
}

.how-to-play-section + .how-to-play-section {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.how-to-play-section p {
  margin-bottom: 0.85rem;
}

.how-to-play-dialog ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.how-to-play-dialog li {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 1.9rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.how-to-play-dialog li::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 0.95rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.how-to-play-dialog strong {
  color: #0f172a;
}

.how-to-play-dialog code {
  font-family: "Fira Code", "SFMono-Regular", "Consolas", monospace;
  background: rgba(226, 232, 240, 0.7);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.95em;
}

.how-to-play-dialog p:last-child {
  margin-bottom: 0;
}

.slap-overlay-winner {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}

.slap-overlay-winner strong {
  color: #fbbf24;
  font-weight: 700;
}

.slap-overlay-candidates-title {
  margin: 0.15rem 0 0;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
}

.slap-overlay-candidates {
  margin: 0.25rem auto 0;
  padding-left: 1.25rem;
  text-align: left;
  font-size: clamp(0.9rem, 2.1vw, 1.05rem);
  color: rgba(248, 250, 252, 0.95);
}

.slap-overlay-candidates li {
  margin: 0.15rem 0;
}

.slap-overlay-candidates li.is-winner {
  color: #fbbf24;
  font-weight: 600;
}


.slap-overlay-animate {
  animation: slapOverlayReveal 1.6s ease-in-out forwards;
}

.room-options-access {
  margin: 1.5rem 0 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.room-options-trigger {
  padding-inline: 1.6rem;
  padding-block: 0.7rem;
  font-size: 1rem;
}

.room-options-trigger--readonly,
.room-options-trigger--readonly:hover,
.room-options-trigger--readonly:focus {
  cursor: help;
}

.room-options-trigger-hint {
  font-size: 0.9rem;
  color: #6b7280;
}

body.room-options-lock {
  overflow: hidden;
}

.room-options-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.room-options-modal[hidden] {
  display: none !important;
}

.room-options-modal--open {
  display: flex;
}

.room-options-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.room-options-modal__panel {
  position: relative;
  width: min(90vw, 520px);
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 28px 48px -24px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.room-options-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.room-options-modal__close {
  background: none;
  color: #1f2933;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: none;
}

.room-options-modal__close:hover,
.room-options-modal__close:focus-visible {
  background: rgba(148, 163, 184, 0.2);
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.room-options-intro {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.room-options-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.room-options-form--readonly .room-options-switch,
.room-options-form--readonly .room-options-counter {
  opacity: 0.75;
}

.room-options-note {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.room-options-note.is-hidden {
  display: none;
}

.room-options-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.room-options-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1d4ed8;
}

.room-options-choices {
  display: grid;
  gap: 0.9rem;
}

.room-options-choices[hidden],
.room-options-choices[data-deck-count-container][hidden] {
  display: none !important;
}

.room-options-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 0.8rem;
}

.room-options-choice input {
  margin-top: 1.05rem;
  transform: scale(1.1);
}

.room-options-choice__texts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #dbe1f1;
  background: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  color: #1f2937;
}

.room-options-choice__label {
  font-weight: 600;
  color: inherit;
}

.room-options-choice__description {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.45;
}

.room-options-choice input:checked + .room-options-choice__texts {
  border-color: #2563eb;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  color: #1e3a8a;
}

.room-options-choice input:checked + .room-options-choice__texts .room-options-choice__description {
  color: #1f3070;
}

.room-options-choice input:focus-visible + .room-options-choice__texts {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.24);
}

.room-options-switches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.room-options-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.32);
}

.room-options-switch__texts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: clamp(55%, 60%, 70%);
}

.room-options-switch__label {
  font-weight: 600;
  color: #0f172a;
}

.room-options-switch__description {
  font-size: 0.85rem;
  color: #64748b;
}

.room-options-switch__control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.room-options-switch__control input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.room-options-switch__slider {
  width: 3rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  position: relative;
  transition: background 0.2s ease;
}

.room-options-switch__slider::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.25rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.room-options-switch__control input:checked + .room-options-switch__slider {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.room-options-switch__control input:checked + .room-options-switch__slider::after {
  transform: translateX(1.35rem);
}

.room-options-switch__control input:disabled + .room-options-switch__slider {
  background: rgba(148, 163, 184, 0.32);
  cursor: not-allowed;
}

.room-options-switch__control input:disabled + .room-options-switch__slider::after {
  box-shadow: none;
}

.room-options-counters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.room-options-counter {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.32);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.room-options-counter__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.room-options-counter__texts {
  flex: 1 1 240px;
  min-width: min(240px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.room-options-counter__label {
  font-weight: 600;
  color: #0f172a;
}

.room-options-counter__description {
  font-size: 0.85rem;
  color: #64748b;
}

.room-options-counter__settings {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.room-options-counter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.room-options-counter__toggle-label {
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.room-options-counter__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(226, 232, 240, 0.8);
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  transition: opacity 0.2s ease;
}

.room-options-counter__btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 26px -18px rgba(37, 99, 235, 0.8);
}

.room-options-counter__btn:disabled,
.room-options-form--readonly .room-options-counter__btn {
  cursor: not-allowed;
  background: #a5b4fc;
  box-shadow: none;
}

.room-options-counter__value {
  min-width: 2.4rem;
  text-align: center;
  font-weight: 600;
  color: #1f2937;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.room-options-counter--sudden-death {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.75), #f8fafc);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.28);
}

.room-options-counter--sudden-death .room-options-counter__toggle-label {
  color: #b91c1c;
}

.room-options-counter--sudden-death .room-options-counter__controls {
  opacity: 0.45;
}

.room-options-counter--sudden-death .room-options-counter__value {
  color: #475569;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.room-options-form--readonly .room-options-counter__toggle {
  cursor: default;
}

.room-options-footer {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.room-options-modal--readonly .room-options-counter__controls,
.room-options-modal--readonly .room-options-switch__control {
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .room-options-modal__panel {
    width: 92vw;
    padding: 1.6rem 1.75rem;
  }

  .room-options-switch {
    flex-direction: column;
    align-items: flex-start;
  }

  .room-options-switch__texts {
    max-width: 100%;
  }

  .room-options-switch__control {
    width: 100%;
    justify-content: flex-end;
  }

  .room-options-counter__content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .room-options-counter__texts {
    flex-basis: auto;
    min-width: 0;
  }

  .room-options-counter__settings {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .room-options-counter__toggle {
    justify-content: space-between;
  }

  .room-options-counter__controls {
    align-self: flex-end;
  }
}

#player-decks .player-deck.slap-deck-error {
  animation: slapDeckError 0.55s ease-out;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.45), 0 22px 38px -26px rgba(15, 23, 42, 0.8);
}

#center-pile {
  position: relative;
  width: clamp(150px, 28vw, 240px);
  height: clamp(200px, 34vw, 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #e2e8f0;
  text-align: center;
  padding: 0.75rem;
  transition: box-shadow 0.35s ease, background 0.35s ease;
}

.center-pile-clickable {
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.center-pile-clickable:hover,
.center-pile-clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45),
    0 22px 38px -26px rgba(37, 99, 235, 0.55);
}

.center-pile-clickable:focus-visible {
  outline: none;
}

#penalty-pile {
  position: absolute;
  top: 50%;
  left: 70%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 16vw, 96px);
  height: clamp(104px, 22vw, 132px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#penalty-pile.penalty-empty {
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

#penalty-pile .penalty-count {
  position: absolute;
  bottom: 4px;
  right: 8px;
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
}

#center-pile p {
  margin: 0;
}

#center-pile.center-empty {
  color: #cbd5f5;
}

#center-pile.pending-collect {
  background: rgba(245, 158, 11, 0.18);
  color: #fef3c7;
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.45), 0 0 0 4px rgba(253, 230, 138, 0.18);
}

#center-pile.slap-pending::after {
  content: '';
  position: absolute;
  inset: -0.45rem;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.4);
  animation: slapPendingBorderPulse 1.6s ease-in-out infinite;
}

.center-pile {
  position: relative;
  width: 100%;
  height: 100%;
}

.center-pile .card-visual {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 168px;
  font-size: 3rem;
  box-shadow: 0 24px 36px -24px rgba(15, 23, 42, 0.9);
  transition: transform 0.3s ease;
}

.center-pile .card-visual.bottom {
  transform: translate(-50%, -50%) rotate(-6deg);
  z-index: 10;
}

.center-pile .card-visual.mid {
  transform: translate(-50%, -50%) rotate(2deg);
  z-index: 11;
}

.center-pile .card-visual.top {
  transform: translate(-50%, -50%) rotate(7deg);
  z-index: 12;
}

@keyframes slapOverlayReveal {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  12% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes slapDeckError {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  20% {
    transform: translate(calc(-50% - 6px), calc(-50% + 2px));
  }
  40% {
    transform: translate(calc(-50% + 6px), calc(-50% - 2px));
  }
  60% {
    transform: translate(calc(-50% - 5px), calc(-50% + 1px));
  }
  80% {
    transform: translate(calc(-50% + 4px), calc(-50% - 1px));
  }
}

@keyframes slapPendingBorderPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.32);
    opacity: 0.85;
  }
  60% {
    box-shadow: 0 0 0 14px rgba(250, 204, 21, 0.14);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    opacity: 0.85;
  }
}

@keyframes slapSuccessPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  65% {
    box-shadow: 0 0 0 22px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes slapFailShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

#table.slap-pending,
.table.slap-pending {
  box-shadow:
    0 28px 70px -38px rgba(15, 23, 42, 0.85),
    0 0 0 4px rgba(250, 204, 21, 0.32),
    0 0 40px -12px rgba(250, 204, 21, 0.55);
}

#table.slap-pending::before,
.table.slap-pending::before {
  border-color: rgba(250, 204, 21, 0.68);
  box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.32);
  animation: slapPendingBorderPulse 1.6s ease-in-out infinite;
}

#table.slap-success,
.table.slap-success {
  animation: slapSuccessPulse 0.9s ease-out;
}

#table.slap-fail,
.table.slap-fail {
  animation: slapFailShake 0.42s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  #table.slap-success,
  .table.slap-success,
  #table.slap-fail,
  .table.slap-fail,
  #table.slap-pending,
  .table.slap-pending,
  #table.slap-pending::before,
  .table.slap-pending::before,
  #center-pile.slap-pending::after,
  .slap-overlay-animate,
  #player-decks .player-deck.slap-deck-error {
    animation: none;
  }
}

@media (max-width: 900px) {
  #table,
  .table {
    width: min(100%, 720px);
  }
}

@media (max-width: 720px) {
  #table,
  .table {
    width: 100%;
    padding: clamp(1.25rem, 6.5vw, 1.75rem);
  }

  #player-decks .player-deck {
    --deck-padding-y: clamp(0.5rem, 2.6vw, 0.85rem);
    --deck-padding-x: clamp(0.7rem, 4.5vw, 1.2rem);
    width: clamp(130px, 38vw, 180px);
  }

  #player-decks .player-deck .deck-content {
    gap: clamp(0.5rem, 3vw, 0.9rem);
  }

  .card-back {
    width: clamp(52px, 18vw, 72px);
    height: clamp(74px, 26vw, 102px);
  }
}

@media (max-width: 540px) {
  #table,
  .table {
    margin: clamp(1.5rem, 5vw, 2rem) auto;
  }

  #player-decks .player-deck {
    --deck-padding-y: clamp(0.5rem, 4.8vw, 0.75rem);
    --deck-padding-x: clamp(0.65rem, 5.5vw, 1.05rem);
    width: clamp(120px, 58vw, 140px);
  }

  #player-decks .player-deck .deck-content {
    gap: clamp(0.45rem, 4vw, 0.75rem);
  }

  #player-decks .player-deck h3 {
    font-size: clamp(0.9rem, 4vw, 1rem);
  }

  #player-decks .player-deck .deck-count {
    font-size: clamp(0.8rem, 3.5vw, 0.9rem);
  }
}

@media (max-width: 640px) {
  main {
    padding: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  button,
  .button {
    width: 100%;
  }

  .how-to-play-button {
    width: auto;
    min-width: 0;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    bottom: 1rem;
    right: 1rem;
  }

  .how-to-play-overlay {
    padding: 1.25rem;
  }

  .how-to-play-dialog {
    width: min(100%, 92vw);
    padding: 1.5rem;
    border-radius: 18px;
  }

  .how-to-play-close {
    top: 0.75rem;
    right: 0.75rem;
  }
}
