/* うなずき単語帳 — Meta Ray-Ban Display (600x600, additive display) */

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

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

.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.panel {
  background: #0f1116;
  border: 1px solid #2a2e38;
  border-radius: 24px;
  padding: 28px 32px;
  width: 540px;
  max-height: 584px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.title-emoji { font-size: 44px; line-height: 1; }

.app-title { font-size: 30px; font-weight: 800; letter-spacing: 1px; }

.app-sub { font-size: 15px; color: #b0b3b8; line-height: 1.6; }

.panel-title { font-size: 24px; font-weight: 800; }
.panel-title-sub { font-size: 14px; font-weight: 400; color: #b0b3b8; }

/* --- home stats --- */
.home-stats { display: flex; gap: 12px; }
.stat {
  background: #171a21;
  border: 1px solid #2a2e38;
  border-radius: 16px;
  width: 140px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-num { font-size: 28px; font-weight: 800; color: #ffd166; }
.stat:first-child .stat-num { color: #7ddcff; }
.stat-label { font-size: 12px; color: #b0b3b8; }
.next-due { font-size: 13px; color: #b0b3b8; min-height: 16px; }

/* --- buttons --- */
.btn {
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  background: #1c2029;
  border: 2px solid #3a4150;
  border-radius: 16px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.6, 0, 0.4, 1), border-color 200ms, background 200ms;
}
.btn-primary { background: #234; border-color: #7ddcff; color: #ffffff; }
.btn-row { display: flex; gap: 12px; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }

.focusable:focus {
  outline: none;
  border-color: #4dd0e1;
  background: #24303a;
  box-shadow: 0 0 0 3px rgba(77, 208, 225, 0.35), 0 0 18px rgba(77, 208, 225, 0.25);
  transform: scale(0.97);
}

/* --- howto --- */
.howto-list {
  list-style: none;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #e4e6eb;
}
.howto-list b { color: #ffd166; }

/* --- word list --- */
.panel-list { padding: 20px 24px; }
.word-list {
  width: 100%;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding: 2px;
}
.scroll-container { scrollbar-width: none; }
.scroll-container::-webkit-scrollbar { display: none; }

.word-row {
  background: #171a21;
  border: 2px solid #2a2e38;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  flex-shrink: 0;
}
.word-row .w { font-size: 17px; font-weight: 700; }
.word-row .w small { font-size: 12px; font-weight: 400; color: #b0b3b8; margin-left: 8px; }
.word-row .due { font-size: 12px; color: #b0b3b8; white-space: nowrap; }
.word-row .due.overdue { color: #7ddcff; font-weight: 700; }
.word-row .due.fresh { color: #ffd166; }

/* --- study --- */
#screen-study { flex-direction: column; justify-content: flex-start; padding: 20px 30px; gap: 10px; }

.study-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #b0b3b8;
}
.study-gyro { font-size: 12px; }
.study-gyro.on { color: #4ade80; }

.progress-bar {
  width: 100%;
  height: 6px;
  background: #171a21;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #7ddcff;
  border-radius: 3px;
  transition: width 300ms ease;
}

.card {
  background: #0f1116;
  border: 1px solid #2a2e38;
  border-radius: 24px;
  width: 100%;
  height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 28px;
  text-align: center;
  position: relative;
}
.card-badge {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #0f1116;
  background: #ffd166;
  border-radius: 10px;
  padding: 3px 10px;
}
.card-badge.review { background: #7ddcff; }
.card-word { font-size: 46px; font-weight: 800; letter-spacing: 1px; word-break: break-word; }
.card-meaning { font-size: 28px; font-weight: 700; color: #ffd166; line-height: 1.3; }
.card-example { font-size: 15px; color: #b0b3b8; margin-top: 10px; line-height: 1.5; }
.card-hint { font-size: 14px; color: #b0b3b8; position: absolute; bottom: 18px; }

.study-controls {
  width: 100%;
  display: flex;
  gap: 12px;
}
.ctrl {
  flex: 1;
  background: #12151b;
  border-radius: 16px;
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
.ctrl-ok { border: 1px solid #2c5540; }
.ctrl-ng { border: 1px solid #5a3038; }
.ctrl-sub { font-size: 12px; font-weight: 400; color: #b0b3b8; }

/* --- judge feedback --- */
.judge {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 11, 15, 0.82);
  z-index: 20;
}
.judge-mark { font-size: 90px; line-height: 1; }
.judge-text { font-size: 22px; font-weight: 800; }
.judge.ok .judge-text { color: #4ade80; }
.judge.ng .judge-text { color: #f87171; }

/* --- overlay (pause) --- */
.overlay { background: rgba(0, 0, 0, 0.6); z-index: 30; }
.panel-overlay { width: 420px; }

/* --- result --- */
.result-rows { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.result-row {
  background: #171a21;
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  font-size: 17px;
}
.result-row b { color: #ffd166; }
.result-msg { font-size: 14px; color: #b0b3b8; line-height: 1.6; }
