/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --color-ink: #091653;
  --color-muted: #48557f;
  --color-blue: #2f70e6;
  --color-blue-dark: #2363d7;
  --color-line: #cbd7ed;
  --shadow-card: 0 16px 40px rgba(31, 59, 121, 0.12);
  --shadow-frame: 0 24px 60px rgba(22, 43, 90, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f4f8ff;
  color: var(--color-ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone-frame {
  width: min(100%, 390px);
  min-height: 800px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-frame);
}

.home-screen {
  background: linear-gradient(180deg, #edf6ff 0%, #f8fbff 22%, #f7fbff 100%);
}

.home-header {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
}

.brand-star {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 34px;
  filter: drop-shadow(0 4px 5px rgba(224, 155, 23, 0.25));
}

.round-icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #dcecff;
  color: #213878;
  display: grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
}

.home-main {
  padding: 22px 24px 28px;
}

.weeks-panel {
  margin-bottom: 18px;
  border: 1px solid #d8e6f7;
  border-radius: 12px;
  background: #edf7ff;
  padding: 18px;
}

.weeks-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 14px;
}

.weeks-panel h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.weeks-panel-header span {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 800;
}

.week-list {
  display: grid;
  gap: 10px;
}

.week-item {
  min-height: 50px;
  border: 1px solid #d0def1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  padding: 14px;
  text-decoration: none;
}

.week-item.is-selected {
  border-color: var(--color-blue);
  background: #fff;
  box-shadow: 0 10px 22px rgba(35, 99, 215, 0.14);
}

.week-name {
  font-size: 15px;
  font-weight: 900;
}

.week-result-mark {
  width: 24px;
  height: 24px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.week-result-mark.is-correct {
  background: #39b957;
}

.week-result-mark.is-wrong {
  background: #e06b68;
}

.home-card {
  min-height: 376px;
  padding: 28px;
  border: 1px solid #e4ebf6;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.notebook-icon {
  margin: 4px 0 22px;
  font-size: 76px;
  line-height: 1;
  filter: drop-shadow(0 8px 8px rgba(54, 76, 130, 0.18));
}

.home-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.home-card p {
  margin: 14px 0 34px;
  color: var(--color-muted);
  font-size: 18px;
  font-weight: 500;
}

.selected-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: -14px 0 26px;
  padding: 0;
  list-style: none;
}

.selected-words li {
  border: 1px solid #d8e3f5;
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 10px;
  color: #273867;
  font-size: 14px;
  font-weight: 800;
}

.button {
  width: 100%;
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
}

.button-primary {
  background: linear-gradient(
    180deg,
    var(--color-blue),
    var(--color-blue-dark)
  );
  color: #fff;
  box-shadow: 0 8px 18px rgba(35, 99, 215, 0.25);
}

.button-secondary {
  margin-top: 22px;
  border-color: var(--color-line);
  background: #fff;
  color: var(--color-ink);
}

.button-danger {
  margin-top: 14px;
  border-color: #f0b8b8;
  background: #fff;
  color: #b62525;
  font-size: 18px;
}

.button-danger:hover {
  background: #fff5f5;
}

.delete-week-form {
  margin: 0;
}

.add-week-button {
  min-height: 60px;
  border: 1px solid rgba(47, 112, 230, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(242, 248, 255, 0.98)
    ),
    linear-gradient(135deg, rgba(47, 112, 230, 0.14), rgba(57, 185, 87, 0.12));
  box-shadow: 0 10px 24px rgba(31, 59, 121, 0.1);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
}

.add-week-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    var(--color-blue),
    var(--color-blue-dark)
  );
  color: #fff;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(35, 99, 215, 0.24);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid currentColor;
}

.home-encouragement {
  position: absolute;
  inset-inline: 0;
  bottom: 52px;
  text-align: center;
  color: var(--color-ink);
  font-size: 17px;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 22, 83, 0.34);
}

.modal-panel {
  width: min(100%, 360px);
  border: 1px solid #d8e6f7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(22, 43, 90, 0.24);
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.14;
  letter-spacing: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf6ff;
  color: var(--color-ink);
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.word-list-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.form-field label {
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 900;
}

.form-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 210px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--color-ink);
  padding: 14px;
  line-height: 1.4;
}

.form-field textarea:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(47, 112, 230, 0.14);
  outline: 0;
}

.form-errors {
  border: 1px solid #f1b6b6;
  border-radius: 10px;
  background: #fff5f5;
  color: #8a2323;
  padding: 10px 12px;
}

.form-errors p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.test-screen {
  background: linear-gradient(180deg, #f5f9ff 0%, #fbfdff 100%);
}

.test-header {
  min-height: 96px;
  padding: 22px 24px 18px;
  color: #fff;
  background: linear-gradient(135deg, #2867dc, #3978ed);
}

.test-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
}

.test-exit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.test-exit-arrow {
  width: 16px;
  height: 16px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
}

.test-progress {
  height: 10px;
  margin: 21px 14px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.test-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #39c852, #35ad50);
}

.test-main {
  padding: 24px 22px 28px;
}

.test-card {
  min-height: 532px;
  padding: 56px 16px 64px;
  border: 1px solid #e4ebf6;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.test-card h1 {
  margin: 0 0 40px;
  font-size: 18px;
  letter-spacing: 0;
}

.test-card .button {
  margin-top: 28px;
  margin-inline: auto;
  min-height: 60px;
}

.test-card .button[hidden] {
  display: none;
}

.test-sound-button {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-blue), #225fd0);
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 44px;
  cursor: pointer;
}

.test-sound-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.test-sentence-button {
  width: 236px;
  margin-inline: auto;
  min-height: 52px;
  border: 1px solid #b6c7e6;
  border-radius: 999px;
  background: transparent;
  color: #2468df;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.test-sentence-button.is-loading {
  cursor: wait;
}

.sentence-button-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sentence-button-content[hidden] {
  display: none;
}

.sentence-button-playing {
  min-width: 92px;
}

.sentence-button-dots {
  display: inline-block;
  width: 18px;
  overflow: hidden;
  vertical-align: bottom;
  animation: sentence-dots 1.2s steps(4, end) infinite;
}

@keyframes sentence-dots {
  0%,
  25% {
    width: 0;
  }
  50% {
    width: 6px;
  }
  75%,
  100% {
    width: 12px;
  }
}

.test-answer-input {
  width: 100%;
  height: 70px;
  margin-top: 42px;
  border: 2px solid #226ced;
  border-radius: 10px;
  padding: 0 18px;
  color: var(--color-ink);
  font-size: 20px;
  font-weight: 500;
  outline: none;
}

.test-answer-input::placeholder {
  color: #b9c1d4;
}

.test-feedback {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 800;
}

.test-feedback.is-success {
  color: #258943;
}

.test-feedback.is-try-again {
  color: #b56b18;
}

.test-feedback.is-correct-answer {
  color: #b62525;
}

.test-next-button {
  margin-top: 28px;
}

.test-next-button[hidden] {
  display: none;
}

.results-screen {
  background: linear-gradient(180deg, #f2fbf4 0%, #fbfdfb 100%);
}

.results-header {
  padding: 34px 24px 28px;
  background: linear-gradient(135deg, #2ca64b, #43bc5b);
  color: #fff;
  text-align: center;
}

.results-header h1 {
  margin: 0;
  font-size: 30px;
}

.results-header p {
  margin: 10px 0 0;
  font-size: 19px;
  font-weight: 700;
}

.results-main {
  padding: 24px 22px 32px;
}

.results-card {
  padding: 24px 18px 28px;
  border: 1px solid #e0ebdf;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.results-card h2 {
  margin: 0 0 18px;
  color: var(--color-ink);
  font-size: 20px;
  text-align: center;
}

.results-list {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.results-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e3e9f0;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
}

.results-row.is-correct {
  border-color: #b9e5c2;
  background: #f2fbf4;
  color: #247b37;
}

.results-row.is-wrong {
  border-color: #f0c5c5;
  background: #fff7f6;
  color: #b62525;
}

.results-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.is-correct .results-mark {
  background: #39b957;
}

.is-wrong .results-mark {
  background: #e06b68;
}

.results-status {
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.results-card .button {
  width: min(100%, 280px);
  margin-inline: auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.test-encouragement {
  margin-top: 24px;
  min-height: 90px;
  border: 1px solid #dde3ff;
  border-radius: 12px;
  background: #fbfbff;
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  overflow: hidden;
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 600;
}

.test-monster {
  font-size: 66px;
  transform: translateY(8px);
}

@media (max-width: 420px) {
  .app-shell {
    min-height: 100vh;
    padding: 0;
    place-items: start center;
    background: #f7fbff;
  }

  .phone-frame {
    min-height: 100vh;
    border-radius: 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
  }
}

@media (min-width: 700px) {
  .app-shell {
    padding: 32px;
  }

  .phone-frame {
    width: min(100%, 820px);
    min-height: 680px;
  }

  .home-header {
    height: 112px;
    padding: 28px 42px 18px;
  }

  .brand {
    font-size: 24px;
  }

  .home-main {
    display: grid;
    grid-template-columns: minmax(260px, 0.86fr) minmax(0, 1.14fr);
    gap: 24px;
    align-items: stretch;
    padding: 28px 42px 32px;
  }

  .weeks-panel {
    min-height: 440px;
    margin-bottom: 0;
    padding: 24px;
  }

  .weeks-panel h2 {
    font-size: 26px;
  }

  .week-list {
    gap: 14px;
  }

  .week-item {
    min-height: 58px;
    padding: 18px;
  }

  .week-name {
    font-size: 17px;
  }

  .home-card {
    min-height: 440px;
    padding: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .home-card h1 {
    font-size: 36px;
  }

  .home-card p {
    font-size: 20px;
  }

  .selected-words {
    margin-bottom: 30px;
  }

  .button {
    max-width: 360px;
    margin-inline: auto;
  }

  .home-encouragement {
    position: static;
    padding: 6px 42px 34px;
    font-size: 19px;
  }

  .test-header {
    min-height: 104px;
    padding: 26px 42px 20px;
  }

  .test-topbar {
    font-size: 22px;
  }

  .test-progress {
    margin: 24px 0 0;
  }

  .test-main {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
    gap: 24px;
    align-items: start;
    padding: 28px 42px 32px;
  }

  .test-card {
    min-height: 440px;
    padding: 40px 38px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .test-card h1 {
    font-size: 22px;
  }

  .test-encouragement {
    margin-top: 0;
    min-height: 440px;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 12px;
    padding: 32px 24px;
    text-align: center;
    font-size: 18px;
  }

  .test-monster {
    font-size: 96px;
    transform: none;
  }
}
