:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: #eaf0ff;
  color: #0f1f4d;
}

.container {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
}

h1 {
  margin-bottom: 0.25rem;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: #334a84;
  letter-spacing: 0.01em;
}

.card {
  display: none;
  background: #ffffff;
  border: 1px solid #c9d8ff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(11, 31, 91, 0.08);
  padding: 1rem;
}

.card.active {
  display: block;
}

.card h2 {
  margin-top: 0;
}

.current-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.current-card-header h2 {
  margin-bottom: 0.5rem;
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#exerciseSelect {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #9fb5ef;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  color: #0f1f4d;
  background: #f8faff;
}

.helper-text {
  margin: 0;
  color: #334a84;
  font-size: 0.92rem;
}

.start-btn,
.main-menu-btn,
.toggle-btn,
.reset-btn {
  border: 1px solid #9fb5ef;
  border-radius: 8px;
  background: #f4f7ff;
  color: #0f1f4d;
  font-weight: 600;
  cursor: pointer;
}

.start-btn {
  min-width: 130px;
  padding: 0.7rem 1.1rem;
  text-transform: lowercase;
  border-radius: 4px;
  background: #0b1f5b;
  border-color: #0b1f5b;
  color: #fff;
}

.start-btn:hover {
  background: #132d7a;
}

.main-menu-btn {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
  background: #dce6ff;
  border-color: #0b1f5b;
  color: #0b1f5b;
}

.toggle-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 0.75rem;
  margin-top: 1rem;
}

.toggle-btn {
  width: 150px;
  height: 110px;
  padding: 0.75rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.toggle-btn.label-mode {
  background: #16388f;
  border-color: #0b1f5b;
  color: #fff;
}

.toggle-btn.bite-mode {
  background: #fff;
  border-color: #9fb5ef;
  color: #0f1f4d;
}

.toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.microphone-wrap {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.microphone-btn {
  border: none;
  outline: none;
  border-radius: 9999px;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
}

.microphone-btn.inactive {
  background: #0b1f5b;
  color: #ffffff;
}

.microphone-btn.active {
  background: #ffffff;
  color: #0b1f5b;
  border: 2px solid #0b1f5b;
}

.microphone-btn.retry-ready {
  width: auto;
  padding: 0 1rem 0 0.85rem;
}

.reset-btn {
  border: 1px solid #9fb5ef;
  border-radius: 8px;
  background: #edf2ff;
  color: #0f1f4d;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}


.current-card-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.microphone-hint {
  margin: 0;
  font-size: 0.9rem;
  color: #334a84;
  text-align: center;
}

.speech-feedback {
  margin: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.speech-feedback-success {
  background: #e7f7ed;
  border: 1px solid #9dd8af;
  color: #1f6f3f;
}

.speech-feedback-neutral {
  background: #eef2fb;
  border: 1px solid #ccd8f1;
  color: #334a84;
}


.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.icon {
  font-size: 1.2rem;
  line-height: 1;
}

.microphone-btn .icon {
  font-size: 1.7rem;
}

.microphone-btn.retry-ready .icon-label {
  font-weight: 600;
}

.icon-label {
  line-height: 1;
}

.category-list,
.subcategory-list,
.expression-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.menu-toggle-all-btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.86rem;
}

.menu-toggle-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.category-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.category-item {
  border: 1px solid #c9d8ff;
  border-radius: 10px;
  background: #f8faff;
  padding: 0.35rem 0.55rem;
}

.subcategory-list {
  margin-top: 0.35rem;
  padding-left: 1rem;
  border-left: 2px solid #d7e3ff;
  display: grid;
  gap: 0.35rem;
}

.expression-list {
  margin-top: 0.25rem;
  padding-left: 1.1rem;
  border-left: 2px dotted #d7e3ff;
  display: grid;
  gap: 0.15rem;
}

.subcategory-item {
  padding: 0.15rem 0;
}

.list-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.35rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.level-one,
.level-two {
  font-weight: 600;
  border-radius: 8px;
}

.level-one:hover,
.level-two:hover,
.expression-btn:hover {
  background: #eaf0ff;
}

.expression-btn {
  font-weight: 500;
  border-radius: 8px;
  padding-left: 0.25rem;
}

.jp-inline {
  color: #334a84;
  font-size: 0.92rem;
}

.expression-en {
  font-weight: 600;
}

.item-count {
  margin-left: auto;
  min-width: 1.3rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  background: #dce6ff;
  color: #0b1f5b;
  padding: 0.05rem 0.35rem;
}

.exercise-center {
  min-height: 210px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.expression-center {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.exercise-bottom-actions {
  position: relative;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-bottom-actions.left-enabled {
  justify-content: flex-end;
}

.exercise-bottom-actions.right-enabled {
  justify-content: flex-start;
}

.hint-btn {
  border: 1px solid #9fb5ef;
  border-radius: 999px;
  background: #f4f7ff;
  color: #0f1f4d;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
}

.hint-bubble {
  display: none;
  max-width: 90%;
  background: #0b1f5b;
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
}

.hint-bubble.visible {
  display: block;
}

.stage-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 3.4rem;
}

.stage-top-title {
  margin: 0;
  font-size: 0.92rem;
  color: #334a84;
}

.frequency-stars {
  margin-top: 0.25rem;
  font-size: 1.4rem;
  letter-spacing: 0.2rem;
  color: #f4c430;
}

.star-empty {
  color: #d4d7e0;
}

.expression-jp {
  margin-top: 0.65rem;
  margin-bottom: 0;
  color: #334a84;
  font-size: 1rem;
}

.stage-arrow {
  position: absolute;
  bottom: 0;
  border: 1px solid #9fb5ef;
  border-radius: 999px;
  width: 2.3rem;
  height: 2.3rem;
  background: #f4f7ff;
  color: #0f1f4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stage-arrow-left {
  left: 0;
}

.stage-arrow-right {
  right: 0;
}
