:root {
  --ink: #111111;
  --muted: #777777;
  --soft: rgba(255, 255, 255, 0.72);
  --pill: rgba(61, 58, 55, 0.78);
  --pill-hover: rgba(255, 255, 255, 0.92);
  --card: rgba(250, 250, 250, 0.97);
  --card-edge: rgba(255, 255, 255, 0.58);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  --tier-color: #80b9b4;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #101010;
  overflow-x: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.theme-video,
.video-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.theme-video {
  z-index: -2;
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(1.08) contrast(1.03);
}

.video-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.24) 64%);
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: clamp(18px, 3vw, 48px) clamp(18px, 5vw, 96px) 18px;
}

.topbar {
  width: min(100%, calc(100vw - clamp(36px, 10vw, 192px)));
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
}

.brand {
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
}

.top-actions,
.dock-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-pill,
.auth-pill,
.primary-button,
.soft-button,
.round-button,
.icon-button,
.theme-option {
  min-height: 46px;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.theme-pill {
  padding: 0 18px;
  background: var(--pill);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.theme-pill,
.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-pill {
  min-height: 46px;
  padding: 0 15px 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.auth-pill:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

.auth-pill.is-signed-in {
  background: #101010;
  color: #ffffff;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(135deg, #7be0ff, #2b7de9);
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.12);
}

.auth-pill.is-signed-in .auth-avatar {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85) 0 12%, transparent 13%),
    linear-gradient(135deg, #9ff4b7, #37a368);
}

.bit-menu-button {
  width: 70px;
  min-height: 54px;
  padding: 6px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}

.bit-menu-button:hover {
  transform: translateY(-2px);
}

.bit-face {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 12%, transparent 13%),
    linear-gradient(135deg, #6bd8ff, #2378de);
  box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.12);
}

.bit-eye,
.bit-smile {
  position: absolute;
  display: block;
}

.bit-eye {
  width: 5px;
  height: 7px;
  top: 12px;
  border-radius: 999px;
  background: #101010;
}

.bit-eye.left {
  left: 10px;
}

.bit-eye.right {
  right: 10px;
}

.bit-smile {
  left: 12px;
  bottom: 8px;
  width: 11px;
  height: 6px;
  border-bottom: 2px solid #101010;
  border-radius: 0 0 999px 999px;
}

.menu-lines {
  display: grid;
  gap: 3px;
}

.menu-lines span {
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: #101010;
}

.theme-dot {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  display: inline-block;
}

.theme-pill:hover,
.auth-pill:hover,
.primary-button:hover,
.soft-button:hover,
.round-button:hover,
.theme-option:hover {
  transform: translateY(-2px);
}

.study-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding-top: clamp(6px, 1.2vh, 18px);
}

.term-card {
  width: min(1380px, calc(100vw + 52px), calc((100vh - 72px) * 16 / 9));
  aspect-ratio: 1280 / 720;
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.term-card::after {
  content: "";
  position: absolute;
  left: 13%;
  top: 84.2%;
  width: 74%;
  height: 9.4%;
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(180deg, #ff765f 0%, #e94f3f 44%, #c93027 100%);
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.22),
    inset 0 -10px 16px rgba(94, 11, 6, 0.24),
    0 13px 18px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  z-index: 1;
}

.computer-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.34))
    drop-shadow(0 52px 78px rgba(0, 0, 0, 0.28));
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.mobile-shell {
  display: none;
}

.screen-overlay {
  position: absolute;
  left: 24.8%;
  top: 7.55%;
  width: 49.85%;
  height: 54.55%;
  padding: 0;
  display: grid;
  grid-template-rows: 9.95% minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  z-index: 2;
}

.term-kicker {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  color: #686868;
  font-size: clamp(10px, 1vw, 15px);
  font-weight: 800;
  line-height: 1;
  padding: clamp(7px, 0.72vw, 10px) clamp(22px, 2.15vw, 30px) 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.image-wrap {
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  padding: clamp(12px, 1.25vw, 18px) clamp(18px, 1.75vw, 26px) clamp(12px, 1.35vw, 19px);
}

.image-wrap img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center 28%;
  transform: none;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.term-display {
  position: absolute;
  left: 42.9%;
  top: 69.55%;
  width: 32.25%;
  height: 7.9%;
  display: grid;
  place-items: center;
  padding: 0 clamp(22px, 2vw, 30px);
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.term-display h1 {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: #f5f5f5;
  font-size: clamp(8px, 1.15vw, 17px);
  line-height: 1;
  font-weight: 800;
  text-align: center;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.3),
    0 2px 0 rgba(0, 0, 0, 0.85);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.16));
  transform: translateY(-4%);
}

.console-hit {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  font-size: clamp(12px, 1.25vw, 17px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 9px rgba(0, 0, 0, 0.54);
  transition:
    transform 110ms cubic-bezier(0.2, 0.8, 0.24, 1),
    color 110ms ease,
    text-shadow 110ms ease,
    filter 110ms ease;
  transform-origin: center bottom;
  isolation: isolate;
  padding-bottom: 1.4%;
  z-index: 3;
}

.console-hit::before,
.console-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition:
    opacity 110ms ease,
    transform 110ms ease,
    box-shadow 110ms ease,
    background 110ms ease;
}

.console-hit::before {
  z-index: -2;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.22)),
    rgba(255, 105, 91, 0.16);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.16),
    inset 0 -12px 18px rgba(0, 0, 0, 0.44),
    0 10px 16px rgba(0, 0, 0, 0.34);
}

.console-hit::after {
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(circle at 42% 18%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.22));
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 12px 20px rgba(255, 255, 255, 0.12),
    inset 0 -12px 20px rgba(0, 0, 0, 0.46),
    0 10px 20px rgba(0, 0, 0, 0.3);
}

.console-hit:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.console-hit:active,
.console-hit.is-pressing {
  color: #101010;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 14px rgba(255, 255, 255, 0.28);
  transform: translateY(7%) scale(0.96);
  filter: brightness(0.98) saturate(1.24);
}

.console-known:active,
.console-known.is-pressing {
  color: #101010;
}

.console-learn:active,
.console-learn.is-pressing {
  color: #36f0ff;
}

.console-hit:disabled {
  cursor: default;
  opacity: 1;
}

.console-known.is-mastered {
  color: #75ffb4;
  text-shadow:
    0 0 12px rgba(117, 255, 180, 0.42),
    0 2px 8px rgba(0, 0, 0, 0.5);
}

.console-hit:active::before,
.console-hit.is-pressing::before,
.console-hit:active::after,
.console-hit.is-pressing::after {
  opacity: 1;
}

.console-known:active::before,
.console-known.is-pressing::before,
.console-known:active::after,
.console-known.is-pressing::after {
  background:
    radial-gradient(circle at 38% 20%, rgba(255, 255, 255, 0.3), transparent 36%),
    linear-gradient(180deg, #ff7f72, #ca3025);
}

.console-reveal:active::before,
.console-reveal.is-pressing::before,
.console-reveal:active::after,
.console-reveal.is-pressing::after {
  background:
    radial-gradient(circle at 38% 20%, rgba(255, 255, 255, 0.42), transparent 36%),
    linear-gradient(180deg, #57f4ff, #0eb7cd);
}

.console-learn:active::before,
.console-learn.is-pressing::before,
.console-learn:active::after,
.console-learn.is-pressing::after {
  background:
    radial-gradient(circle at 38% 20%, rgba(255, 255, 255, 0.3), transparent 36%),
    linear-gradient(180deg, #7b54ff, #42239a);
}

.console-hit:focus-visible {
  outline: 3px solid rgba(54, 240, 255, 0.95);
  outline-offset: 3px;
}

.console-prev,
.console-next,
.console-known,
.console-reveal,
.console-learn {
  top: 85.0%;
  height: 7.7%;
  border-radius: 12px;
  background:
    radial-gradient(circle at 38% 17%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #242424, #0a0a0a 66%, #050505);
  box-shadow:
    inset 0 9px 15px rgba(255, 255, 255, 0.1),
    inset 0 -12px 16px rgba(0, 0, 0, 0.62),
    0 6px 0 rgba(0, 0, 0, 0.72),
    0 12px 18px rgba(0, 0, 0, 0.32);
}

.console-prev,
.console-next {
  width: 6.55%;
  font-size: clamp(18px, 2.45vw, 31px);
}

.console-prev {
  left: 14.2%;
}

.console-next {
  left: 78.4%;
}

.console-prev:disabled,
.console-next:disabled {
  color: rgba(255, 255, 255, 0.36);
  filter: saturate(0.7) brightness(0.72);
}

.console-known {
  left: 23.5%;
  width: 16.5%;
}

.console-reveal {
  left: 42%;
  width: 16%;
}

.console-learn {
  left: 60.5%;
  width: 15.2%;
}

.hidden {
  display: none !important;
}

.bottom-dock {
  width: min(980px, calc(100vw - 36px));
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(12px, 1.6vw, 18px);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 25, 49, 0.96), rgba(4, 8, 18, 0.98)),
    linear-gradient(90deg, rgba(224, 100, 255, 0.2), rgba(40, 233, 255, 0.2));
  border: 1px solid rgba(79, 219, 255, 0.28);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.08);
}

.dock-actions {
  justify-content: center;
}

.primary-button,
.soft-button,
.round-button,
.icon-button {
  font-weight: 800;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.primary-button {
  min-width: 220px;
  padding: 0 28px;
  background: #ffffff;
  color: #111111;
}

.soft-button {
  padding: 0 18px;
  background: rgba(52, 49, 47, 0.72);
  color: #ffffff;
  backdrop-filter: blur(14px);
}

.round-button,
.icon-button {
  width: 58px;
  min-width: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(52, 49, 47, 0.72);
  color: #ffffff;
  font-size: 32px;
  backdrop-filter: blur(14px);
}

.bottom-dock .primary-button,
.bottom-dock .soft-button,
.bottom-dock .round-button {
  min-height: 64px;
  border-radius: 10px;
  text-transform: none;
  transform: translateY(0);
  border: 2px solid rgba(122, 240, 255, 0.66);
  box-shadow:
    0 8px 0 rgba(0, 0, 0, 0.7),
    0 0 22px rgba(38, 224, 255, 0.32),
    inset 0 0 14px rgba(255, 255, 255, 0.12);
}

.bottom-dock .primary-button {
  color: #041016;
  background: linear-gradient(180deg, #36f0ff, #14b9d2);
  border-color: #70f7ff;
  text-shadow: 0 1px rgba(255, 255, 255, 0.36);
}

.bottom-dock .soft-button,
.bottom-dock .round-button {
  color: #f2e9ff;
  background: linear-gradient(180deg, #342169, #17112f);
  border-color: #d463ff;
  text-shadow: 0 0 12px rgba(224, 100, 255, 0.82);
}

.bottom-dock .round-button {
  width: 108px;
  min-width: 88px;
  font-size: 34px;
}

.bottom-dock button:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.7),
    0 0 18px rgba(38, 224, 255, 0.24),
    inset 0 0 14px rgba(255, 255, 255, 0.14);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  font-size: 24px;
}

.status-line {
  width: min(100%, calc(100vw - clamp(36px, 10vw, 192px)));
  justify-self: center;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  margin-top: 16px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.modal {
  width: min(960px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 22px;
  padding: 22px;
  background: rgba(250, 250, 250, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  color: #151515;
}

.modal[open] {
  animation: modal-pop 260ms cubic-bezier(0.18, 0.9, 0.25, 1.18);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.compact-modal {
  width: min(460px, calc(100vw - 28px));
}

.level-modal {
  width: min(620px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

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

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  font-weight: 700;
}

.theme-options,
.quiz-options {
  display: grid;
  gap: 10px;
}

.level-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.level-list {
  display: grid;
  gap: 10px;
  max-height: min(480px, 55vh);
  overflow: auto;
  padding-right: 4px;
}

.level-row {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.055);
  text-align: left;
}

.level-row.active {
  background: color-mix(in srgb, var(--tier-color), white 70%);
}

.level-number {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--tier-color);
  color: #111111;
  font-weight: 800;
}

.level-copy {
  min-width: 0;
}

.level-copy strong,
.level-copy small {
  display: block;
}

.level-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.level-copy small {
  margin-top: 3px;
  color: #6e6e6e;
  font-size: 12px;
}

.level-star {
  color: rgba(0, 0, 0, 0.22);
  font-size: 27px;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.6));
}

.level-star.earned {
  color: #f4b72b;
  text-shadow: 0 0 14px rgba(244, 183, 43, 0.44);
}

.theme-option,
.quiz-options button {
  width: 100%;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.06);
  text-align: left;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
}

.theme-option.active {
  background: #111111;
  color: #ffffff;
}

.theme-option small {
  color: currentColor;
  opacity: 0.62;
  font-size: 12px;
}

.learn-modal {
  width: min(760px, calc(100vw - 28px));
}

.definition-modal {
  width: min(620px, calc(100vw - 28px));
}

.definition-copy {
  padding: clamp(18px, 3vw, 26px);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(0, 0, 0, 0.04)),
    color-mix(in srgb, var(--tier-color), white 76%);
  color: #171717;
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.5;
  font-weight: 700;
}

.definition-close {
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal {
  width: min(620px, calc(100vw - 28px));
}

.auth-panel {
  display: grid;
  gap: 14px;
}

.auth-copy {
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(0, 0, 0, 0.045)),
    color-mix(in srgb, var(--tier-color), white 80%);
  color: #171717;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.google-button {
  min-height: 54px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #111111;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.google-button:hover {
  transform: translateY(-2px);
  background: #242424;
}

.google-button:active {
  transform: translateY(1px) scale(0.99);
}

.google-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #111111;
  font-weight: 800;
}

.auth-note {
  min-height: 22px;
  color: #5f5f5f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.06);
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85) 0 12%, transparent 13%),
    linear-gradient(135deg, #9ff4b7, #2378de);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: inset -6px -7px 0 rgba(0, 0, 0, 0.14);
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card strong {
  font-size: 18px;
  font-weight: 800;
}

.profile-card small {
  margin-top: 4px;
  color: #686868;
  font-size: 12px;
  line-height: 1.35;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.profile-stats span {
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.055);
  color: #5f5f5f;
  font-size: 13px;
  font-weight: 800;
}

.profile-stats strong {
  display: block;
  margin-bottom: 4px;
  color: #111111;
  font-size: 24px;
}

.learn-panel {
  display: grid;
  gap: 14px;
}

.learn-panel section {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.055);
}

.learn-panel h3 {
  margin-bottom: 8px;
  color: #6e6e6e;
  font-size: 12px;
  text-transform: uppercase;
}

.learn-panel p {
  font-size: 15px;
  line-height: 1.58;
}

.quiz-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(280px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.quiz-stage img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 20px;
  background: #ffffff;
}

#quizPrompt {
  margin-bottom: 14px;
  font-size: 17px;
  line-height: 1.45;
}

.quiz-options button {
  min-height: 48px;
  font-weight: 700;
}

.quiz-options button.correct {
  background: color-mix(in srgb, #37a368, white 74%);
}

.quiz-options button.incorrect {
  background: color-mix(in srgb, #d95d5d, white 74%);
}

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

.badge-modal {
  width: min(720px, calc(100vw - 28px));
  text-align: center;
}

.badge-modal canvas {
  width: 100%;
  max-width: 620px;
  height: auto;
  margin-bottom: 18px;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.badge-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 18px 14px;
  }

  .topbar {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .theme-pill,
  .auth-pill {
    flex: 1 1 auto;
    justify-content: center;
  }

  .term-card {
    width: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 0;
  }

  .bottom-dock,
  .quiz-stage {
    grid-template-columns: 1fr;
  }

  .bottom-dock {
    align-items: center;
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    gap: 10px;
  }

  .dock-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .soft-button {
    width: 100%;
    min-width: 0;
  }

  .round-button {
    width: 64px;
    min-width: 64px;
    min-height: 58px;
  }

  .status-line {
    justify-content: center;
    flex-wrap: wrap;
  }

  .level-menu-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .app-shell {
    min-height: 100dvh;
    padding: 6px 0 8px;
    grid-template-rows: auto 1fr;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 7px 8px;
    min-height: 0;
    padding: 0 8px;
  }

  .study-stage {
    place-items: start center;
    padding-top: clamp(10px, 2vh, 18px);
  }

  .brand {
    font-size: clamp(21px, 6.1vw, 24px);
    grid-column: 1 / 2;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-column: 1 / -1;
    gap: 8px;
  }

  .theme-pill,
  .auth-pill {
    min-height: 40px;
    justify-content: center;
  }

  .theme-pill {
    padding: 0 14px;
    font-size: clamp(13px, 4vw, 16px);
  }

  .auth-pill {
    padding: 0 11px 0 5px;
    font-size: 13px;
  }

  .auth-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .bit-menu-button {
    width: 58px;
    min-height: 46px;
    padding: 5px 7px;
  }

  .bit-face {
    width: 31px;
    height: 31px;
  }

  .term-card {
    padding: 0;
    width: min(100vw, 480px, calc((100dvh - 92px) * 1050 / 1030));
    max-width: none;
    margin: 0 auto;
    aspect-ratio: 1050 / 1030;
  }

  .term-card::after {
    left: 2.6%;
    top: 84.1%;
    width: 96.3%;
    height: 12.3%;
    border-radius: 13px;
  }

  .desktop-shell {
    display: none;
  }

  .mobile-shell {
    display: block;
    inset: 0 0 auto;
    height: 82.52%;
    object-fit: contain;
  }

  .screen-overlay {
    left: 8.16%;
    top: 9.83%;
    width: 83.78%;
    height: 47.64%;
    padding: 0;
    grid-template-rows: 12.95% minmax(0, 1fr);
    gap: 0;
    border-radius: 9px;
  }

  .term-kicker {
    font-size: clamp(10px, 3.05vw, 15px);
    padding: clamp(8px, 2.4vw, 13px) clamp(22px, 6vw, 42px) 0;
  }

  .image-wrap {
    padding: 3px 6px 5px;
  }

  .image-wrap img {
    object-position: center 28%;
    transform: none;
  }

  .term-display {
    left: 39.38%;
    top: 67.82%;
    width: 54.15%;
    height: 8.06%;
    padding: 0 10px;
  }

  .term-display h1 {
    font-size: clamp(8px, 2.5vw, 11px);
    line-height: 1.05;
  }

  .console-hit {
    font-size: clamp(9px, 2.8vw, 12px);
    padding-bottom: 1.2%;
    border-radius: 11px;
  }

  .console-reveal {
    white-space: normal;
    line-height: 0.9;
    padding: 0 5px 1.6%;
  }

  .console-prev,
  .console-next {
    top: 86%;
    width: 8.6%;
    height: 8.35%;
    font-size: clamp(17px, 5.6vw, 25px);
  }

  .console-prev {
    left: 4.2%;
  }

  .console-known {
    left: 13.8%;
    top: 86%;
    width: 24.7%;
    height: 8.35%;
  }

  .console-reveal {
    left: 40.25%;
    top: 86%;
    width: 23.25%;
    height: 8.35%;
  }

  .console-learn {
    left: 64.9%;
    top: 86%;
    width: 23%;
    height: 8.35%;
  }

  .console-next {
    left: 89%;
  }

  .status-line {
    display: none;
  }

  .auth-modal {
    padding: 18px;
  }

  .auth-copy {
    padding: 16px;
    font-size: 14px;
  }

  .google-button,
  .auth-modal .soft-button {
    min-height: 50px;
    font-size: 15px;
  }

  .bottom-dock {
    padding: 10px;
    border-radius: 16px;
  }

  .bottom-dock .primary-button,
  .bottom-dock .soft-button {
    min-height: 52px;
    font-size: 14px;
  }

  .bottom-dock .round-button {
    width: 54px;
    min-width: 54px;
    min-height: 54px;
  }
}
