@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: #ece8df;
  color: #24313a;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

.screen {
  min-height: 100%;
  overflow: auto;
  padding: 24px;
  background: var(--background, #ece8df);
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero-card,
.panel-card,
.exercise-card,
.modal-panel {
  background: var(--surface, #fbfaf6);
  border: 1px solid rgba(36, 49, 58, 0.08);
  box-shadow: 0 18px 48px rgba(36, 49, 58, 0.08);
}

.hero-card {
  border-radius: 32px;
  padding: 22px 24px;
}

.panel-card,
.exercise-card {
  border-radius: 28px;
  padding: 28px;
}

.display-title {
  font-family: "Fraunces", serif;
  letter-spacing: -0.03em;
}

.hero-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(36, 49, 58, 0.06);
  color: var(--primary, #3f5f5b);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.muted {
  color: rgba(36, 49, 58, 0.68);
}

.mode-grid,
.settings-grid {
  display: grid;
  gap: 20px;
}

.mode-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.settings-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.mode-card {
  min-height: 240px;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid rgba(36, 49, 58, 0.08);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 14px 36px rgba(36, 49, 58, 0.06);
}

.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(36, 49, 58, 0.05);
  color: var(--primary, #3f5f5b);
  box-shadow: inset 0 0 0 1px rgba(36, 49, 58, 0.06);
  font-size: 24px;
  font-weight: 800;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.choice-chip,
.letter-chip,
.mode-toggle {
  border: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.choice-chip:hover,
.letter-chip:hover,
.mode-toggle:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.choice-chip:active,
.letter-chip:active,
.mode-toggle:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  background: var(--primary, #3f5f5b);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(63, 95, 91, 0.18);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(63, 95, 91, 0.1);
  color: var(--primary, #3f5f5b);
  font-weight: 800;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text, #24313a);
  box-shadow: inset 0 0 0 1px rgba(36, 49, 58, 0.08);
}

.mode-toggle-row,
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-toggle {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(36, 49, 58, 0.06);
  color: rgba(36, 49, 58, 0.72);
  font-weight: 700;
}

.mode-toggle.active {
  background: rgba(63, 95, 91, 0.12);
  color: var(--primary, #3f5f5b);
  box-shadow: inset 0 0 0 1px rgba(63, 95, 91, 0.14);
}

.choice-chip {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(36, 49, 58, 0.06);
  color: rgba(36, 49, 58, 0.72);
  font-weight: 800;
}

.choice-chip.active {
  background: var(--primary, #3f5f5b);
  color: #fff;
  box-shadow: 0 10px 20px rgba(63, 95, 91, 0.16);
}

.summary-strip,
.status-note {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(36, 49, 58, 0.06);
  color: rgba(36, 49, 58, 0.82);
  font-size: 14px;
  font-weight: 700;
}

.pill strong {
  color: var(--text, #24313a);
}

.callout {
  padding: 18px 18px 20px;
  border-radius: 20px;
  background: rgba(36, 49, 58, 0.04);
}

.status-note {
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(166, 124, 82, 0.12);
  color: #7b5637;
  font-weight: 700;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(36, 49, 58, 0.04);
}

.toggle-row > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 62px;
  height: 36px;
  align-self: center;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(36, 49, 58, 0.16);
  transition: background-color 0.18s ease;
}

.slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(36, 49, 58, 0.16);
  transition: transform 0.18s ease;
}

.switch input:checked + .slider {
  background: var(--primary, #3f5f5b);
}

.switch input:checked + .slider::before {
  transform: translateX(26px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 33, 40, 0.42);
}

.modal-panel {
  width: min(960px, 100%);
  max-height: min(84vh, 860px);
  overflow: auto;
  border-radius: 28px;
  padding: 24px;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 12px;
}

.letter-chip {
  min-height: 58px;
  border-radius: 18px;
  background: rgba(36, 49, 58, 0.06);
  color: rgba(36, 49, 58, 0.88);
  font-size: 20px;
  font-weight: 800;
}

.letter-chip.active {
  background: var(--primary, #3f5f5b);
  color: #fff;
  box-shadow: 0 12px 28px rgba(63, 95, 91, 0.18);
}

.exercise-layout {
  display: grid;
  gap: 22px;
}

.progress-rail {
  height: 12px;
  border-radius: 999px;
  background: rgba(36, 49, 58, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #a67c52);
  transition: width 0.28s ease;
}

.word-stage {
  display: grid;
  place-items: center;
  min-height: 52vh;
  padding: 8px;
}

.word-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(720px, 100%);
  min-height: 260px;
  padding: 32px;
  border-radius: 32px;
  background: var(--surface, #fbfaf6);
  box-shadow: inset 0 0 0 1px rgba(36, 49, 58, 0.05), 0 22px 56px rgba(36, 49, 58, 0.1);
  animation: fade-up 0.3s ease;
}

.word-mark {
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(46px, 9vw, 98px);
  line-height: 1.04;
  text-align: center;
  letter-spacing: -0.04em;
  color: var(--primary, #3f5f5b);
  word-break: break-word;
  font-weight: 800;
}

.word-style-normal {
  font-family: "Manrope", system-ui, sans-serif;
  font-style: normal;
  text-transform: none;
}

.word-style-uppercase {
  font-family: "Manrope", system-ui, sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.word-style-italic {
  font-family: "Georgia", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}

.word-style-alt {
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  font-style: normal;
  letter-spacing: -0.01em;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(36, 49, 58, 0.06);
  font-weight: 800;
}

.timer-badge.danger {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.12);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .panel-card,
  .exercise-card,
  .modal-panel {
    padding: 20px;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 16px;
  }

  .mode-card {
    min-height: 220px;
  }

  .letter-grid {
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  }

  .word-display {
    min-height: 220px;
    padding: 24px 20px;
  }
}
