body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: #020617;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.board-container {
  max-width: 680px;
  width: 90%;
  margin: 30px auto;
  padding: 24px;
  background: #0f172a;
  border-radius: 12px;
  border: 1px solid #1e293b;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

.brand-title { color: #818cf8; font-size: 16px; }
.brand-subtitle { font-size: 11px; color: #64748b; }

.instructions-heading { margin: 0 0 8px 0; font-size: 16px; }
.instructions-text { font-size: 12px; color: #94a3b8; margin: 0 0 16px 0; line-height: 1.5; }

/* 說明與規格資訊框 */
.rule-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 20px;
}
.rule-heading {
  margin: 12px 0 6px 0;
  font-size: 13px;
  color: #38bdf8;
}
.rule-heading:first-child { margin-top: 0; }
.rule-box p { margin: 4px 0; }
.rule-example {
  background: #0f172a;
  border-left: 3px solid #6366f1;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 11.5px;
  color: #a5b4fc;
}
.time-notice {
  margin-top: 12px;
  color: #f59e0b;
  font-weight: bold;
}

.action-row-center {
  display: flex;
  justify-content: center;
}

.timer-display {
  margin: 16px 0;
  text-align: right;
  color: #38bdf8;
  font-size: 13px;
  font-weight: bold;
}

.action-row {
  margin-top: 24px;
  text-align: right;
}

.hidden { display: none !important; }

/* 摩天樓網格排版 */
.grid-board { display: flex; flex-direction: column; width: fit-content; margin: 0 auto; gap: 6px; }
.grid-row { display: flex; gap: 6px; }
.cell-corner { width: 44px; height: 44px; }
.cell-clue {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-weight: bold; color: #38bdf8; font-size: 15px;
}
.cell-input {
  width: 44px; height: 44px; background: #1e293b; border: 1px solid #334155; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: bold;
  cursor: pointer; user-select: none; transition: border-color 0.15s, background-color 0.15s;
}
.cell-input:hover { background-color: #334155; }
.cell-input:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }

/* 結算報告 */
.result-heading { text-align: center; margin: 0 0 4px 0; font-size: 18px; outline: none; }
.result-subtext { text-align: center; font-size: 12px; color: #94a3b8; margin: 0 0 20px 0; }
.radar-box { margin: 20px 0; }

.metrics-panel {
  background: #020617;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metrics-panel p { margin: 0; }
.highlight-val { color: #818cf8; }
.mono-sub { color: #cbd5e1; font-size: 12px; }
.mono-mute { color: #64748b; font-size: 11px; }

.result-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* SVG 雷達圖樣式 */
.radar-svg { overflow: visible; display: block; margin: 0 auto; }
.radar-grid { fill: rgba(15, 23, 42, 0.4); stroke: #334155; stroke-dasharray: 2, 2; }
.radar-data-area { fill: rgba(99, 102, 241, 0.35); stroke: #818cf8; stroke-width: 2; }
.radar-axis { stroke: #1e293b; stroke-width: 1; }
.radar-label { font-size: 9px; fill: #94a3b8; text-anchor: middle; dominant-baseline: central; font-weight: bold; }

/* 按鈕樣式 */
.btn-primary {
  background: #4f46e5; color: #fff; padding: 8px 18px; border: none; border-radius: 6px;
  cursor: pointer; font-weight: bold; font-size: 13px; transition: background-color 0.15s;
}
.btn-primary:hover { background: #4338ca; }

.btn-primary-large {
  background: #4f46e5; color: #fff; padding: 12px 28px; border: none; border-radius: 8px;
  cursor: pointer; font-weight: bold; font-size: 14px; transition: background-color 0.15s;
}
.btn-primary-large:hover { background: #4338ca; }

.btn-secondary {
  background: #1e293b; color: #cbd5e1; border: 1px solid #334155; padding: 8px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; transition: background-color 0.15s;
}
.btn-secondary:hover { background: #334155; }

.footer-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #475569;
  padding: 20px;
}
