@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500&display=swap");

:root {
  color-scheme: light;
  --ink: #1e1b16;
  --muted: #6d6357;
  --accent: #d18a2c;
  --accent-2: #2b8a78;
  --paper: #fbf7f0;
  --panel: #ffffff;
  --line: #eadfce;
  --shadow: 0 18px 50px rgba(28, 23, 16, 0.12);
  --btn-bg-top: #fff3df;
  --btn-bg-bottom: #f2dfc2;
  --btn-border: #cbb89f;
  --btn-color: #6b4a19;
  --btn-secondary-bg-top: #e8f5f2;
  --btn-secondary-bg-bottom: #d7ece7;
  --btn-secondary-border: #b8d5cd;
  --btn-secondary-color: #1d5c4e;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-border: #ddd1bd;
  --btn-ghost-color: #6d6357;
  --pill-bg: #f1efe9;
  --pill-border: #e2d6c3;
  --pill-color: #6a5b49;
  --btn-disabled-bg: #f0e6d5;
  --btn-disabled-border: #d8cbb7;
  --btn-disabled-color: #8a7a67;
  --input-disabled-bg: #f7efe3;
  --input-disabled-border: #d8cbb7;
  --input-disabled-color: #8a7a67;
  --overlay-bg: rgba(248, 241, 231, 0.6);
  --overlay-card-bg: #fffdfa;
  --overlay-card-border: #eadfce;
  --overlay-shadow: 0 18px 40px rgba(27, 22, 15, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Alegreya Sans", "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #f6e9d3 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #e9f2ef 0%, transparent 40%),
    linear-gradient(135deg, #f7f1e7, #f3e9d7 55%, #f5f4f0 100%);
  min-height: 100vh;
}

body.role-neutral {
  background: radial-gradient(circle at 15% 10%, #f0ece3 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #eef3f1 0%, transparent 40%),
    linear-gradient(135deg, #f7f5f0, #f1ebe0 55%, #f4f2ee 100%);
}

body.role-legit {
  --accent-2: #2b8a78;
  --panel: #ffffff;
  --line: #d9e6db;
  --btn-bg-top: #eaf7ef;
  --btn-bg-bottom: #cfead9;
  --btn-border: #a8d0ba;
  --btn-color: #205a3d;
  --btn-secondary-bg-top: #e7f4f1;
  --btn-secondary-bg-bottom: #d1ebe6;
  --btn-secondary-border: #a9d4cc;
  --btn-secondary-color: #1f5a4b;
  --pill-bg: #eef7f2;
  --pill-border: #cfe7db;
  --pill-color: #2b5a46;
  --btn-disabled-bg: #dfeee6;
  --btn-disabled-border: #c0d8ca;
  --btn-disabled-color: #5b7a68;
  --input-disabled-bg: #e5f2ea;
  --input-disabled-border: #c0d8ca;
  --input-disabled-color: #5b7a68;
  --overlay-bg: rgba(232, 242, 236, 0.65);
  --overlay-card-bg: #f7fcf9;
  --overlay-card-border: #d4e5da;
  --overlay-shadow: 0 18px 40px rgba(22, 45, 34, 0.16);
  background: radial-gradient(circle at 15% 10%, #dff1e4 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #e6f3ee 0%, transparent 40%),
    linear-gradient(135deg, #f3f8f5, #e7f3ec 55%, #f4f7f5 100%);
}

body.role-faker {
  --accent: #c74b3a;
  --panel: #ffffff;
  --line: #efd6d2;
  --btn-bg-top: #fee9e7;
  --btn-bg-bottom: #f7c9c3;
  --btn-border: #e1a3a0;
  --btn-color: #7a1f1a;
  --btn-secondary-bg-top: #f9e3e0;
  --btn-secondary-bg-bottom: #f1c4bd;
  --btn-secondary-border: #dba5a0;
  --btn-secondary-color: #7a1f1a;
  --pill-bg: #f9e4e1;
  --pill-border: #e8bdb7;
  --pill-color: #7a1f1a;
  --btn-disabled-bg: #f3d9d6;
  --btn-disabled-border: #e0b8b3;
  --btn-disabled-color: #8b5a55;
  --input-disabled-bg: #f6e2de;
  --input-disabled-border: #e0b8b3;
  --input-disabled-color: #8b5a55;
  --overlay-bg: rgba(248, 229, 226, 0.65);
  --overlay-card-bg: #fff8f7;
  --overlay-card-border: #efcfc9;
  --overlay-shadow: 0 18px 40px rgba(56, 23, 19, 0.18);
  background: radial-gradient(circle at 15% 10%, #f2d6d2 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #f3e2de 0%, transparent 40%),
    linear-gradient(135deg, #f8f0ee, #f2d9d4 55%, #f7f2f1 100%);
}

h1,
h2,
h3 {
  font-family: "Bricolage Grotesque", "Alegreya Sans", sans-serif;
  margin: 0 0 12px 0;
  letter-spacing: 0.3px;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

p {
  margin: 0 0 12px 0;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  max-width: 520px;
  white-space: pre-line;
}

.tag {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4dc;
  color: #8a5b16;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

#debugToggle {
  user-select: none;
}

.vote-target {
  cursor: pointer;
  user-select: none;
}

.vote-target.disabled {
  cursor: default;
  opacity: 0.5;
}

.vote-row-self .vote-target {
  cursor: default;
  opacity: 1;
}

.vote-player {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-choice-slot {
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}

.vote-choice-slot .you-marker {
  font-size: 11px;
}

body.role-legit .vote-choice-slot .you-marker {
  color: #2e7d32;
}

body.role-faker .vote-choice-slot .you-marker {
  color: #e0473f;
}

.vote-player input[type="checkbox"] {
  margin: 0;
}

.vote-spacer {
  display: inline-block;
  width: 16px;
  height: 16px;
}

.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf8;
  margin: 0 6px 6px 0;
  font-size: 12px;
  max-width: 100%;
}

.word-text {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 44px);
}

.word-action {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

.word-action:focus-visible {
  outline: 2px solid #c6b49f;
  outline-offset: 2px;
  border-radius: 6px;
}

#submittedWordsEditor {
  overflow-x: visible;
  white-space: normal;
  padding-bottom: 2px;
}

#submittedWordsEditor .word-chip {
  margin-bottom: 6px;
}

#submittedWordsLine {
  overflow-x: visible;
  white-space: normal;
}

#submittedWordsLine .meta-value {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#viewRoom .grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

#viewGame .grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.room-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-actions {
  margin-top: 10px;
}

.room-actions .row {
  align-items: center;
  flex-wrap: wrap;
}

.room-actions #btnLeaveRoom {
  margin-left: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: lift 500ms ease both;
}


.panel::before {
  content: "";
  position: absolute;
  top: -35%;
  right: -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(209, 138, 44, 0.18), transparent 65%);
  pointer-events: none;
}

.panel h3 {
  font-size: 18px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.vote-header-row {
  align-items: center;
}

.vote-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin-bottom: 4px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea,
select {
  padding: 9px 10px;
  border: 1px solid #d7cbb7;
  border-radius: 10px;
  background: #fffdf8;
}

select {
  height: 40px;
  line-height: 1.2;
}

input:read-only,
input:disabled,
textarea:disabled {
  background: var(--input-disabled-bg);
  border-color: var(--input-disabled-border);
  color: var(--input-disabled-color);
}

textarea {
  width: 100%;
  height: 120px;
}

button {
  padding: 9px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--btn-bg-top), var(--btn-bg-bottom));
  color: var(--btn-color);
  font-weight: 700;
  cursor: pointer;
}

button.action-hint {
  border-color: #d4a354;
  background: linear-gradient(180deg, #ffe7c2, #f4cf92);
  box-shadow: 0 10px 18px rgba(163, 114, 40, 0.22);
}

button.secondary {
  background: linear-gradient(180deg,
      var(--btn-secondary-bg-top),
      var(--btn-secondary-bg-bottom));
  color: var(--btn-secondary-color);
  border-color: var(--btn-secondary-border);
}

button.secondary.pressed {
  background: linear-gradient(180deg, #d2ebe5, #bfdad3);
  border-color: #94bdb2;
  color: #1d5c4e;
  box-shadow: inset 0 1px 2px rgba(27, 81, 68, 0.25);
}

button.secondary:disabled,
button.secondary.pressed:disabled {
  background: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-border);
  color: var(--btn-disabled-color);
  box-shadow: none;
}

button.ghost {
  background: var(--btn-ghost-bg);
  border-color: var(--btn-ghost-border);
  color: var(--btn-ghost-color);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(35%);
  box-shadow: none;
  background: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-border);
  color: var(--btn-disabled-color);
}

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

.mono {
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

.label-inline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.meta-label {
  font-weight: 400;
  color: #9a8b7a;
}

.meta-value {
  color: #3f3327;
}

.meta-sep {
  color: #b9a894;
  padding: 0 2px;
}

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

#secretWord {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.secret-plain {
  font-weight: 700;
}

.move-instruction {
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 12px;
  color: var(--pill-color);
}

.pill.player-badge {
  font-weight: 600;
}

.pill.player-banner {
  font-size: 16px;
  padding: 6px 14px;
}

button.pill {
  cursor: pointer;
  appearance: none;
  border: 1px solid #e2d6c3;
  background: #f1efe9;
  padding: 4px 10px;
  line-height: 1;
}

button.pill:focus-visible {
  outline: 2px solid #c6b49f;
  outline-offset: 2px;
}

.pill>button.mono {
  cursor: pointer;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.pill>button.mono:focus-visible {
  outline: 2px solid #c6b49f;
  outline-offset: 2px;
  border-radius: 6px;
}

.row-muted {
  color: var(--muted);
  opacity: 0.7;
}

.ok-check {
  color: #2f8f5b;
  font-weight: 700;
}

.error-text {
  color: #b00020;
}

.word-used {
  text-decoration: line-through;
  color: var(--muted);
}


.room-header {
  justify-content: space-between;
  align-items: center;
}

.room-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.room-lock {
  margin-left: 6px;
  font-size: 0.9em;
  position: relative;
}

.room-code-wrap {
  margin-left: auto;
}

.lobby-actions {
  align-items: center;
}

.lobby-actions {
  justify-content: space-between;
  width: 100%;
}

.lobby-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.lobby-actions #btnRejoinRoom {
  margin-left: auto;
}

.copied-note {
  color: #2f8f5b;
  opacity: 0;
  transition: opacity 200ms ease;
  margin-top: 6px;
}

.copied-note.show {
  opacity: 1;
}

.room-code-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.icon-btn {
  position: relative;
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}

.kick-player {
  font-size: 10px;
}

.you-marker {
  color: #7a6b5c;
  white-space: nowrap;
}

.tooltip {
  position: fixed;
  z-index: 1000;
  background: #fff4c2;
  border: 1px solid #e0c874;
  color: #3f3327;
  font-size: 12px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  padding: 4px 6px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(90, 70, 52, 0.18);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 120ms ease;
}

.tooltip.show {
  opacity: 1;
}

.tooltip.hidden {
  display: none;
}

.tooltip::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border: 7px solid transparent;
}

.tooltip.tooltip--above::after {
  top: 100%;
  border-top-color: #e0c874;
}

.tooltip.tooltip--below::after {
  bottom: 100%;
  border-bottom-color: #e0c874;
}

.is-me-row td {
  background: #f6efe3;
}

.is-me-row td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.is-me-row td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.icon-btn:focus-visible {
  outline: 2px solid rgba(60, 90, 115, 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.room-copy-note {
  text-align: right;
}

.pill.timer {
  background: #f7efe3;
  border-color: #e1d3bf;
  font-weight: 700;
  color: #6a5b49;
}

.pill.timer.urgent {
  background: #ffe5e1;
  border-color: #f0b9ae;
  color: #b00020;
}

#voteChangeHint {
  color: #b00020;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.debug-only {
  display: none;
}

body.debug .debug-only {
  display: block;
}

.players {
  max-height: 240px;
  overflow: auto;
  border: 1px solid #efe4d2;
  border-radius: 12px;
  padding: 8px;
  background: #fffdfa;
}

#roundsTable.players {
  max-height: none;
}

#roundsTable,
#voteTable {
  -webkit-user-select: none;
  user-select: none;
}

.table-scroll {
  position: relative;
  overflow: hidden;
  --scroll-hint-bg: #fffdfa;
}

.table-scroll__inner {
  overflow: auto;
  max-height: inherit;
  -webkit-overflow-scrolling: touch;
}

.players.table-scroll {
  overflow: auto;
  padding: 8px;
}

.players.table-scroll .table-scroll__inner {
  max-height: none;
  overflow: visible;
}

#roundsTable.players.table-scroll,
#voteTable.players.table-scroll {
  overflow: hidden;
  padding: 0;
}

#roundsTable.players.table-scroll .table-scroll__inner,
#voteTable.players.table-scroll .table-scroll__inner {
  overflow: auto;
  padding: 8px;
  box-sizing: border-box;
}

.table-scroll__inner .status-table {
  min-width: 100%;
  width: max-content;
}

.table-scroll--plain {
  --scroll-hint-bg: var(--overlay-card-bg);
  border: 0;
  padding: 0;
  background: transparent;
}

.table-scroll::before,
.table-scroll::after {
  position: absolute;
  bottom: 2px;
  font-size: 12px;
  color: rgba(98, 58, 24, 1);
  background: rgba(255, 253, 250, 0.7);
  border-radius: 999px;
  padding: 0 4px 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.table-scroll::before {
  content: "←";
  left: 6px;
}

.table-scroll::after {
  content: "→";
  right: 6px;
}

.table-scroll[data-scrollable="true"]::before,
.table-scroll[data-scrollable="true"]::after {
  opacity: 1;
}

.table-scroll--plain::before,
.table-scroll--plain::after {
  background: rgba(255, 255, 255, 0.7);
}

body.role-legit .table-scroll::before,
body.role-legit .table-scroll::after {
  color: #12b05a;
}

body.role-faker .table-scroll::before,
body.role-faker .table-scroll::after {
  color: #e0473f;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.status-table th,
.status-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #efe4d2;
  text-align: left;
}

#roundsTable .status-table th:not(:last-child),
#roundsTable .status-table td:not(:last-child) {
  border-right: 0.5px solid #efe4d2;
}

#voteTable .status-table {
  table-layout: auto;
  width: 100%;
}

#voteTable .status-table th:nth-child(1),
#voteTable .status-table td:nth-child(1),
#voteTable .status-table th:nth-child(2),
#voteTable .status-table td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
}

#voteTable .status-table th:nth-child(3),
#voteTable .status-table td:nth-child(3) {
  white-space: nowrap;
}

#voteTable .status-table th:nth-child(1) {
  text-align: center;
}

#voteTable .status-table td {
  vertical-align: top;
  border-bottom: 0;
}

#voteTable .status-table tr {
  border-bottom: 1px solid #efe4d2;
}

#voteTable .status-table tr:last-child {
  border-bottom: 0;
}

.status-table th {
  color: #6d6357;
  font-weight: 700;
}

.room-table th,
.room-table td {
  border-bottom: 0.5px solid #efe4d2;
  padding: 4px 6px;
}

.room-table .col-num {
  text-align: right;
}

.room-table .col-score,
.room-table .col-words {
  text-align: center;
}

.room-table .col-round {
  text-align: center;
}

.room-table .col-round,
.room-table .col-num {
  padding-left: 4px;
  padding-right: 4px;
}

.room-table .player-head {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.room-table .player-name {
  display: inline-block;
  text-align: center;
}

.room-table .cell-emoji {
  text-align: center;
  padding-left: 3px;
  padding-right: 3px;
}

.room-table .self-col {
  background: #f6efe3;
}

body.role-legit .room-table .self-col {
  background: rgba(76, 175, 80, 0.08);
}

body.role-faker .room-table .self-col {
  background: rgba(196, 77, 77, 0.08);
}

#output {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fffdfa;
  min-height: 260px;
  height: 360px;
  overflow: auto;
}

#output details {
  border: 1px solid #efe4d2;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 0 8px 0;
  background: #fff7ea;
}

#output summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  list-style: none;
}

#output summary::-webkit-details-marker {
  display: none;
}

#output pre {
  cursor: copy;
  margin: 8px 0 0 0;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

#nameError {
  display: none;
  color: #b00020;
  font-size: 12px;
}

#actionError {
  font-size: 12px;
}

.hidden {
  display: none;
}

.overlay.hidden {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  --overlay-btn-bg-top: #fff3df;
  --overlay-btn-bg-bottom: #f2dfc2;
  --overlay-btn-border: #cbb89f;
  --overlay-btn-color: #6b4a19;
  --overlay-btn-secondary-bg-top: #e8f5f2;
  --overlay-btn-secondary-bg-bottom: #d7ece7;
  --overlay-btn-secondary-border: #b8d5cd;
  --overlay-btn-secondary-color: #1d5c4e;
  --overlay-btn-ghost-bg: #ffffff;
  --overlay-btn-ghost-border: #ddd1bd;
  --overlay-btn-ghost-color: #6d6357;
  --overlay-btn-disabled-bg: #f0e6d5;
  --overlay-btn-disabled-border: #d8cbb7;
  --overlay-btn-disabled-color: #8a7a67;
}

.overlay.role-neutral {
  --overlay-bg: rgba(248, 241, 231, 0.6);
  --overlay-card-bg: #fffdfa;
  --overlay-card-border: #eadfce;
  --overlay-shadow: 0 18px 40px rgba(27, 22, 15, 0.16);
}

.overlay.role-legit {
  --overlay-bg: rgba(232, 242, 236, 0.65);
  --overlay-card-bg: #f7fcf9;
  --overlay-card-border: #d4e5da;
  --overlay-shadow: 0 18px 40px rgba(22, 45, 34, 0.16);
  --overlay-btn-bg-top: #eaf7ef;
  --overlay-btn-bg-bottom: #cfead9;
  --overlay-btn-border: #a8d0ba;
  --overlay-btn-color: #205a3d;
  --overlay-btn-secondary-bg-top: #e7f4f1;
  --overlay-btn-secondary-bg-bottom: #d1ebe6;
  --overlay-btn-secondary-border: #a9d4cc;
  --overlay-btn-secondary-color: #1f5a4b;
  --overlay-btn-ghost-bg: #ffffff;
  --overlay-btn-ghost-border: #cfe7db;
  --overlay-btn-ghost-color: #2b5a46;
  --overlay-btn-disabled-bg: #dfeee6;
  --overlay-btn-disabled-border: #c0d8ca;
  --overlay-btn-disabled-color: #5b7a68;
}

.overlay.role-faker {
  --overlay-bg: rgba(248, 229, 226, 0.65);
  --overlay-card-bg: #fff8f7;
  --overlay-card-border: #efcfc9;
  --overlay-shadow: 0 18px 40px rgba(56, 23, 19, 0.18);
  --overlay-btn-bg-top: #fee9e7;
  --overlay-btn-bg-bottom: #f7c9c3;
  --overlay-btn-border: #e1a3a0;
  --overlay-btn-color: #7a1f1a;
  --overlay-btn-secondary-bg-top: #f9e3e0;
  --overlay-btn-secondary-bg-bottom: #f1c4bd;
  --overlay-btn-secondary-border: #dba5a0;
  --overlay-btn-secondary-color: #7a1f1a;
  --overlay-btn-ghost-bg: #ffffff;
  --overlay-btn-ghost-border: #efcfc9;
  --overlay-btn-ghost-color: #7a1f1a;
  --overlay-btn-disabled-bg: #f3d9d6;
  --overlay-btn-disabled-border: #e0b8b3;
  --overlay-btn-disabled-color: #8b5a55;
}

.overlay-card {
  background: var(--overlay-card-bg);
  border: 1px solid var(--overlay-card-border);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: var(--overlay-shadow);
  text-align: center;
  min-width: 240px;
}

#overlayMessage {
  white-space: pre-line;
}

.overlay-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
}

.match-table {
  margin: 10px 0 8px;
}

.match-table th:nth-child(2),
.match-table td:nth-child(2) {
  text-align: center;
}

.match-total {
  margin-top: 6px;
}

.overlay-card button {
  margin-top: 10px;
}

.overlay button {
  background: linear-gradient(180deg,
      var(--overlay-btn-bg-top),
      var(--overlay-btn-bg-bottom));
  border-color: var(--overlay-btn-border);
  color: var(--overlay-btn-color);
}

.overlay button.secondary {
  background: linear-gradient(180deg,
      var(--overlay-btn-secondary-bg-top),
      var(--overlay-btn-secondary-bg-bottom));
  border-color: var(--overlay-btn-secondary-border);
  color: var(--overlay-btn-secondary-color);
}

.overlay button.ghost {
  background: var(--overlay-btn-ghost-bg);
  border-color: var(--overlay-btn-ghost-border);
  color: var(--overlay-btn-ghost-color);
}

.overlay button:disabled {
  background: var(--overlay-btn-disabled-bg);
  border-color: var(--overlay-btn-disabled-border);
  color: var(--overlay-btn-disabled-color);
  filter: grayscale(35%);
  opacity: 0.55;
  box-shadow: none;
}

#overlayChoice button {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.build {
  position: fixed;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  color: #8a7a67;
  opacity: 0.7;
  pointer-events: none;
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  #viewGame .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  #viewRoom .grid {
    grid-template-columns: 1fr;
  }

  .room-code-wrap {
    align-items: flex-start;
  }
}

.panel.your-turn {
  border-color: #c89b56;
  box-shadow: 0 0 0 2px rgba(200, 155, 86, 0.25), 0 12px 30px rgba(200, 155, 86, 0.12);
  background: linear-gradient(180deg, rgba(255, 249, 236, 0.95), rgba(255, 244, 226, 0.9));
}

body.role-faker .panel.your-turn {
  border-color: #b45a5a;
  box-shadow: 0 0 0 2px rgba(180, 90, 90, 0.25), 0 12px 30px rgba(180, 90, 90, 0.15);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.95), rgba(255, 231, 231, 0.9));
}

@keyframes pulse-turn {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.01);
  }

  100% {
    transform: scale(1);
  }
}

.panel.your-turn.your-turn-alert {
  animation: pulse-turn 0.8s ease-in-out infinite;
}
