/* グラス姿勢 — Glass Posture
   600×600 加算式ディスプレイ用。#000000 は透明（ページ背景のみ）、
   UI面は暗グレーで発光させて視認させる。 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000000; /* additive display: transparent */
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  user-select: none;
}

#app { width: 600px; height: 600px; padding: 8px; }

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

/* ---------- ヘッダー ---------- */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 20px;
  margin-top: 16px;
  background: #101218;
  border: 1px solid #262a33;
  border-radius: 20px;
  flex-shrink: 0;
}
.header h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.04em; flex: 1; }
.header-meta { font-size: 14px; color: #b0b3b8; }

.back-btn {
  width: 64px; height: 48px;
  font-size: 24px;
  background: #1c1f27;
  color: #ffffff;
  border: 1px solid #2c313c;
  border-radius: 14px;
  cursor: pointer;
}

/* ---------- コンテンツ ---------- */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 8px 8px;
  min-height: 0;
}

/* ---------- ホーム ---------- */
.home-content { justify-content: space-between; padding-bottom: 12px; }
.home-hero { text-align: center; margin-top: 10px; }
.home-icon { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.home-lead { font-size: 17px; line-height: 1.7; color: #e4e6eb; }

.menu { display: flex; flex-direction: column; gap: 12px; width: 440px; }
.menu-row { display: flex; gap: 12px; }

.menu-btn, .big-btn, .ghost-btn {
  height: 76px;
  padding: 0 20px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  background: #171a21;
  color: #ffffff;
  border: 1px solid #2c313c;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1),
              background 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
              box-shadow 300ms;
}
.menu-row .menu-btn { flex: 1; }

.big-btn {
  width: 460px;
  height: 96px;
  font-size: 23px;
  background: #12303a;
  border-color: #2e6f80;
}
.ghost-btn {
  height: 60px;
  font-size: 17px;
  background: #12141a;
  color: #cfd3da;
}

/* フォーカスリング（シアン発光） */
.focusable:focus {
  outline: none;
  background: #1d2530;
  border-color: #7ee7ff;
  box-shadow: 0 0 0 2px #7ee7ff, 0 0 22px rgba(126, 231, 255, 0.45);
  transform: scale(0.97);
}

/* ---------- キャリブレーション ---------- */
.calib-text {
  font-size: 19px;
  line-height: 1.8;
  text-align: center;
  color: #e4e6eb;
  margin-top: 28px;
}
.calib-text strong { color: #7ee7ff; }
#calibrate-pane { gap: 26px; }

/* ---------- 監視 ---------- */
#monitor-pane { gap: 8px; padding-top: 6px; }
#gauge { flex-shrink: 0; }

.readout-row { display: flex; align-items: center; gap: 18px; }
.angle-readout {
  font-size: 44px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 120px;
  text-align: right;
  color: #7ee7ff;
}
.angle-readout.warn { color: #ffb84d; }
.angle-readout.bad { color: #ff7a76; }

.status-chip {
  font-size: 16px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  background: #123a2b;
  color: #8af0c0;
  border: 1px solid #2a6f52;
}
.status-chip.warn { background: #3a2c12; color: #ffd28a; border-color: #806326; }
.status-chip.bad { background: #3a1514; color: #ffa19d; border-color: #8a3230; }

.stat-row {
  display: flex;
  gap: 26px;
  font-size: 15px;
  color: #b0b3b8;
  font-variant-numeric: tabular-nums;
}

/* 警告オーバーレイ */
.alert-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 104px;
  pointer-events: none;
  z-index: 20;
}
.alert-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 34px;
  background: #40100e;
  border: 2px solid #ff7a76;
  border-radius: 24px;
  box-shadow: 0 0 34px rgba(255, 90, 84, 0.55);
  animation: alert-pulse 900ms ease-in-out infinite;
}
.alert-icon { font-size: 40px; color: #ffd28a; }
.alert-text { font-size: 30px; font-weight: 800; color: #ffffff; }
@keyframes alert-pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 24px rgba(255, 90, 84, 0.4); }
  50%      { transform: scale(1.04); box-shadow: 0 0 44px rgba(255, 90, 84, 0.75); }
}

.demo-banner {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 13px;
  color: #9aa0a8;
  background: #101218;
  border: 1px solid #262a33;
  border-radius: 999px;
  padding: 5px 16px;
  white-space: nowrap;
}

/* ---------- 結果 ---------- */
.result-main { text-align: center; margin-top: 4px; }
.result-pct {
  font-size: 84px;
  font-weight: 800;
  line-height: 1.1;
  color: #8af0c0;
  font-variant-numeric: tabular-nums;
}
.result-pct.warn { color: #ffd28a; }
.result-pct.bad { color: #ffa19d; }
.result-pct-label { font-size: 15px; color: #b0b3b8; margin-top: 2px; }
.result-comment { font-size: 17px; color: #e4e6eb; margin-top: 10px; }

.result-grid {
  display: flex;
  gap: 12px;
  width: 520px;
  justify-content: center;
}
.records-grid { flex-wrap: wrap; width: 460px; }
.records-grid .result-cell { width: 220px; }

.result-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  background: #101218;
  border: 1px solid #262a33;
  border-radius: 18px;
}
.rc-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-label { font-size: 13px; color: #b0b3b8; }

.records-note { font-size: 15px; color: #b0b3b8; }
#records .menu-btn, #settings .menu-btn { width: 440px; }

/* ---------- せってい ---------- */
.settings-content { gap: 16px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 520px;
  padding: 14px 22px;
  background: #101218;
  border: 1px solid #262a33;
  border-radius: 18px;
}
.setting-label { font-size: 18px; font-weight: 700; }
.setting-ctrl { display: flex; align-items: center; gap: 14px; }
.setting-value {
  font-size: 22px;
  font-weight: 800;
  min-width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #7ee7ff;
}
.adj-btn {
  width: 72px;
  height: 60px;
  font-size: 26px;
  font-weight: 700;
  font-family: inherit;
  background: #1c1f27;
  color: #ffffff;
  border: 1px solid #2c313c;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1), background 300ms;
}
.adj-btn.wide { width: 160px; font-size: 20px; }
