* {
  box-sizing: border-box;
}

:root {
  --bg: #230401;
  --bg-deep: #160200;
  --panel: #3b0904;
  --panel-soft: #4d1007;
  --panel2: #4f0f07;
  --red: #721506;
  --gold: #d9b56c;
  --gold-strong: #b98539;
  --cream: #fff7e8;
  --paper: #e7d9bf;
  --muted: #f6d795;
  --dark: #2b0803;
  --green: #d9f7d9;
  --bad: #ffe0d9;
  --line: rgba(217, 181, 108, 0.45);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 74% 0%, rgba(180, 90, 40, 0.16), transparent 34%),
    radial-gradient(circle at 18% 34%, rgba(120, 20, 0, 0.22), transparent 42%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--cream);
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 285px;
  background: linear-gradient(180deg, var(--panel) 0%, #250402 100%);
  border-right: 1px solid rgba(185, 133, 57, 0.55);
  box-shadow: 18px 0 45px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  padding: 22px 18px 18px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 214, 137, 0.045), rgba(0, 0, 0, 0.08));
}

.brand .logo {
  width: 132px;
  max-width: 78%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
}

.crest,
.brand h1,
.brand p {
  display: none;
}

.lesson-list {
  flex: 1;
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-strong) transparent;
}

.lesson-btn {
  width: 100%;
  padding: 14px 15px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}

.lesson-btn:hover {
  background: rgba(185, 133, 57, 0.22);
}

.lesson-btn.active {
  background: linear-gradient(90deg, var(--gold-strong), #8b5c25);
  border-color: var(--gold);
  color: var(--cream);
}

.lesson-btn.complete .status {
  color: var(--gold);
}

.lesson-btn-title {
  font-weight: 800;
  margin-bottom: 5px;
  line-height: 1.2;
}

.status {
  font-size: 12px;
  opacity: 0.82;
}

.bottom-card {
  background: linear-gradient(135deg, var(--cream), var(--paper));
  color: var(--panel);
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--gold);
}

.bottom-card strong {
  display: block;
  font-size: 22px;
  color: #7d1a0b;
}

.bottom-card span {
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}

.small-btn {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

/* Main layout */
.main {
  flex: 1;
  padding: 30px 42px 42px;
  min-width: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 28%);
}

.topbar {
  background: linear-gradient(135deg, rgba(68, 12, 6, 0.94), rgba(38, 5, 2, 0.94));
  border: 1px solid rgba(185, 133, 57, 0.5);
  border-radius: 16px 16px 0 0;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  color: var(--cream);
  font-family: Georgia, serif;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mode-btn {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.mode-btn.active {
  background: var(--gold-strong);
  color: var(--cream);
}

.content {
  background: linear-gradient(180deg, rgba(79, 15, 7, 0.9), rgba(47, 7, 3, 0.98));
  min-height: calc(100vh - 150px);
  border: 1px solid rgba(185, 133, 57, 0.45);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  padding: 30px;
}

/* Lesson cards */
.hero-card,
.question-card {
  background: linear-gradient(135deg, #4c0d08, var(--red));
  border: 4px double var(--gold);
  border-radius: 16px;
  padding: 34px;
  text-align: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.hero-card h3 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  font-family: Georgia, serif;
}

.hero-card p {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
}

.section-title {
  color: var(--cream);
  margin: 28px 0 15px;
  font-family: Georgia, serif;
  font-size: 26px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 15px;
}

.word-card,
.flash-card,
.progress-box,
.complete-wrapper {
  background: linear-gradient(135deg, var(--cream), var(--paper));
  color: var(--dark);
  border: 1px solid var(--gold);
}

.word-card {
  border-radius: 14px;
  padding: 18px;
}

.word-card .english {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: #80622f;
  font-weight: 800;
}

.word-card .romanian {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.08;
  font-weight: 900;
  color: #721506;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.word-card .hint {
  margin-top: 10px;
  color: #555;
  line-height: 1.35;
}

.flash-wrapper,
.quiz-wrapper,
.complete-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.flash-card {
  min-height: 340px;
  border: 4px double var(--gold);
  border-radius: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 35px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.flash-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #80622f;
  font-weight: 800;
}

.flash-main {
  font-size: clamp(38px, 7vw, 64px);
  line-height: 1.06;
  font-weight: 900;
  color: #721506;
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.flash-hint {
  color: #555;
  font-size: clamp(17px, 3vw, 22px);
  margin-top: 14px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 12px;
}

.control-btn {
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--cream);
  color: var(--panel);
  cursor: pointer;
  font-weight: 900;
}

.control-btn.gold {
  background: var(--gold-strong);
  color: var(--cream);
}

.progress-box {
  padding: 18px;
  border-radius: 15px;
  margin-bottom: 22px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-weight: 900;
}

.progress-track {
  height: 14px;
  background: #3b0b05;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s;
}

.question-card {
  border-radius: 24px;
  padding: 34px;
}

.question-card .prompt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
}

.question-card .question {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.05;
  font-weight: 900;
  margin: 18px 0;
  overflow-wrap: anywhere;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.answer-btn {
  background: linear-gradient(135deg, var(--cream), var(--paper));
  border: 2px solid var(--gold);
  color: var(--dark);
  border-radius: 16px;
  padding: 20px;
  min-height: 106px;
  text-align: left;
  cursor: pointer;
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.08;
  font-weight: 900;
  transition: 0.15s;
  overflow-wrap: anywhere;
}

.answer-btn:hover {
  transform: translateY(-2px);
}

.answer-btn.correct {
  background: var(--green);
  border-color: #168c16;
}

.answer-btn.wrong-picked {
  background: var(--bad);
  border-color: #c73720;
}

.answer-btn small {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  opacity: 0.75;
  margin-top: 8px;
}

.meta-line {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.complete-wrapper {
  padding: 42px;
  border-radius: 24px;
  text-align: center;
  border: 4px double var(--gold);
}

.complete-wrapper h3 {
  color: #721506;
  font-size: clamp(34px, 6vw, 48px);
  margin: 0 0 15px;
  font-family: Georgia, serif;
}

/* Tablet */
@media (max-width: 1000px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid rgba(185, 133, 57, 0.55);
  }

  .brand {
    padding: 14px 16px;
  }

  .brand .logo {
    width: 98px;
  }

  .lesson-list {
    flex: none;
    max-height: none;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 14px;
    scroll-snap-type: x proximity;
  }

  .lesson-btn {
    flex: 0 0 min(270px, 78vw);
    margin-bottom: 0;
    scroll-snap-align: start;
  }

  .bottom-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 10px 14px;
  }

  .bottom-card strong,
  .bottom-card span {
    margin: 0;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .content {
    margin-top: 12px;
    border-top: 1px solid rgba(185, 133, 57, 0.45);
    border-radius: 16px;
    min-height: auto;
  }

  .answers {
    grid-template-columns: 1fr;
  }
}

/* Phone */
@media (max-width: 640px) {
  body {
    display: block;
  }

  .brand .logo {
    width: 82px;
  }

  .lesson-list {
    padding: 10px;
  }

  .lesson-btn {
    flex-basis: 76vw;
    padding: 12px;
  }

  .lesson-btn-title {
    font-size: 14px;
  }

  .status {
    font-size: 11px;
  }

  .bottom-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 4px;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    padding: 16px;
    gap: 14px;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .topbar p {
    font-size: 14px;
    line-height: 1.35;
  }

  .mode-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .mode-btn {
    padding: 10px 8px;
    font-size: 13px;
  }

  .content {
    padding: 14px;
  }

  .hero-card {
    padding: 24px 16px;
    margin-bottom: 18px;
  }

  .hero-card h3 {
    font-size: 32px;
  }

  .hero-card p {
    font-size: 15px;
  }

  .section-title {
    font-size: 22px;
    margin: 20px 0 12px;
  }

  .word-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .word-card {
    padding: 15px;
  }

  .word-card .romanian {
    font-size: 25px;
  }

  .flash-card {
    min-height: 300px;
    padding: 24px 16px;
  }

  .flash-main {
    font-size: 38px;
  }

  .flash-hint {
    font-size: 17px;
  }

  .control-row {
    flex-wrap: wrap;
  }

  .control-row strong {
    width: 100%;
    text-align: center;
    order: -1;
  }

  .control-btn {
    flex: 1 1 140px;
    padding: 13px 12px;
  }

  .progress-box {
    padding: 14px;
  }

  .progress-text {
    flex-direction: column;
    gap: 4px;
  }

  .question-card {
    padding: 24px 16px;
  }

  .question-card .question {
    font-size: 34px;
  }

  .answer-btn {
    min-height: auto;
    padding: 18px;
    font-size: 22px;
  }

  .complete-wrapper {
    padding: 28px 16px;
  }
}

/* Very narrow phones */
@media (max-width: 390px) {
  .mode-btn {
    font-size: 12px;
  }

  .hero-card h3,
  .question-card .question,
  .flash-main {
    font-size: 30px;
  }

  .answer-btn {
    font-size: 20px;
  }
}
.beta-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0,0,0,.72);
    backdrop-filter: blur(12px);
}

.beta-panel {
    width: min(500px, calc(100% - 40px));

    padding: 40px;
    text-align: center;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(90,10,5,.92),
            rgba(20,5,2,.96)
        );

    border: 1px solid rgba(200,155,79,.35);

    box-shadow:
        0 25px 80px rgba(0,0,0,.5),
        inset 0 0 30px rgba(255,255,255,.02);
}

.beta-logo {
    width: 90px;
    margin-bottom: 20px;
}

.beta-kicker {
    color: var(--gold-light);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .2em;
    margin-bottom: 10px;
}

.beta-panel h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
    margin-bottom: 14px;
}

.beta-panel p {
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.beta-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.beta-form input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;

    border: 1px solid rgba(200,155,79,.3);

    background: rgba(255,255,255,.05);
    color: white;
    font-size: 1rem;
    text-align: center;
}

.beta-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(200,155,79,.2);
}

.beta-error {
    margin-top: 15px;
    color: #ffb7b7;
}