.learn-body {
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.13), transparent 28%),
    linear-gradient(315deg, rgba(47, 191, 113, 0.12), transparent 34%),
    var(--color-paper);
  min-height: 100vh;
}

.learn-shell,
.deck-shell {
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 28px;
}

.learn-header,
.deck-header {
  align-items: center;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  margin-bottom: 18px;
}

.learn-kicker {
  color: var(--color-blue);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.learn-header h1,
.deck-header h1 {
  font-size: 48px;
  line-height: 1;
  margin: 0;
}

.icon-link {
  background: var(--color-white);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  min-height: 48px;
  padding: 0 22px;
}

.tile-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.learn-tile {
  border: 4px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--space-3);
  min-height: 180px;
  padding: var(--space-6);
  text-decoration: none;
}

.learn-tile strong {
  font-size: 44px;
  line-height: 1.05;
}

.learn-tile span,
.empty-learn p {
  color: var(--color-muted);
  font-size: 22px;
}

.learn-tile.color-0 {
  background: #f7ffcf;
}

.learn-tile.color-1 {
  background: #dff5ff;
}

.learn-tile.color-2 {
  background: #ffe1ef;
}

.learn-tile.color-3 {
  background: #ffe8bd;
}

.empty-learn {
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.study-layout {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
}

.progress-pill {
  background: var(--color-white);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-size: 22px;
  font-weight: 900;
  padding: 14px 22px;
}

.nav-button {
  aspect-ratio: 1;
  background: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  color: var(--color-blue);
  font-size: 56px;
  line-height: 1;
  width: 72px;
}

.flashcard {
  border: 0;
  cursor: pointer;
  height: min(52vh, 520px);
  justify-self: center;
  perspective: 1400px;
  width: min(100%, calc(min(52vh, 520px) * 16 / 9));
}

.flashcard-inner {
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--duration-card);
  width: 100%;
}

.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  align-items: center;
  backface-visibility: hidden;
  border: 6px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  display: grid;
  inset: 0;
  overflow: hidden;
  padding: var(--space-5);
  position: absolute;
}

.flashcard-front {
  background: var(--color-white);
  grid-template-rows: minmax(0, 1fr) auto;
}

.flashcard-front img {
  border-radius: 24px;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.sentence-list {
  display: grid;
  gap: 10px;
  margin-top: var(--space-4);
  width: 100%;
}

.sentence-button {
  align-items: center;
  background: #f7ffcf;
  border: 3px solid rgba(47, 128, 237, 0.18);
  border-radius: 18px;
  color: var(--color-ink);
  display: flex;
  font-size: 26px;
  font-weight: 900;
  gap: 10px;
  justify-content: center;
  line-height: 1.16;
  min-height: 56px;
  padding: 8px 14px;
  text-align: center;
  width: 100%;
}

.sentence-button.is-active,
.sentence-button:active {
  background: #dff5ff;
  border-color: var(--color-blue);
}

.sentence-button small {
  background: var(--color-orange);
  border-radius: 999px;
  color: var(--color-white);
  flex: 0 0 auto;
  font-size: 13px;
  padding: 4px 8px;
}

.flashcard-back {
  background: linear-gradient(135deg, #dff5ff, #ffe1ef);
  transform: rotateY(180deg);
}

.flashcard-back strong {
  font-size: 112px;
  line-height: 1;
  text-align: center;
}

.learn-controls,
.srs-actions {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  margin: 18px auto 0;
  padding: 14px;
}

.learn-controls label {
  align-items: center;
  color: var(--color-muted);
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: var(--space-2);
}

.learn-controls input[type="number"] {
  border: 2px solid #d7e4f2;
  border-radius: 12px;
  font-weight: 900;
  padding: 8px 10px;
  width: 72px;
}

.learn-controls input[type="checkbox"] {
  height: 22px;
  width: 22px;
}

.primary-control {
  background: var(--color-green);
  border-radius: 16px;
  color: var(--color-white);
  min-height: 48px;
  padding: 0 28px;
}

.secondary-control {
  background: var(--color-blue);
  border-radius: 16px;
  color: var(--color-white);
  min-height: 48px;
  padding: 0 24px;
}

.deck-shell:fullscreen,
.deck-shell.is-fullscreen {
  background:
    linear-gradient(135deg, rgba(47, 128, 237, 0.13), transparent 28%),
    linear-gradient(315deg, rgba(47, 191, 113, 0.12), transparent 34%),
    var(--color-paper);
  max-width: none;
  padding: 18px 28px;
}

.deck-shell:fullscreen .flashcard,
.deck-shell.is-fullscreen .flashcard {
  aspect-ratio: 16 / 9;
  height: auto;
  width: min(100%, calc(66vh * 16 / 9));
}

.srs-actions button {
  border-radius: 16px;
  color: var(--color-white);
  min-height: 50px;
  padding: 0 28px;
}

#dont-know-button {
  background: var(--color-orange);
}

#know-button {
  background: var(--color-green);
}

.learn-message {
  color: var(--color-muted);
  font-size: 18px;
  font-weight: 800;
  min-height: 28px;
  text-align: center;
}

.orientation-overlay {
  align-items: center;
  background: var(--color-sky);
  color: var(--color-ink);
  display: none;
  flex-direction: column;
  gap: 12px;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  text-align: center;
  z-index: 20;
}

.orientation-overlay strong {
  font-size: 44px;
}

.orientation-overlay span {
  color: var(--color-muted);
  font-size: 22px;
}

body.is-portrait .orientation-overlay {
  display: flex;
}

body.learn-fullscreen-lock {
  overflow: hidden;
}

.deck-shell.is-app-fullscreen {
  inset: 0;
  min-height: 100dvh;
  overflow: auto;
  position: fixed;
  width: 100vw;
  z-index: 40;
}

@media (max-width: 860px) {
  .study-layout {
    grid-template-columns: 1fr;
  }

  .nav-button {
    display: none;
  }

  .flashcard-back strong {
    font-size: 78px;
  }

  .flashcard {
    height: auto;
    aspect-ratio: 16 / 9;
    width: 100%;
  }
}
