:root {
  --bg: #050506;
  --panel: rgba(24, 25, 27, .88);
  --panel-2: rgba(42, 43, 46, .78);
  --line: rgba(255, 255, 255, .1);
  --muted: rgba(255, 255, 255, .62);
  --soft: rgba(255, 255, 255, .36);
  --gold: #f5b83d;
  --green: #57c98d;
  --blue: #5aa7ff;
  --danger: #ff776d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #202225 0, #070708 38%, #000 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  color: #fff;
  overflow: hidden;
}

button {
  touch-action: manipulation;
}

.shell {
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}

.phone {
  width: min(100vw, calc(100dvh * 0.4614), 430px);
  height: min(100dvh, 932px);
  max-height: 100dvh;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #060607;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .52), inset 0 0 0 1px rgba(255, 255, 255, .03);
  overflow: hidden;
  position: relative;
}

.app,
.screen {
  width: 100%;
  height: 100%;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 85%);
  pointer-events: none;
}

.screen-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: max(18px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand-mark,
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(245, 184, 61, .48);
}

.brand-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 184, 61, .8);
  background: transparent;
}

.brand-mark::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.hud {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--gold);
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.progress-btn:hover,
.progress-btn:focus-visible {
  background: rgba(245, 184, 61, .12);
  color: #ffd46e;
  transform: translateY(-1px);
}

.progress-btn svg {
  width: 25px;
  height: 25px;
  overflow: visible;
}

.progress-btn path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
}

.progress-btn circle {
  fill: #0b0c0d;
  stroke: currentColor;
  stroke-width: 1.8;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.pill.gold {
  color: var(--gold);
  border-color: rgba(245, 184, 61, .35);
  background: rgba(245, 184, 61, .1);
}

.mission-card,
.bottom-card,
.result-card,
.glass-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 39, 42, .92), rgba(18, 19, 21, .92));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .34);
  border-radius: 24px;
}

.mission-card {
  margin-top: auto;
  padding: clamp(16px, 2.4dvh, 22px);
  overflow: hidden;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 900;
}

.hero-title {
  font-size: clamp(30px, 9vw, 42px);
  line-height: .96;
  font-weight: 900;
  letter-spacing: 0;
  margin: 12px 0 10px;
}

.brand-title {
  letter-spacing: .18em;
  text-transform: uppercase;
}

.launch-splash .hero-title {
  font-size: clamp(30px, 7.7vw, 50px);
}

.launch-title,
.launch-subtitle {
  white-space: nowrap;
}

.launch-title {
  letter-spacing: .02em;
  text-transform: none;
}

.launch-subtitle {
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.08;
}

.launch-mark {
  width: 28px;
  height: 28px;
}

.lesson-title {
  font-size: clamp(25px, 4.3dvh, 30px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.tiny {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.btn-main {
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #fff;
  --bs-btn-color: #050506;
  --bs-btn-hover-bg: #f2f2f2;
  --bs-btn-hover-border-color: #f2f2f2;
  --bs-btn-hover-color: #050506;
  --bs-btn-active-bg: #e8e8e8;
  --bs-btn-active-border-color: #e8e8e8;
  --bs-btn-active-color: #050506;
  --bs-btn-focus-shadow-rgb: 245, 184, 61;
  color: #050506;
  min-height: 56px;
  border-radius: 999px;
  font-weight: 900;
}

.btn-main:hover,
.btn-main:focus,
.btn-main:active {
  color: #050506 !important;
}

.btn-main:disabled {
  opacity: .58;
  color: #050506;
}

.btn-accent {
  --bs-btn-bg: var(--gold);
  --bs-btn-border-color: var(--gold);
  --bs-btn-color: #111;
  --bs-btn-hover-bg: #ffc655;
  --bs-btn-hover-border-color: #ffc655;
  min-height: 52px;
  border-radius: 999px;
  font-weight: 900;
}

.btn-ghost {
  min-height: 48px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .8);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  font-weight: 800;
}

.turnstile-box {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.lesson-actions {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 10px;
  align-items: center;
}

.random-lesson-btn {
  width: 56px;
  min-height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
}

.random-lesson-btn svg {
  width: 23px;
  height: 23px;
}

.random-lesson-btn path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-tile {
  position: relative;
  height: clamp(160px, 28dvh, 245px);
  border-radius: 16px;
  overflow: hidden;
  background-color: #24272a;
}

.lesson-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 0 24%, rgba(0, 0, 0, .42) 62%, rgba(0, 0, 0, .72) 100%);
  pointer-events: none;
}

.photo-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  opacity: .32;
  pointer-events: none;
}

.example-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
}

.example-next {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.example {
  min-height: 86px;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, #68ddc4, #7a3df0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.example.bad {
  background: linear-gradient(135deg, #8f9aa2, #2a332d 52%, #d7c7b8);
}

.example span {
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
}

.camera-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #141516;
}

.camera-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .54), transparent 28%, transparent 68%, rgba(0, 0, 0, .82));
}

.camera-ui {
  position: relative;
  z-index: 3;
  height: 100%;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.frame-guide {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 130px;
  height: 130px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(245, 184, 61, .62);
  border-radius: 3px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .05);
}

.frame-guide::before,
.frame-guide::after {
  content: "";
  position: absolute;
  background: rgba(245, 184, 61, .85);
}

.frame-guide::before {
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.capture {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: transparent;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .18), 0 10px 30px rgba(0, 0, 0, .38);
}

.camera-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  object-fit: cover;
  background: rgba(255, 255, 255, .08);
}

.circle-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-weight: 900;
}

.shot-strip {
  display: flex;
  gap: 8px;
}

.shot-strip img,
.shot-empty {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  object-fit: cover;
  background: rgba(255, 255, 255, .06);
}

.shot-empty {
  display: grid;
  place-items: center;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.loader-orb {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid rgba(245, 184, 61, .18);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}

.analysis-list {
  display: grid;
  gap: 12px;
}

.analysis-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(87, 201, 141, .12);
  color: var(--green);
  font-size: 13px;
}

.score-ring {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 8px auto 18px;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), rgba(255, 255, 255, .09) 0);
}

.score-ring span {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #101112;
  font-size: 26px;
  font-weight: 900;
}

.review-photo-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #151617;
}

.review-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.score-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 78px;
  height: 78px;
  margin: 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .48);
}

.score-overlay span {
  width: 60px;
  height: 60px;
  font-size: 22px;
}

.feedback-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 14px;
  line-height: 1.25;
}

.feedback-item strong {
  display: block;
  color: var(--green);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.feedback-item.warn strong {
  color: var(--gold);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary-shot {
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, .1);
}

.summary-shot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.summary-shot div {
  padding: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.progress-body {
  overflow-y: auto;
  gap: 14px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.progress-body::-webkit-scrollbar {
  width: 0;
}

.progress-hero {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(38, 39, 42, .9), rgba(18, 19, 21, .86));
}

.progress-close {
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
}

.progress-section {
  display: grid;
  gap: 8px;
}

.reset-progress-btn {
  margin-top: 6px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .62);
}

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

.progress-card {
  min-height: 92px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  display: grid;
  grid-template-columns: 92px 1fr;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
}

.progress-card img {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: cover;
}

.progress-card div {
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.progress-card span,
.progress-card small {
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.progress-card strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
}

.progress-card.complete {
  border-color: rgba(87, 201, 141, .36);
  background: linear-gradient(135deg, rgba(87, 201, 141, .15), rgba(255, 255, 255, .07));
}

.progress-card.complete span {
  color: var(--green);
}

.progress-card.locked {
  opacity: .45;
  filter: grayscale(1);
  pointer-events: none;
}

.empty-progress {
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, .16);
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.toast-note {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 122px;
  z-index: 8;
  padding: 14px;
  border-radius: 18px;
  background: rgba(21, 22, 24, .9);
  border: 1px solid rgba(245, 184, 61, .32);
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}

.camera-fallback {
  bottom: 112px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 0;
    display: block;
  }

  .phone {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}
