/* ═══════════════════════════════════════════════════════════
   Math_Point3r — Global Stylesheet
   字體: Noto Sans Bold (font-weight: 700)
   風格: 極簡、無動畫、無陰影、無過場
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  animation: none !important;
  transition: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

/* ─── Base ───────────────────────────────────────────────── */
html, body {
  height: 100%;
  width: 100%;
  background: #ffffff;
  color: #000000;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

/* ─── Screen System ──────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

/* ─── Typography ─────────────────────────────────────────── */
.title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 40px;
}

/* ─── Menu ───────────────────────────────────────────────── */
.menu-block {
  width: 100%;
  max-width: 520px;
  border: 2px solid #000000;
  margin-bottom: 32px;
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 2px solid #000000;
  gap: 16px;
  flex-wrap: wrap;
}
.menu-row:last-child {
  border-bottom: none;
}

.menu-label {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Segmented Button Group ─────────────────────────────── */
.btn-group {
  display: flex;
  border: 2px solid #000000;
}

.seg-btn {
  flex: 1;
  padding: 10px 20px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-right: 2px solid #000000;
  cursor: pointer;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.3;
}
.seg-btn:last-child {
  border-right: none;
}
.seg-btn.active {
  background: #000000;
  color: #ffffff;
}
.seg-btn small {
  font-size: 0.75rem;
  font-weight: 700;
  display: block;
}

/* ─── Toggle Switch ──────────────────────────────────────── */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle input[type="checkbox"] {
  display: none;
}
.toggle-track {
  width: 48px;
  height: 26px;
  background: #cccccc;
  border: 2px solid #000000;
  display: flex;
  align-items: center;
  padding: 2px;
  position: relative;
}
.toggle-thumb {
  width: 18px;
  height: 18px;
  background: #000000;
  position: absolute;
  left: 2px;
}
.toggle input:checked + .toggle-track {
  background: #000000;
}
.toggle input:checked + .toggle-track .toggle-thumb {
  background: #ffffff;
  left: calc(100% - 20px);
}
.toggle-text {
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 28px;
}

/* ─── Primary Button ─────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 14px 48px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  margin-bottom: 12px;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.btn-primary:hover {
  background: #333333;
}

/* ─── Secondary Button ───────────────────────────────────── */
.btn-secondary {
  display: inline-block;
  padding: 10px 32px;
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.btn-secondary:hover {
  background: #f0f0f0;
}

/* ─── Game Header ────────────────────────────────────────── */
#screen-game {
  display: none;
  flex-direction: column;
  padding: 0;
  min-height: 100vh;
}
#screen-game.active {
  display: flex;
}

#game-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 2px solid #000000;
  width: 100%;
  background: #ffffff;
}

.info-label {
  font-size: 0.75rem;
  color: #555555;
  display: block;
}
.info-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

#score-box,
#timer-box {
  display: flex;
  flex-direction: column;
  min-width: 60px;
}

#btn-menu {
  margin-left: auto;
  width: auto;
  max-width: none;
  padding: 8px 20px;
}

/* ─── Game Body ──────────────────────────────────────────── */
#game-body {
  display: flex;
  flex: 1;
  width: 100%;
}

/* ─── Camera Column ──────────────────────────────────────── */
#camera-col {
  width: 50%;
  border-right: 2px solid #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  min-height: 400px;
  overflow: hidden;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#camera-off-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  color: #555555;
  text-align: center;
}

/* ─── Info Column ────────────────────────────────────────── */
#info-col {
  width: 50%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

#question-box,
#gesture-box,
#feedback-box {
  border: 2px solid #000000;
  padding: 16px 20px;
}

.box-label {
  font-size: 0.75rem;
  color: #555555;
  margin-bottom: 8px;
}

#question-display {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#gesture-display {
  font-size: 2.5rem;
  font-weight: 700;
  color: #000000;
}

.hand-detail {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #555555;
}

/* ─── Feedback ───────────────────────────────────────────── */
.feedback-idle   { color: #555555; font-size: 1rem; }
.feedback-correct { color: #000000; font-size: 1.25rem; }
.feedback-wrong  { color: #000000; font-size: 1rem; }

/* ─── WebSocket Status ───────────────────────────────────── */
#ws-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #555555;
  margin-top: auto;
}
.ws-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #000000;
}
.ws-dot.connected    { background: #000000; }
.ws-dot.disconnected { background: #ffffff; }

/* ─── Result Screen ──────────────────────────────────────── */
#screen-result.active {
  gap: 20px;
}
#result-score-box {
  border: 2px solid #000000;
  padding: 32px 48px;
  text-align: center;
  margin: 24px 0;
  width: 100%;
  max-width: 360px;
}
.result-label {
  font-size: 0.85rem;
  color: #555555;
  margin-bottom: 4px;
}
#result-score {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1;
}
#result-total {
  font-size: 2rem;
  font-weight: 700;
}

/* ─── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
