:root {
  color-scheme: light;
  --bg-top: #f4ecd8;
  --bg-bottom: #d9c1a2;
  --panel-bg: rgba(255, 250, 242, 0.94);
  --panel-border: rgba(120, 83, 38, 0.14);
  --text-main: #3f2b1d;
  --text-muted: #6b5238;
  --accent: #7a4c24;
  --button-bg: #8c5523;
  --button-bg-hover: #6f431b;
  --button-disabled: #ccb397;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 35%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app {
  width: min(92vw, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 24px 32px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(68, 42, 17, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: 0.08em;
}

.panel {
  width: min(100%, 620px);
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(122, 76, 36, 0.12);
}

.status,
.role-line {
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

.status {
  font-size: 18px;
  font-weight: 700;
}

.role-line {
  margin-top: 8px;
  font-size: 16px;
  color: var(--text-muted);
}

#role {
  color: var(--accent);
  font-weight: 700;
}

.board-shell {
  width: min(100%, 640px);
  padding: 16px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.25)),
    rgba(185, 141, 87, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 10px 22px rgba(92, 61, 24, 0.12);
}

#board {
  display: block;
  width: min(100%, 600px);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: #d9a957;
  box-shadow:
    inset 0 10px 18px rgba(255, 242, 207, 0.18),
    inset 0 -10px 18px rgba(117, 71, 22, 0.18);
  cursor: pointer;
  touch-action: manipulation;
}

.restart-btn {
  min-width: 180px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--button-bg);
  box-shadow: 0 10px 20px rgba(111, 67, 27, 0.18);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.restart-btn:hover:not(:disabled) {
  background: var(--button-bg-hover);
  transform: translateY(-1px);
}

.restart-btn:disabled {
  cursor: not-allowed;
  background: var(--button-disabled);
  box-shadow: none;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .app {
    padding: 18px 14px 24px;
    gap: 16px;
    border-radius: 18px;
  }

  .board-shell {
    padding: 10px;
    border-radius: 16px;
  }

  .status {
    font-size: 16px;
  }

  .role-line {
    font-size: 15px;
  }
}
