:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7785;
  --accent: #2b4a61;
  --accent-contrast: #ffffff;
  --border: #dde1e6;
  --chip-bg: #2b4a61;
  --chip-ink: #f4f5f7;
  --dropzone-empty: #e3e7eb;
  --dropzone-hover: #cfe0ea;
  --dropzone-filled: #bfe3c8;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.screen h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.screen p {
  color: var(--muted);
  line-height: 1.5;
  max-width: 60ch;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

.progress {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 720px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.remote-stage {
  position: relative;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.remote-svg {
  position: relative;
  width: 100%;
}

#remote-svg-inner {
  position: absolute;
  inset: 0;
}

.remote-svg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dropzones {
  position: absolute;
  inset: 0;
}

.dropzone {
  position: absolute;
  border-radius: 50%;
  border: 2px dashed var(--dropzone-empty);
  background: rgba(227, 231, 235, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dropzone.drag-over {
  background: var(--dropzone-hover);
  border-color: var(--accent);
}

.dropzone.filled {
  border-style: solid;
  background: var(--dropzone-filled);
  border-color: #4d9c64;
}

.dropzone.result {
  cursor: default;
  border-style: solid;
}

.dropzone.result-none {
  background: #b4bac2;
  border-color: #b4bac2;
}

.dropzone.result-red {
  background: #d32f2f;
  border-color: #b3261e;
}

.dropzone.result-yellow {
  background: #ffb700;
  border-color: #9a6700;
}

.dropzone.result-green {
  background: #4caf50;
  border-color: #2e7d32;
}

.dropzone .placed-chip {
  transform: scale(0.92);
}

.label-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-content: flex-start;
  min-height: 3rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--chip-bg);
  color: var(--chip-ink);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  border: 2px solid transparent;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.chip.icon-chip {
  padding: 0.4rem;
  width: 2.75rem;
  height: 2.75rem;
}

.chip.icon-chip svg {
  width: 100%;
  height: 100%;
}

.chip.selected {
  border-color: #ffb703;
  box-shadow: 0 0 0 2px rgba(255, 183, 3, 0.4);
}

.chip.dragging {
  opacity: 0.5;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

[hidden] {
  display: none !important;
}
