* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f7fb; color: #1f2937; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #17365d, #0f2742); color: white; padding: 24px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.brand { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 20px; }
.sidebar-illustration { margin-bottom: 18px; }
.sidebar-illustration img { width: 100%; border-radius: 22px; }
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav a { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.08); }
.nav a:hover { background: rgba(255,255,255,.18); }
.sidebar-footer { font-size: .95rem; opacity: .95; }
.muted-light { color: rgba(255,255,255,.78); }
.content { padding: 28px; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.hero-rich { background: linear-gradient(135deg, #fff, #edf4ff); border-radius: 22px; padding: 20px; box-shadow: 0 10px 30px rgba(15,39,66,.06); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 14px; }
.stat-card, .panel, .topic-card, .exercise-card, .result-card, .login-card { background: white; border-radius: 18px; box-shadow: 0 10px 30px rgba(15,39,66,.08); }
.stat-card { padding: 16px; }
.stat-card span { display: block; color: #6b7280; font-size: .9rem; }
.stat-card strong { font-size: 1.6rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 20px 0 12px; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.level-card { background: linear-gradient(180deg, color-mix(in srgb, var(--card-color) 84%, white), var(--card-color)); color: white; padding: 18px; min-height: 200px; border-radius: 22px; box-shadow: 0 12px 28px rgba(0,0,0,.12); display: flex; flex-direction: column; justify-content: space-between; }
.level-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.level-illustration { width: 92px; height: 72px; object-fit: cover; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.level-code { font-size: 2rem; font-weight: 800; }
.level-name { font-size: 1.1rem; font-weight: 700; margin-top: 8px; }
.level-desc { opacity: .95; font-size: .95rem; margin-top: 6px; }
.panel { padding: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.muted { color: #6b7280; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.topic-card { padding: 18px; display: block; overflow: hidden; }
.topic-cover { margin: -18px -18px 16px; height: 160px; background: #eaf1ff; }
.topic-cover img { width: 100%; height: 100%; object-fit: cover; }
.topic-meta { display: flex; justify-content: space-between; margin-top: 12px; color: #6b7280; }
.topic-head { align-items: stretch; }
.topic-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.topic-head-image { width: 280px; max-width: 100%; border-radius: 22px; box-shadow: 0 10px 28px rgba(15,39,66,.12); }
.exercise-list { display: grid; gap: 14px; }
.exercise-row { background: white; border-radius: 16px; padding: 16px; box-shadow: 0 10px 24px rgba(15,39,66,.06); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.exercise-status { font-weight: 700; color: #17365d; }
.exercise-card { padding: 22px; }
.question-box { background: #f9fafb; border: 1px solid #e5e7eb; padding: 16px; border-radius: 14px; margin: 16px 0; font-size: 1.1rem; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.option-card { display: block; background: #f9fafb; border: 1px solid #dbe4f0; border-radius: 14px; padding: 14px; cursor: pointer; }
.option-card input { margin-right: 10px; }
.btn { display: inline-block; padding: 11px 16px; border-radius: 12px; background: white; border: 1px solid #d1d5db; color: #17365d; font-weight: 700; }
.btn.primary { background: #17365d; color: white; border-color: #17365d; }
.message { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.message.error { background: #fee2e2; color: #991b1b; }
.message.success { background: #dcfce7; color: #166534; }
.actions { display: flex; gap: 12px; margin-top: 16px; }
.result-card { padding: 24px; max-width: 620px; }
.result-card.success { border-left: 8px solid #16a34a; }
.result-card.error { border-left: 8px solid #dc2626; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip { padding: 10px 14px; border-radius: 999px; border: 1px solid #cbd5e1; background: white; cursor: pointer; }
.answer-line { min-height: 48px; background: #f9fafb; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.matching-row { display: grid; grid-template-columns: 1fr 220px; gap: 14px; align-items: center; margin-bottom: 12px; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #e8eef8, #cfdcf0); }
.login-shell { width: min(980px, 94vw); display: grid; grid-template-columns: 1.2fr .9fr; gap: 22px; align-items: center; }
.login-art img { width: 100%; border-radius: 28px; box-shadow: 0 16px 40px rgba(15,39,66,.18); }
.login-card { padding: 28px; width: 100%; }
.helptext, ul.errorlist { color: #6b7280; font-size: .9rem; }
input[type='text'], input[type='password'], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 12px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display:none; }
  .hero { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .topic-head { flex-direction: column; }
  .topic-head-side { align-items: flex-start; }
}


.nav form { display:block; }
.nav form button:hover { background: rgba(255,255,255,.18) !important; }

.exercise-card-k0 {
  border: 2px solid #f4c95d;
  background: linear-gradient(180deg, #fffdf7, #ffffff);
}
.k0-instructions { font-size: 1.15rem; color: #9a4d00; }
.question-box-k0 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  border: 2px solid #f4c95d;
  background: #fff9ec;
}
.options-grid-k0 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.option-card-k0 {
  min-height: 220px;
  padding: 18px;
  border: 2px solid #f4c95d;
  background: #fffdf8;
  transition: transform .15s ease, box-shadow .15s ease;
}
.option-card-k0:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,39,66,.08); }
.option-card-k0 input { transform: scale(1.4); margin-right: 0; }
.option-card-body-k0 {
  display: flex;
  min-height: 165px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.choice-image-k0 {
  width: 100%;
  max-width: 180px;
  max-height: 130px;
  object-fit: contain;
  border-radius: 18px;
}
.choice-caption {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #17365d;
}
.choice-badge-k0 {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: #17365d;
  color: white;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
}
.option-card-color .color-swatch-big {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  background: var(--choice-color);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.35), 0 8px 20px rgba(0,0,0,.12);
}
.btn-k0-primary {
  width: 100%;
  margin-top: 8px;
  padding: 16px 20px;
  font-size: 1.2rem;
  border-radius: 18px;
}
.topic-head-k0 .topic-head-image {
  width: 260px;
  border-radius: 28px;
}
.exercise-row-k0 {
  border: 2px solid #f4c95d;
  border-radius: 22px;
  padding: 22px;
}
.audio-box-k0 audio { width: 100%; max-width: 360px; }
.exercise-image-wrap-k0 { margin: 0 0 18px; }
.exercise-image-main { max-width: 360px; border-radius: 18px; }

.topic-tabs {
    display: flex;
    gap: 10px;
    margin: 12px 0 20px;
    flex-wrap: wrap;
}

.topic-tab {
    background: #f3c04b;
    border: 2px solid #e1a42c;
    color: #16345f;
    font-weight: 700;
    border-radius: 10px 10px 0 0;
    padding: 10px 16px;
    cursor: pointer;
}

.topic-tab.is-active {
    background: #ffffff;
}

.topic-tab-panel {
    display: none;
}

.topic-tab-panel.is-active {
    display: block;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.content-card {
    background: #fff;
    border: 1px solid #e7dfcf;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.content-card h3 {
    margin-top: 0;
}

.content-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.status-done {
    color: #2e7d32;
    font-weight: 700;
}

.status-todo {
    color: #c77800;
    font-weight: 700;
}

.exercise-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border: 1px solid #f1c55a;
    border-radius: 18px;
    background: #fffdf7;
    text-decoration: none;
    color: inherit;
    margin-bottom: 12px;
}

.exercise-row:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.btn-secondary {
    display: inline-block;
    text-decoration: none;
    border: 1px solid #c9cfdb;
    background: #fff;
    color: #16345f;
    padding: 12px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.topic-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.topic-page__header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 100%);
    border-radius: 24px;
    padding: 26px;
}

.topic-page__eyebrow {
    margin: 0 0 8px;
    color: #697a96;
    font-weight: 700;
}

.topic-page__title {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.1;
}

.topic-page__desc {
    margin: 0;
    font-size: 22px;
    color: #223b63;
}

.topic-page__actions {
    display: flex;
    align-items: center;
}

.topic-tabbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.topic-tab {
    border: none;
    background: #e8edf6;
    color: #173660;
    font-weight: 700;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
}

.topic-tab.is-active {
    background: #f4c24e;
}

.topic-count {
    display: inline-block;
    margin-left: 8px;
    background: rgba(255,255,255,0.85);
    color: #173660;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.topic-panel {
    display: none;
}

.topic-panel.is-active {
    display: block;
}

.cms-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(18, 44, 86, 0.08);
    padding: 24px;
}

.cms-card__header h2 {
    margin: 0 0 4px;
    font-size: 28px;
}

.cms-card__header p {
    margin: 0 0 20px;
    color: #5b6e8c;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.media-card {
    background: #f8fbff;
    border: 1px solid #dde7f5;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.media-card__top {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.media-card__top h3 {
    margin: 0;
    font-size: 22px;
}

.media-badge {
    align-self: flex-start;
    background: #ffd777;
    color: #173660;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.media-badge--song {
    background: #bce4ff;
}

.media-badge--activity {
    background: #d7f2c9;
}

.media-player {
    width: 100%;
    border-radius: 14px;
    background: #000;
    min-height: 220px;
}

.audio-player {
    width: 100%;
}

.media-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.media-placeholder {
    min-height: 120px;
    border: 2px dashed #c7d4ea;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #617a9c;
    font-weight: 700;
    background: #fff;
    text-align: center;
    padding: 18px;
}

.empty-state {
    border: 2px dashed #d6e0ef;
    border-radius: 18px;
    padding: 24px;
    background: #fafcff;
}

.empty-state strong {
    display: block;
    margin-bottom: 6px;
}

@media (max-width: 900px) {
    .topic-page__header {
        flex-direction: column;
    }

    .topic-page__title {
        font-size: 34px;
    }

    .topic-page__desc {
        font-size: 18px;
    }
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.sidebar-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #274976;
    color: #ffffff;
    text-decoration: none;
    padding: 18px 20px;
    border-radius: 18px;
    font-size: 17px;
    font-weight: 600;
    text-align: left;
}

.sidebar-link:hover {
    background: #33588b;
    color: #ffffff;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.beebook-brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.beebook-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
}

.beebook-illustration {
    background: transparent;
    padding: 10px 0 6px;
}

.beebook-illustration img {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
    margin: 0 auto;
}


.beebook-brand-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    margin-bottom: 22px;
}

.beebook-brand-card .beebook-logo {
    max-width: 240px;
    filter: none;
}


.topic-page__header { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:22px; background:linear-gradient(135deg,#fff,#edf4ff); border-radius:22px; padding:20px; box-shadow:0 10px 30px rgba(15,39,66,.06); }
.topic-page__title { margin:0 0 8px; font-size:2.1rem; }
.topic-page__eyebrow { color:#5a6b85; font-weight:700; margin:0 0 8px; }
.topic-page__desc { color:#5f6f85; margin:0; }
.topic-page__actions { display:flex; gap:10px; }
.btn-primary, .btn-secondary { display:inline-flex; align-items:center; justify-content:center; padding:12px 18px; border-radius:14px; border:none; cursor:pointer; font-weight:700; }
.btn-primary { background:#274976; color:#fff; }
.btn-secondary { background:#fff; color:#17365d; box-shadow: inset 0 0 0 1px #d8e0ea; }
.cms-card { background:#fff; border-radius:18px; box-shadow:0 10px 30px rgba(15,39,66,.08); padding:18px; }
.cms-card__header h2 { margin:0; }
.cms-card__header p { margin:6px 0 0; color:#667085; }
.exercise-list { display:flex; flex-direction:column; gap:12px; margin-top:14px; }
.exercise-row { display:flex; justify-content:space-between; align-items:center; gap:18px; background:#f8fbff; border:1px solid #e2e8f0; border-radius:14px; padding:16px; }
.status-done, .status-todo { padding:8px 12px; border-radius:999px; font-size:.9rem; font-weight:700; }
.status-done { background:#d1fae5; color:#065f46; }
.status-todo { background:#fff7ed; color:#9a3412; }
.game-shell { display:grid; grid-template-columns: minmax(0,1fr) 280px; gap:20px; }
.game-panel, .game-side__card { background:#fff; border-radius:22px; box-shadow:0 10px 30px rgba(15,39,66,.08); padding:22px; }
.game-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.game-label { font-size:.9rem; color:#667085; }
.game-name { font-size:1.2rem; font-weight:800; }
.game-counter { font-size:1.1rem; font-weight:800; color:#17365d; }
.game-stage { min-height:420px; display:flex; align-items:center; justify-content:center; background:linear-gradient(180deg,#f8fbff,#eef4ff); border-radius:18px; padding:18px; }
.game-card { width:min(100%, 460px); background:#fffdf7; border-radius:20px; box-shadow:0 14px 34px rgba(15,39,66,.12); padding:22px; text-align:center; }
.game-card__media { aspect-ratio:1 / 1; background:#fff; border-radius:18px; display:flex; align-items:center; justify-content:center; overflow:hidden; box-shadow: inset 0 0 0 1px #e7e7e7; }
.game-card__media img { max-width:100%; max-height:100%; object-fit:contain; }
.game-card__word { font-size:1.8rem; font-weight:800; margin-top:16px; color:#17365d; }
.game-controls { display:flex; gap:12px; flex-wrap:wrap; margin-top:18px; }
.game-status { margin-top:16px; color:#475467; font-weight:700; min-height:24px; }
.game-side__card { position:sticky; top:24px; }
@media (max-width: 1000px) {
  .game-shell { grid-template-columns: 1fr; }
}


.repeat-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.repeat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  background: linear-gradient(135deg, #ffffff, #eef4ff);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 39, 66, 0.08);
}

.repeat-eyebrow {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #58708d;
  font-weight: 800;
}

.repeat-title {
  margin: 0 0 8px;
  font-size: 2.2rem;
  line-height: 1.1;
}

.repeat-subtitle {
  margin: 0;
  color: #667085;
  max-width: 720px;
}

.repeat-sideinfo {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.repeat-pill {
  background: #fff;
  color: #17365d;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #d8e0ea;
}

.repeat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.repeat-maincard,
.repeat-sidecard {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(15, 39, 66, 0.08);
  padding: 22px;
}

.repeat-stagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.repeat-topic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  background: #f7fbff;
  color: #17365d;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #dae5f1;
}

.repeat-mediawrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
  background: linear-gradient(180deg, #f9fbff, #f2f6ff);
  border-radius: 22px;
  padding: 24px;
}

.repeat-cardframe {
  width: min(100%, 620px);
  background: #fffdf8;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(15, 39, 66, 0.12);
}

.repeat-cardframe img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

.repeat-wordblock {
  text-align: center;
  margin-top: 18px;
}

.repeat-wordlabel {
  color: #667085;
  font-weight: 700;
  margin-bottom: 6px;
}

.repeat-word {
  font-size: 2rem;
  font-weight: 900;
  color: #17365d;
}

.repeat-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.repeat-progress {
  margin-top: 22px;
}

.repeat-progress__bar {
  width: 100%;
  height: 12px;
  background: #e7eef7;
  border-radius: 999px;
  overflow: hidden;
}

.repeat-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #274976, #5aa0ff);
  border-radius: 999px;
  transition: width .3s ease;
}

.repeat-progress__text {
  margin-top: 10px;
  text-align: center;
  color: #5f6f85;
  font-weight: 700;
}

.repeat-status {
  margin-top: 16px;
  text-align: center;
  font-weight: 800;
  color: #17365d;
  min-height: 26px;
}

.repeat-sidecard__section + .repeat-sidecard__section {
  margin-top: 18px;
}

.repeat-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #5f6f85;
}

.repeat-list li + li {
  margin-top: 8px;
}

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

  .repeat-sideinfo {
    justify-content: flex-start;
  }

  .repeat-header {
    flex-direction: column;
  }
}
