:root {
  --color-red: #e5473a;
  --color-yellow: #f2c230;
  --color-green: #2fa84f;
  --color-blue: #2b6fd4;
  --color-wild-a: #2b2b34;
  --color-wild-b: #4a4a58;

  --bg: #12141c;
  --surface: #1c1f2b;
  --surface-2: #262a3a;
  --text: #f2f3f7;
  --text-dim: #a3a8ba;
  --accent: #6f8dff;
  --danger: #e5473a;
  --border: #333752;
  --radius: 12px;
}

:root[data-theme="light"] {
  --bg: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --text: #1b1d29;
  --text-dim: #5b5f74;
  --border: #dadde8;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef0f6;
    --surface: #ffffff;
    --surface-2: #f3f4fa;
    --text: #1b1d29;
    --text-dim: #5b5f74;
    --border: #dadde8;
  }
}

* {
  box-sizing: border-box;
}

/* Page lock, any resolution (phone or PC): the page itself never scrolls,
   bounces, or resizes around - the only thing that slides is the hand row
   (.hand-row, see layout.css/handView.js). Each .screen still has its own
   overflow-y:auto as a safety net for tall content, so this isn't a hard
   content trap, just a fixed, app-like viewport at every screen size. */
html, body {
  height: 100%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* App-like feel on desktop too: no text-selection cursor/highlight while
     clicking/dragging cards or UI chrome. Inputs opt back in below since
     users still need to select/edit their name and room code. */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

h1, h2, h3 {
  margin: 0 0 0.5em 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-warn {
  background: var(--color-red);
}

.btn-small {
  padding: 0.4em 0.9em;
  font-size: 0.85rem;
}

.error-text {
  color: var(--color-red);
  min-height: 1.2em;
  font-size: 0.9rem;
  text-align: center;
}

.sound-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 300;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.toast-container {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5em 1em;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.15s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-info-tooltip {
  position: fixed;
  z-index: 900;
  max-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
  animation: tooltipFadeIn 0.15s ease-out;
}

.card-info-tooltip.hidden {
  display: none;
}

.card-info-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

.card-info-desc {
  color: var(--text-dim);
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
