/* Room lifecycle and cosmetic card-skin controls. */
.room-tools-panel {
  margin: 12px 0 2px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(5, 10, 10, 0.94);
}

.room-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.room-tools-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.room-tools-field label {
  color: var(--line);
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.card-skin-select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.end-room-button {
  min-height: 42px;
  border-color: #d66c6c;
  color: #ffdada;
  background: rgba(100, 20, 20, 0.24);
}

.end-room-button:not(:disabled):active {
  background: rgba(150, 32, 32, 0.34);
}

.room-tools-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.35;
}

body[data-card-skin="cold-glass"] .card:not(.empty),
body[data-card-skin="cold-glass"] .mini-card,
body[data-card-skin="cold-glass"] .replay-card,
body[data-card-skin="cold-glass"] .card-back-mini {
  filter: saturate(1.35) brightness(1.09) contrast(1.06) hue-rotate(-8deg);
}

body[data-card-skin="records-mono"] .card:not(.empty),
body[data-card-skin="records-mono"] .mini-card,
body[data-card-skin="records-mono"] .replay-card,
body[data-card-skin="records-mono"] .card-back-mini {
  filter: grayscale(1) contrast(1.3) brightness(1.08);
}

/* WEB-SKIN-V02: Red Tithe owns a complete ruby interface palette. */
body[data-card-skin="red-tithe"] {
  --void: #050102;
  --panel: #100306;
  --panel-2: #18050a;
  --line: #ef2858;
  --line-rgb: 239, 40, 88;
  --line-soft: rgba(239, 40, 88, 0.38);
  --text: #fff3f5;
  --muted: #d7a9b3;
  --danger: #ff7898;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -18%, rgba(239, 40, 88, 0.20), transparent 49%),
    radial-gradient(circle at 18% 64%, rgba(111, 10, 37, 0.12), transparent 36%),
    linear-gradient(180deg, #120307, #030102 74%);
}

body[data-card-skin="red-tithe"] ::selection {
  color: #fff7f8;
  background: rgba(239, 40, 88, 0.55);
}

body[data-card-skin="red-tithe"] .brand-panel,
body[data-card-skin="red-tithe"] .join-card,
body[data-card-skin="red-tithe"] .rules-card,
body[data-card-skin="red-tithe"] .lobby-panel,
body[data-card-skin="red-tithe"] .finish-panel,
body[data-card-skin="red-tithe"] .table-shell,
body[data-card-skin="red-tithe"] .game-header,
body[data-card-skin="red-tithe"] .player-score,
body[data-card-skin="red-tithe"] .capture-panel,
body[data-card-skin="red-tithe"] .last-move-panel,
body[data-card-skin="red-tithe"] .replay-panel,
body[data-card-skin="red-tithe"] .room-tools-panel,
body[data-card-skin="red-tithe"] .premium-panel,
body[data-card-skin="red-tithe"] .final-score {
  border-color: var(--line-soft);
  background-color: rgba(12, 2, 5, 0.94);
}

body[data-card-skin="red-tithe"] .brand-panel,
body[data-card-skin="red-tithe"] .join-card,
body[data-card-skin="red-tithe"] .rules-card,
body[data-card-skin="red-tithe"] .lobby-panel,
body[data-card-skin="red-tithe"] .finish-panel {
  background: linear-gradient(145deg, rgba(24, 5, 10, 0.96), rgba(5, 1, 2, 0.98));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255, 220, 228, 0.025);
}

body[data-card-skin="red-tithe"] input,
body[data-card-skin="red-tithe"] .card-skin-select {
  border-color: rgba(141, 56, 73, 0.72);
  color: var(--text);
  background: #070204;
}

body[data-card-skin="red-tithe"] input:focus,
body[data-card-skin="red-tithe"] .card-skin-select:focus {
  border-color: var(--line);
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 40, 88, 0.15);
}

body[data-card-skin="red-tithe"] button.secondary {
  color: #ff6a8d;
  border-color: rgba(239, 40, 88, 0.72);
  background: rgba(28, 3, 9, 0.72);
}

body[data-card-skin="red-tithe"] button.ghost {
  color: #f2d8df;
  border-color: rgba(141, 56, 73, 0.72);
  background: #16050a;
}

body[data-card-skin="red-tithe"] .or-line,
body[data-card-skin="red-tithe"] .room-line,
body[data-card-skin="red-tithe"] .score-values,
body[data-card-skin="red-tithe"] .stack-count,
body[data-card-skin="red-tithe"] .rail-heading,
body[data-card-skin="red-tithe"] .diagonal-key,
body[data-card-skin="red-tithe"] .game-log,
body[data-card-skin="red-tithe"] .final-score span,
body[data-card-skin="red-tithe"] .rematch-status,
body[data-card-skin="red-tithe"] .replay-text,
body[data-card-skin="red-tithe"] .inspect-register,
body[data-card-skin="red-tithe"] .room-tools-note {
  color: #caa0aa;
}

body[data-card-skin="red-tithe"] .or-line::before,
body[data-card-skin="red-tithe"] .or-line::after {
  background: rgba(141, 56, 73, 0.45);
}

body[data-card-skin="red-tithe"] .rules-card,
body[data-card-skin="red-tithe"] .last-move,
body[data-card-skin="red-tithe"] .history-slide,
body[data-card-skin="red-tithe"] .replay-text {
  color: #f3dce2;
}

body[data-card-skin="red-tithe"] .game-header {
  border-color: rgba(239, 40, 88, 0.42);
  background: rgba(10, 2, 4, 0.92);
  box-shadow: 0 0 24px rgba(239, 40, 88, 0.07);
}

body[data-card-skin="red-tithe"] .connection.online {
  color: #ff6a8d;
  background: rgba(239, 40, 88, 0.13);
}

body[data-card-skin="red-tithe"] .table-shell {
  border-color: rgba(239, 40, 88, 0.46);
  background: linear-gradient(180deg, rgba(12, 3, 6, 0.98), rgba(3, 1, 2, 0.99));
  box-shadow: inset 0 0 70px rgba(85, 4, 27, 0.10);
}

body[data-card-skin="red-tithe"] .table-shell::before {
  background-image:
    linear-gradient(rgba(7, 1, 3, 0.72), rgba(2, 0, 1, 0.93)),
    radial-gradient(circle at center, rgba(239, 40, 88, 0.15), transparent 54%),
    var(--board);
  opacity: 0.58;
  filter: saturate(0.58) sepia(0.20) hue-rotate(302deg) contrast(1.22) brightness(0.78);
}

body[data-card-skin="red-tithe"] .player-score {
  border-color: rgba(141, 56, 73, 0.72);
  background: rgba(8, 2, 4, 0.90);
}

body[data-card-skin="red-tithe"] .player-score.active-seat {
  border-color: rgba(239, 40, 88, 0.88);
  box-shadow: 0 0 18px rgba(239, 40, 88, 0.10);
}

body[data-card-skin="red-tithe"] .status-panel {
  border-left-color: var(--line);
  background: linear-gradient(90deg, rgba(77, 4, 25, 0.82), rgba(15, 3, 7, 0.94));
}

body[data-card-skin="red-tithe"] h3,
body[data-card-skin="red-tithe"] .capture-panel summary,
body[data-card-skin="red-tithe"] .seat-status.online,
body[data-card-skin="red-tithe"] .stack-count b,
body[data-card-skin="red-tithe"] .rail-heading strong,
body[data-card-skin="red-tithe"] .rail-axis .axis-name,
body[data-card-skin="red-tithe"] #selectionHint,
body[data-card-skin="red-tithe"] .final-score strong,
body[data-card-skin="red-tithe"] #replayIndex,
body[data-card-skin="red-tithe"] .premium-panel h2,
body[data-card-skin="red-tithe"] .system-on b,
body[data-card-skin="red-tithe"] .room-tools-field label {
  color: #ff5f83;
}

body[data-card-skin="red-tithe"] .rail-axis {
  color: #f7dfe4;
}

body[data-card-skin="red-tithe"] .card-back-mini {
  border-color: rgba(239, 40, 88, 0.58);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.58), 0 0 8px rgba(239, 40, 88, 0.10);
}

body[data-card-skin="red-tithe"] .card.empty {
  border-color: rgba(239, 40, 88, 0.62);
  color: #8d5361;
  background-color: rgba(18, 3, 7, 0.72);
}

body[data-card-skin="red-tithe"] .intake-button {
  color: #ff5f83;
  border-color: rgba(239, 40, 88, 0.72);
  background: rgba(15, 3, 7, 0.96);
}

body[data-card-skin="red-tithe"] .intake-button.ready,
body[data-card-skin="red-tithe"] button:not(.secondary):not(.ghost):not(.end-room-button) {
  color: #210107;
  border-color: #ff4d76;
  background: #ef2858;
  box-shadow: 0 0 24px rgba(239, 40, 88, 0.24);
}

body[data-card-skin="red-tithe"] .capture-panel {
  border-color: rgba(112, 34, 52, 0.75);
  background: rgba(8, 2, 4, 0.92);
}

body[data-card-skin="red-tithe"] .last-move-panel {
  border-color: rgba(112, 34, 52, 0.75);
  background: rgba(6, 1, 3, 0.93);
}

body[data-card-skin="red-tithe"] .final-score {
  border-color: rgba(141, 56, 73, 0.72);
  background: #090204;
}

body[data-card-skin="red-tithe"] .final-score.winner {
  border-color: var(--line);
  box-shadow: 0 0 24px rgba(239, 40, 88, 0.16);
}

body[data-card-skin="red-tithe"] .toast {
  border-color: var(--line);
  background: rgba(15, 3, 7, 0.97);
  box-shadow: 0 10px 40px black, 0 0 18px rgba(239, 40, 88, 0.10);
}

body[data-card-skin="red-tithe"] .slide-result-banner {
  border-color: #ff6a8d;
  color: #250108;
  background: #ef2858;
  box-shadow: 0 0 26px rgba(239, 40, 88, 0.32);
}

body[data-card-skin="red-tithe"] .star-trace.gold-trace {
  color: #ff416f;
  background: rgba(28, 1, 8, 0.76);
  box-shadow: 0 0 12px rgba(255, 65, 111, 0.96), inset 0 0 7px rgba(255, 65, 111, 0.34);
}

body[data-card-skin="red-tithe"] .star-trace.black-trace {
  color: #ffe9ee;
  border-color: #ff6a8d;
  background: rgba(5, 0, 2, 0.80);
  box-shadow: 0 0 11px rgba(255, 106, 141, 0.72), inset 0 0 6px rgba(255, 106, 141, 0.18);
}

body[data-card-skin="red-tithe"].camera-mode .rail-area {
  border-color: rgba(239, 40, 88, 0.42);
  background: rgba(12, 2, 5, 0.66);
  box-shadow: inset 0 0 28px rgba(239, 40, 88, 0.06);
}

body[data-card-skin="red-tithe"].shutdown-mode .table-shell {
  border-color: rgba(255, 227, 234, 0.76);
  box-shadow: 0 0 28px rgba(239, 40, 88, 0.18), inset 0 0 40px rgba(255, 230, 236, 0.025);
}

body[data-card-skin="red-tithe"].shutdown-mode .status-panel {
  border-left-color: #fff0f4;
  background: linear-gradient(90deg, rgba(239, 40, 88, 0.28), rgba(18, 3, 8, 0.96));
}

body[data-card-skin="red-tithe"].shutdown-mode::after {
  border-color: #fff0f4;
  color: #fff0f4;
  background: rgba(12, 1, 5, 0.95);
  box-shadow: 0 0 44px rgba(239, 40, 88, 0.48);
}

body[data-card-skin="red-tithe"] .premium-modal {
  background: rgba(8, 0, 3, 0.86);
}

body[data-card-skin="red-tithe"] .premium-panel {
  border-color: rgba(239, 40, 88, 0.52);
  background: linear-gradient(155deg, #1a050b, #050102 72%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.78), 0 0 36px rgba(239, 40, 88, 0.15);
}

body[data-card-skin="red-tithe"] .inspect-systems > div {
  border-color: rgba(112, 34, 52, 0.78);
  background: #0b0205;
}

body[data-card-skin="red-tithe"] .inspect-systems .system-on {
  border-color: rgba(239, 40, 88, 0.78);
}

body[data-card-skin="red-tithe"] .inspect-gold {
  border-top-color: rgba(112, 34, 52, 0.78);
}

body[data-card-skin="red-tithe"] .replay-panel {
  border-color: rgba(239, 40, 88, 0.46);
  background: rgba(8, 2, 4, 0.91);
}

body[data-card-skin="red-tithe"] .replay-card {
  border-color: rgba(239, 40, 88, 0.88);
}

body[data-card-skin="red-tithe"] .room-tools-panel {
  border-color: rgba(239, 40, 88, 0.42);
  background: rgba(8, 2, 4, 0.96);
}

body[data-card-skin="red-tithe"] .end-room-button {
  border-color: #c64a65;
  color: #ffe5eb;
  background: rgba(88, 7, 29, 0.44);
}

body[data-card-skin="red-tithe"] .end-room-button:not(:disabled):active {
  background: rgba(132, 10, 42, 0.52);
}

@media (max-width: 430px) {
  .room-tools-grid { grid-template-columns: 1fr; }
  .end-room-button { width: 100%; }
}
