:root {
  --bg: #0b1020;
  --panel: #0f1730;
  --card: #0f1730;
  --text: #e7eefc;
  --muted: #a7b3d6;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(56, 189, 248, 0.12), transparent),
    radial-gradient(800px 600px at 80% 20%, rgba(99, 102, 241, 0.14), transparent),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.title .brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 18px;
}
.title .subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.content {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  padding: 14px;
}

@media (max-width: 980px) {
  .content {
    grid-template-columns: 1fr;
  }
}

.boardWrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 48, 0.35);
}

.board {
  display: block;
  width: 100%;
  height: calc(100vh - 110px);
  min-height: 520px;
}

.helpOverlay {
  pointer-events: none;
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(231, 238, 252, 0.95);
  font-size: 13px;
  line-height: 1.25;
}

.helpOverlay b {
  color: #fff;
}

.hoverCoords {
  pointer-events: none;
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(231, 238, 252, 0.95);
  font-size: 13px;
  line-height: 1.2;
  min-width: 120px;
}

.winOverlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none; /* toggled by JS */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.winOverlay.show {
  display: flex;
}

.winCenter {
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.45);
  text-align: center;
}

.winText {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.winSub {
  font-size: 14px;
  color: rgba(231, 238, 252, 0.9);
}

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

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 48, 0.65);
}

.card.small {
  padding: 12px 14px;
}

.card h2 {
  margin: 0 0 10px 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(231, 238, 252, 0.95);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.row label {
  font-size: 13px;
  color: var(--muted);
}

.row input[type="color"] {
  width: 42px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  outline: none;
  font-weight: 700;
}

.row input[type="text"]::placeholder {
  color: rgba(231, 238, 252, 0.45);
  font-weight: 600;
}

.statusRow {
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.statusLabel {
  font-size: 13px;
  color: var(--muted);
}

.statusText {
  font-size: 15px;
  font-weight: 700;
}

.statusBlock {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.requestBox {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.requestText {
  font-size: 13px;
  color: rgba(231, 238, 252, 0.95);
}

.hidden {
  display: none;
}

.ruleBlock {
  font-size: 13px;
  color: rgba(231, 238, 252, 0.92);
  line-height: 1.35;
}
.ruleBlock b {
  color: #fff;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.compact {
  margin: 0 0 8px 0;
  font-size: 12px;
}

.btn.primary {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.9), rgba(99, 102, 241, 0.65));
  border-color: rgba(99, 102, 241, 0.75);
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

p {
  margin: 0 0 8px 0;
  color: rgba(231, 238, 252, 0.92);
  font-size: 13px;
  line-height: 1.4;
}

.muted {
  color: var(--muted);
}

.qrModal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.qrModal.show {
  display: flex;
}

.qrCard {
  width: min(92vw, 360px);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.95);
  text-align: center;
}

.qrTitle {
  font-weight: 800;
  margin-bottom: 10px;
}

#qrCanvas {
  width: 280px;
  height: 280px;
  max-width: 100%;
  background: #fff;
  border-radius: 8px;
}

.qrHelp {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

