:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4efe5;
  background: #11110f;
  font-synthesis: none;
  --ink: #11110f;
  --paper: #f4efe5;
  --paper-soft: #d7d0c3;
  --brass: #cba56a;
  --brass-light: #f1d6a7;
  --panel: #1a1916;
  --line: #34312b;
  --muted: #8f8a80;
  --success: #35d592;
  --danger: #ff655d;
  --electric: #74c9ff;
}

* { box-sizing: border-box; }
html, body, #root { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--ink); overflow-x: hidden; }
button { border: 0; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
svg { width: 24px; height: 24px; display: block; }

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% -20%, #5c4931 0, transparent 37%),
    linear-gradient(135deg, #151411, #0d0d0c);
}

.app-frame {
  width: min(100%, 430px);
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 0 98%, #ffffff05 98%),
    #141310;
  box-shadow: 0 0 90px #000;
}

.screen {
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  position: relative;
  animation: screen-enter .34s ease both;
}

@keyframes screen-enter {
  from { opacity: 0; transform: translateY(7px); }
}

.screen:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cpath d='M0 69.5h70M69.5 0v70' fill='none' stroke='%23fff' stroke-opacity='.12'/%3E%3C/svg%3E");
}

.topbar, .quiz-header {
  height: 38px;
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiet-mark {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #a8a298;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.quiet-mark span { color: var(--paper); }
.quiet-mark > i { width: 17px; height: 1px; background: var(--brass); transform: rotate(-58deg); }
.demo-badge { padding: 3px 5px; border: 1px solid #5f5648; color: var(--brass-light); font-size: 6px; letter-spacing: .08em; }
.account-stats { display: flex; gap: 6px; }
.attempt-chip, .bonus-chip { height: 32px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #1d1c18; }
.attempt-chip { padding: 0 10px; }
.attempt-chip svg { width: 15px; height: 15px; color: var(--brass-light); }
.attempt-chip b, .bonus-chip b { font-size: 11px; }
.bonus-chip { padding: 0 10px 0 6px; }
.bonus-chip i { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--brass); color: var(--ink); font-size: 9px; font-style: normal; font-weight: 900; }

.home-screen { overflow-y: auto; scrollbar-width: none; }
.home-screen::-webkit-scrollbar { display: none; }
.tab-screen { padding-bottom: max(106px, calc(91px + env(safe-area-inset-bottom))); overflow-y: auto; scrollbar-width: none; }
.tab-screen::-webkit-scrollbar { display: none; }

.bottom-navigation {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(72px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 7px 13px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid #4a4439;
  background: linear-gradient(180deg, #1d1b17f2, #11110ffa);
  box-shadow: 0 -18px 38px #000b;
  backdrop-filter: blur(16px);
}
.bottom-navigation button { min-width: 0; position: relative; display: grid; place-items: center; align-content: center; gap: 5px; background: transparent; color: #767066; }
.bottom-navigation button:before { content: ""; position: absolute; top: -7px; width: 0; height: 2px; background: var(--brass-light); box-shadow: 0 0 14px var(--brass); transition: width .2s ease; }
.bottom-navigation svg { width: 21px; height: 21px; }
.bottom-navigation span { font-size: 6px; font-weight: 900; letter-spacing: .13em; }
.bottom-navigation button.is-active { color: var(--paper); }
.bottom-navigation button.is-active:before { width: 46px; }
.bottom-navigation button.is-active svg { color: var(--brass-light); filter: drop-shadow(0 0 8px #cba56a66); }
.home-intro { position: relative; z-index: 2; margin-top: 26px; }
.section-label { display: block; color: var(--brass); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.section-label:before { content: ""; display: inline-block; width: 20px; height: 1px; margin-right: 8px; vertical-align: 3px; background: currentColor; }
.section-label.centered { text-align: center; }
.section-label.centered:before { display: none; }

.home-intro h1, .invite-screen h2, .rules-screen h2, .result-screen h2 {
  margin: 10px 0;
  font: 700 clamp(43px, 12.5vw, 56px)/.84 Georgia, "Times New Roman", serif;
  letter-spacing: -.065em;
}

h1 em, h2 em { color: var(--brass-light); font-style: italic; font-weight: 400; }
.home-intro p { max-width: 350px; margin: 15px 0 0; color: #aaa399; font-size: 12px; line-height: 1.55; }

.level-deck { height: 238px; margin: 15px 0 9px; position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.level-card { min-width: 0; height: 224px; position: relative; overflow: hidden; padding: 0; border: 1px solid #3e3931; background: #24211c; text-align: left; box-shadow: 0 18px 32px #0008; transition: transform .18s ease, border-color .18s ease, filter .18s ease; }
.level-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; filter: saturate(.65) contrast(1.04) brightness(.72); transition: filter .18s ease, transform .3s ease; }
.level-card:nth-child(2) img { object-position: 48% 38%; }
.level-card .level-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #0b0b0b25 20%, #0c0b09f2 90%); }
.level-card > i { position: absolute; left: 10px; top: 9px; color: #e9dfd0; font: 700 25px/1 Georgia, serif; font-style: normal; text-shadow: 0 3px 14px #000; }
.level-card > small, .level-card > b, .level-card > em { position: absolute; left: 10px; right: 8px; z-index: 2; display: block; }
.level-card > small { bottom: 52px; color: var(--brass-light); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.level-card > b { bottom: 29px; color: var(--paper); font: 800 20px/1 Georgia, serif; letter-spacing: -.03em; }
.level-card > em { bottom: 11px; color: #a39b90; font-size: 7px; font-style: normal; font-weight: 700; }
.level-card.is-selected { z-index: 2; border-color: var(--brass-light); transform: translateY(-6px); box-shadow: 0 21px 38px #000c, 0 0 0 1px #cba56a55; }
.level-card.is-selected img { filter: saturate(.88) contrast(1.04) brightness(.9); transform: scale(1.025); }
.level-card.is-selected:after { content: "ВЫБРАНО"; position: absolute; right: 7px; top: 8px; padding: 4px 5px; background: var(--paper); color: var(--ink); font-size: 5px; font-weight: 900; letter-spacing: .08em; }
.level-deck.is-locked .level-card:not(.is-selected) { opacity: .34; filter: grayscale(.65); }
.level-card.is-level-locked { opacity: .62; filter: grayscale(.5); }
.level-card.is-level-locked:after { display: none; }
.level-lock { position: absolute; z-index: 4; right: 8px; top: 8px; display: flex; align-items: center; gap: 4px; padding: 5px 6px; border: 1px solid #9b835e; background: #15130fe8; color: var(--brass-light); }
.level-lock svg { width: 11px; height: 11px; }
.level-lock b { font-size: 5px; letter-spacing: .09em; }
.level-stamp { position: absolute; z-index: 5; right: -4px; top: 76px; width: 61px; height: 61px; display: grid; place-items: center; align-content: center; transform: rotate(5deg); background: var(--paper); color: var(--ink); box-shadow: 5px 5px 0 var(--brass); pointer-events: none; }
.level-stamp small, .level-stamp span { font-size: 5px; font-weight: 900; letter-spacing: .08em; }
.level-stamp strong { font: 800 24px/.9 Georgia, serif; }

.quiz-promise { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 14px; border: 1px solid var(--line); background: #191815; }
.resume-note { position: relative; z-index: 3; margin: -4px 0 9px; padding: 7px 9px; border-left: 2px solid var(--electric); background: #17242b; color: #a8dfff; font-size: 6px; font-weight: 900; letter-spacing: .1em; }
.quiz-promise > div { min-height: 62px; padding: 9px 7px; display: flex; align-items: center; gap: 7px; border-right: 1px solid var(--line); }
.quiz-promise > div:last-child { border-right: 0; }
.quiz-promise svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--brass); }
.quiz-promise span { min-width: 0; }
.quiz-promise b, .quiz-promise small { display: block; }
.quiz-promise b { color: var(--paper); font-size: 8px; line-height: 1.25; }
.quiz-promise small { margin-top: 3px; color: #777168; font-size: 7px; line-height: 1.25; }

.primary-button {
  width: 100%; min-height: 60px; position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 6px 19px; background: var(--paper); color: var(--ink);
  font-size: 11px; font-weight: 900; letter-spacing: .08em;
  box-shadow: 0 18px 38px #0007; transition: transform .13s, filter .13s;
}
.primary-button > i { width: 48px; height: 48px; display: grid; place-items: center; background: var(--ink); color: var(--brass-light); }
.primary-button:active { transform: scale(.98); }
.primary-button:disabled { opacity: .55; }
.home-meta { position: relative; z-index: 2; display: flex; justify-content: space-between; padding: 10px 2px 2px; color: #837d74; font-size: 8px; font-weight: 700; }
.text-button, .secondary-button { width: 100%; position: relative; z-index: 3; padding: 11px; background: none; color: #817a70; font-size: 9px; text-decoration: underline; text-underline-offset: 3px; }
.inline-error { position: relative; z-index: 5; margin: 0 0 10px; padding: 10px 12px; border-left: 2px solid var(--danger); background: #381d1a; color: #ffc1bd; font-size: 10px; line-height: 1.4; }

.tab-heading { position: relative; z-index: 2; margin: 31px 0 20px; }
.tab-heading h1 { margin: 10px 0 13px; font: 700 51px/.84 Georgia, "Times New Roman", serif; letter-spacing: -.065em; }
.tab-heading h1 em { color: var(--brass-light); font-style: italic; font-weight: 400; }
.tab-heading p { max-width: 350px; margin: 0; color: #9b9489; font-size: 11px; line-height: 1.55; }

.current-rank-card { min-height: 118px; position: relative; z-index: 2; display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 14px; padding: 14px; border: 1px solid #544936; background: linear-gradient(115deg, #252018, #181714); box-shadow: 8px 8px 0 #6e5431, 0 22px 45px #0007; }
.rank-seal { width: 76px; height: 76px; position: relative; display: grid; place-items: center; border: 1px solid var(--brass); border-radius: 50%; color: var(--brass-light); box-shadow: inset 0 0 24px #cba56a26, 0 0 25px #cba56a20; }
.rank-seal:before { content: ""; position: absolute; inset: 7px; border: 1px dashed #8e744e; border-radius: 50%; }
.rank-seal svg { width: 30px; height: 30px; }
.rank-seal small { position: absolute; right: 4px; top: 2px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); font: 800 8px/1 Georgia, serif; }
.current-rank-card > div:last-child > span { color: var(--brass); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.current-rank-card strong { display: block; margin: 6px 0 4px; font: 700 28px/1 Georgia, serif; }
.current-rank-card p { margin: 0; color: #918a80; font-size: 8px; }
.rank-progress { height: 7px; margin: 23px 0 7px; overflow: hidden; border: 1px solid #3e3931; background: #1d1b18; }
.rank-progress i { display: block; width: 100%; height: 100%; transform: scaleX(var(--rank-progress)); transform-origin: left; background: linear-gradient(90deg, #876335, var(--brass-light)); box-shadow: 0 0 15px #cba56a77; }
.rank-progress-copy { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; color: #716a60; font-size: 7px; }
.rank-progress-copy b { color: #a8a096; font-size: 7px; text-align: center; }
.rank-progress-copy span:last-child { text-align: right; }
.rank-track { position: relative; z-index: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 8px; margin: 23px -18px 15px; padding: 0 18px 13px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rank-track::-webkit-scrollbar { display: none; }
.rank-tier { min-height: 150px; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; border: 1px solid #35322c; background: #191815; scroll-snap-align: center; }
.rank-tier > i { position: absolute; top: 13px; left: 12px; color: #4f4a42; font: 800 34px/1 Georgia, serif; font-style: normal; }
.rank-tier small { color: #6e685f; font-size: 6px; font-weight: 900; letter-spacing: .12em; }
.rank-tier strong { margin: 5px 0 14px; color: #817a70; font: 700 17px/1 Georgia, serif; }
.rank-tier span { width: max-content; padding: 4px 6px; border: 1px solid #3a3731; color: #666057; font-size: 5px; font-weight: 900; letter-spacing: .1em; }
.rank-tier.is-earned { border-color: #69573c; }
.rank-tier.is-current { border-color: var(--brass-light); background: linear-gradient(155deg, #2b241a, #191714); box-shadow: 0 12px 28px #0008, inset 0 0 30px #cba56a10; transform: translateY(-3px); }
.rank-tier.is-current > i, .rank-tier.is-current strong { color: var(--brass-light); }
.rank-tier.is-current span { border-color: var(--brass); color: var(--paper); }
.rank-facts { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: #191815; }
.rank-facts > div { min-height: 76px; display: grid; place-items: center; align-content: center; border-right: 1px solid var(--line); }
.rank-facts > div:last-child { border: 0; }
.rank-facts small { color: #746e65; font-size: 6px; font-weight: 900; letter-spacing: .12em; }
.rank-facts b { margin-top: 7px; color: var(--paper); font: 700 23px/1 Georgia, serif; }
.rank-facts b span { color: #716b62; font-size: 9px; }

.profile-identity { position: relative; z-index: 2; display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 16px; margin: 32px 0 24px; }
.profile-avatar { width: 82px; height: 82px; display: grid; place-items: center; border: 1px solid var(--brass); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6b5435, #211c16 60%); color: var(--paper); font: 700 27px/1 Georgia, serif; box-shadow: 0 0 35px #cba56a2c; }
.profile-identity span { color: var(--brass); font-size: 6px; font-weight: 900; letter-spacing: .16em; }
.profile-identity h1 { max-width: 250px; margin: 4px 0 3px; overflow: hidden; color: var(--paper); font: 700 31px/1 Georgia, serif; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity p { margin: 0; color: #817a71; font-size: 9px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.profile-grid article { min-height: 105px; padding: 13px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); background: #1a1916; }
.profile-grid small { margin-bottom: auto; color: var(--brass); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.profile-grid b { margin: 12px 0 4px; font: 700 23px/1 Georgia, serif; }
.profile-grid span { color: #777168; font-size: 7px; }
.tariff-card { position: relative; margin: 0 0 15px; padding: 15px; display: grid; grid-template-columns: 1fr 36px; border: 1px solid #4b4438; background: linear-gradient(120deg, #252019, #191816); }
.tariff-card div span, .tariff-card div strong { display: block; }
.tariff-card div span { color: var(--brass); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.tariff-card div strong { margin-top: 6px; font: 700 17px/1 Georgia, serif; }
.tariff-card > i { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #4b4438; border-radius: 50%; color: #6f685e; font-style: normal; }
.tariff-card p { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #37332c; color: #888178; font-size: 8px; line-height: 1.45; }
.profile-row { width: 100%; min-height: 51px; margin-top: 8px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: #191815; color: #aaa399; font-size: 9px; font-weight: 800; }
.profile-row span { display: flex; align-items: center; gap: 9px; }
.profile-row svg { width: 18px; height: 18px; color: var(--brass); }
.settings-notice { margin: -7px 0 10px; padding: 9px 11px; border-left: 2px solid var(--success); background: #183126; color: #dff8ed; font-size: 8px; line-height: 1.4; }
.game-mode-card { width: 100%; min-height: 70px; margin: 0 0 10px; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #66583f; background: linear-gradient(120deg, #29231a, #191816); text-align: left; }
.game-mode-card > span { display: grid; gap: 4px; }
.game-mode-card small { color: var(--brass); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.game-mode-card strong { color: var(--paper); font: 700 17px/1 Georgia, serif; }
.game-mode-card em { color: #999186; font-size: 8px; font-style: normal; }
.game-mode-card > i { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #5a5041; color: var(--brass-light); }
.game-mode-card svg { width: 18px; height: 18px; }

.game-settings-screen { overflow-y: auto; scrollbar-width: none; text-align: center; background: radial-gradient(circle at 50% 18%, #40311f 0, #141310 42%); }
.game-settings-screen::-webkit-scrollbar { display: none; }
.settings-back { position: absolute; left: 18px; top: max(18px, env(safe-area-inset-top)); z-index: 4; }
.game-settings-screen > .section-label { margin-top: 54px; }
.game-settings-screen h2 { margin: 13px 0 10px; font-size: 42px; }
.settings-lead { max-width: 345px; margin: 0 auto 18px; color: #a29b91; font-size: 11px; line-height: 1.55; }
.age-range-list { display: grid; gap: 8px; margin-bottom: 13px; text-align: left; }
.age-range-list button { min-height: 76px; padding: 11px; display: grid; grid-template-columns: 35px 1fr 25px; align-items: center; gap: 10px; border: 1px solid #494238; background: #1b1a17; }
.age-range-list button:active { transform: scale(.985); }
.age-range-list button > i { color: var(--brass); font: 700 17px/1 Georgia, serif; font-style: normal; }
.age-range-list button > span { display: grid; gap: 6px; }
.age-range-list strong { font-size: 11px; letter-spacing: .04em; }
.age-range-list small { color: #918a80; font-size: 8px; line-height: 1.35; }
.age-range-list svg { width: 18px; height: 18px; color: var(--brass-light); }
.privacy-card { padding: 13px; border: 1px solid #635941; background: #efe7d9; color: var(--ink); text-align: left; }
.privacy-card b { color: #6f5736; font-size: 7px; letter-spacing: .12em; }
.privacy-card p { margin: 7px 0 0; font-size: 9px; line-height: 1.45; }
.settings-next { margin: 12px 0 0; color: #888177; font-size: 8px; line-height: 1.4; }

.quiz-screen { height: 100dvh; min-height: 0; display: flex; flex-direction: column; padding-left: 15px; padding-right: 15px; overflow: hidden; background: #11110f; }
.quiz-screen:before { opacity: .09; }
.quiz-header { flex: 0 0 38px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: #1c1b17; }
.icon-button svg { width: 21px; height: 21px; }
.question-counter { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.question-counter small, .live-score small { color: #706b63; font-size: 6px; font-weight: 800; letter-spacing: .12em; }
.question-counter strong { margin-top: 2px; font: 700 16px/.9 Georgia, serif; }
.question-counter strong span { color: #787269; font-size: 10px; }
.live-score { text-align: right; }
.live-score strong { display: block; color: var(--brass-light); font: 700 19px/1 Georgia, serif; }
.round-dots { height: 14px; display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.round-dots i { flex: 1; height: 3px; background: #34312b; transform: skew(-18deg); }
.round-dots i.done { background: var(--brass); }
.round-dots i.active { background: var(--paper); box-shadow: 0 0 12px #fff7; animation: dot-pulse .8s ease-in-out infinite alternate; }
@keyframes dot-pulse { to { opacity: .55; } }
.question-heading { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; color: #a7a097; font-size: 8px; font-weight: 900; letter-spacing: .12em; }

.haircut-question { flex: 1 1 auto; min-height: 215px; max-height: none; margin: 0; position: relative; overflow: hidden; border: 1px solid #3a352d; background: #24211d; }
.haircut-question > img { width: 100%; height: 100%; position: relative; z-index: 1; object-fit: cover; object-position: 50% 38%; animation: image-arrive .42s ease both; }
@keyframes image-arrive { from { opacity: .25; transform: scale(1.08); filter: blur(5px); } }
.image-shade { position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, transparent 68%, #0b0b0b80 100%); pointer-events: none; }
.haircut-question figcaption { position: absolute; z-index: 3; left: 12px; bottom: 10px; padding: 5px 7px; background: #11110fcc; color: #a69e92; font-size: 6px; font-weight: 900; letter-spacing: .15em; }
.portrait-backdrop { display: none; }
.haircut-question.actor-question .portrait-backdrop { display: block; position: absolute; z-index: 0; inset: -18px; background-position: center 24%; background-size: cover; filter: blur(18px) brightness(.38) saturate(.7); transform: scale(1.1); }
.haircut-question.actor-question > img { object-fit: contain; object-position: 50% 0; }
.haircut-question .actor-caption { left: 0; right: 0; bottom: 0; padding: 36px 13px 11px; display: grid; gap: 2px; background: linear-gradient(180deg, transparent, #0b0b0bc9 62%); letter-spacing: normal; }
.actor-caption small { color: var(--brass-light); font-size: 6px; font-weight: 900; letter-spacing: .14em; }
.actor-caption strong { color: var(--paper); font: 700 18px/1.05 Georgia, serif; }
.actor-caption span { color: #aba399; font-size: 6px; font-weight: 800; letter-spacing: .1em; }
.timer-medallion { position: absolute; z-index: 4; right: 10px; top: 10px; width: 62px; height: 62px; display: grid; grid-template-columns: 18px 1fr; grid-template-rows: 1fr 14px; align-items: center; padding: 7px; background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--brass); transform: rotate(2deg); }
.timer-medallion svg { width: 17px; height: 17px; }
.timer-medallion strong { font: 800 25px/1 Georgia, serif; text-align: center; }
.timer-medallion small { grid-column: 1 / -1; text-align: center; font-size: 6px; font-weight: 900; letter-spacing: .15em; }
.timer-medallion.paused { background: #cdc7bc; }
.timer-track { flex: 0 0 5px; margin: 8px 0 10px; overflow: hidden; background: #34312b; }
.timer-track i { display: block; width: 100%; height: 100%; transform: scaleX(1); transform-origin: left; background: linear-gradient(90deg, var(--brass), var(--paper)); will-change: transform; }

.answers { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; position: relative; z-index: 3; }
.answers[data-option-count="3"] .answer-button:last-of-type { grid-column: 1 / -1; }
.answer-sync { position: absolute; z-index: 7; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; background: #11110fd6; color: var(--brass-light); font-size: 7px; font-weight: 900; letter-spacing: .12em; backdrop-filter: blur(3px); }
.answer-sync i { width: 17px; height: 17px; border: 1px solid #6d6252; border-top-color: var(--brass-light); border-radius: 50%; animation: spin .65s linear infinite; }
.answer-button { min-height: 55px; padding: 7px 10px 7px 7px; display: grid; grid-template-columns: 34px 1fr 20px; align-items: center; gap: 7px; border: 1px solid #3b3832; background: #1c1b18; text-align: left; opacity: 0; animation: answer-pop .32s cubic-bezier(.2,.8,.2,1.2) calc(var(--order) * 55ms + 80ms) forwards; transition: background .16s, border-color .16s, transform .12s, opacity .16s; }
@keyframes answer-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.answer-button:active { transform: scale(.97); }
.answer-button > span { width: 32px; height: 32px; display: grid; place-items: center; background: #2a2823; color: var(--brass-light); font: 700 13px/1 Georgia, serif; }
.answer-button > b { font-size: 10px; line-height: 1.15; }
.answer-button svg { width: 18px; height: 18px; }
.answer-button.is-correct { border-color: var(--success); background: #163126; color: #e9fff6; opacity: 1; animation: correct-answer .35s ease both; }
.answer-button.is-correct > span { background: var(--success); color: #10241a; }
.answer-button.is-wrong { border-color: var(--danger); background: #371b19; opacity: 1; animation: wrong-answer .28s linear both; }
.answer-button.is-wrong > span { background: var(--danger); color: #280f0d; }
.answer-button.is-muted { opacity: .37; animation: none; }
@keyframes correct-answer { 50% { transform: scale(1.035); box-shadow: 0 0 24px #35d59244; } }
@keyframes wrong-answer { 33% { transform: translateX(-4px); } 66% { transform: translateX(4px); } }

.reaction-burst { position: absolute; z-index: 8; left: 50%; top: 50%; width: 196px; height: 132px; transform: translate(-50%, -50%) rotate(-4deg); display: grid; place-items: center; align-content: center; color: #0e1712; filter: drop-shadow(0 16px 25px #000b); animation: reaction-in .36s cubic-bezier(.12,.82,.18,1.28) both; }
.reaction-burst:before, .reaction-burst i { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--success); clip-path: polygon(50% 0,59% 23%,79% 8%,78% 33%,100% 30%,82% 50%,100% 68%,75% 67%,78% 94%,57% 77%,46% 100%,39% 76%,15% 91%,23% 65%,0 61%,19% 46%,1% 27%,27% 29%,28% 4%); }
.reaction-burst i { inset: -16px; background: var(--paper); opacity: .22; transform: rotate(8deg); }
.reaction-burst.wrong:before, .reaction-burst.wrong i { background: var(--danger); }
.reaction-burst.timeout:before, .reaction-burst.timeout i { background: var(--electric); }
.reaction-burst b { font: 900 31px/.9 Georgia, serif; letter-spacing: -.05em; }
.reaction-burst span { margin-top: 5px; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
@keyframes reaction-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(9deg) scale(2); } 65% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(.92); } }

.knowledge-pop { position: absolute; z-index: 20; left: 15px; right: 15px; bottom: max(14px, env(safe-area-inset-bottom)); padding: 14px; border: 1px solid #645941; background: #f0e9dd; color: var(--ink); box-shadow: 0 -15px 45px #000b, 7px 7px 0 var(--brass); animation: knowledge-in .32s cubic-bezier(.16,.85,.2,1.16) both; }
@keyframes knowledge-in { from { opacity: 0; transform: translateY(35px) rotate(2deg); } }
.knowledge-pop > span { display: flex; align-items: center; gap: 6px; color: #705633; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.knowledge-pop > span svg { width: 15px; height: 15px; }
.reference-look { min-height: 75px; margin: 9px 0; display: grid; grid-template-columns: 76px 1fr; align-items: center; overflow: hidden; background: #171613; color: var(--paper); }
.reference-look img { width: 76px; height: 76px; object-fit: cover; object-position: 50% 8%; }
.reference-look figcaption { padding: 10px; color: var(--brass-light); font-size: 7px; font-weight: 900; line-height: 1.45; letter-spacing: .08em; text-align: left; }
.knowledge-pop p { margin: 8px 0 11px; font: 600 11px/1.45 Inter, sans-serif; }
.knowledge-error { margin: -3px 0 9px; color: #a12520; font-size: 8px; line-height: 1.35; }
.knowledge-pop button { width: 100%; height: 38px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: var(--paper); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.knowledge-pop button:disabled { opacity: .58; }
.knowledge-pop button svg { width: 17px; height: 17px; }
.knowledge-pop.wrong { box-shadow: 0 -15px 45px #000b, 7px 7px 0 var(--danger); }
.knowledge-pop.timeout { box-shadow: 0 -15px 45px #000b, 7px 7px 0 var(--electric); }

.submit-overlay { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; align-content: center; gap: 16px; padding: 30px; text-align: center; background: #11110feb; backdrop-filter: blur(9px); }
.submit-spinner { width: 58px; height: 58px; border: 2px solid #ffffff19; border-top-color: var(--brass); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.submit-overlay b { font-size: 9px; letter-spacing: .13em; }
.submit-overlay p { max-width: 290px; margin: 0; color: #ffb4af; font-size: 10px; line-height: 1.45; }
.submit-overlay button { padding: 12px 18px; background: var(--paper); color: var(--ink); font-size: 9px; font-weight: 900; }

.result-screen, .invite-screen, .rules-screen { overflow-y: auto; scrollbar-width: none; text-align: center; background: radial-gradient(circle at 50% 18%, #40311f 0, #141310 42%); }
.result-screen::-webkit-scrollbar, .invite-screen::-webkit-scrollbar, .rules-screen::-webkit-scrollbar { display: none; }
.result-screen { padding-top: max(27px, env(safe-area-inset-top)); }
.result-rays { width: 158px; height: 158px; margin: 16px auto -131px; opacity: .35; background: repeating-conic-gradient(from 0deg, var(--brass) 0 4deg, transparent 4deg 17deg); border-radius: 50%; animation: slow-spin 18s linear infinite; }
@keyframes slow-spin { to { transform: rotate(360deg); } }
.result-rank { width: 144px; height: 144px; margin: 0 auto 15px; position: relative; z-index: 2; display: grid; place-items: center; align-content: center; background: var(--paper); color: var(--ink); transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--brass); }
.result-rank small, .result-rank b { font-size: 6px; font-weight: 900; letter-spacing: .12em; }
.result-rank strong { margin: 5px 0 2px; font: 800 58px/.82 Georgia, serif; }
.result-rank strong span { color: #776f64; font-size: 22px; }
.result-screen h2 { position: relative; z-index: 2; margin: 18px 0; font-size: 44px; }
.practice h2 em { color: var(--electric); }
.result-scoreboard { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 13px; border: 1px solid var(--line); background: #1a1916; }
.result-scoreboard > div { min-height: 83px; display: grid; place-items: center; align-content: center; border-right: 1px solid var(--line); }
.result-scoreboard > div:last-child { border-right: 0; }
.result-scoreboard small { color: #7f796f; font-size: 6px; font-weight: 900; letter-spacing: .13em; }
.result-scoreboard b { margin: 4px 0; color: var(--brass-light); font: 700 28px/1 Georgia, serif; }
.result-scoreboard span { color: #777168; font-size: 7px; }
.result-note { margin-bottom: 15px; padding: 11px; border-left: 2px solid var(--brass); background: #201d18; color: #9f988d; font-size: 10px; line-height: 1.5; text-align: left; }
.result-note b { color: var(--paper); }
.secondary-button { text-decoration: none; }

.invite-back, .rules-back { position: absolute; left: 18px; top: max(18px, env(safe-area-inset-top)); z-index: 4; }
.invite-symbol { width: 145px; height: 145px; margin: 46px auto 22px; position: relative; display: grid; place-items: center; border: 1px solid #806a48; border-radius: 50%; box-shadow: 0 0 70px #8c6e3e44, inset 0 0 30px #a57e4044; }
.invite-symbol:before { content: ""; position: absolute; inset: 15px -25px; border: 1px dashed var(--brass); border-radius: 50%; transform: rotate(27deg); }
.invite-symbol svg { width: 55px; height: 55px; color: var(--brass-light); }
.invite-symbol i { position: absolute; right: -8px; top: 4px; padding: 9px 8px; background: var(--paper); color: var(--ink); font-size: 14px; font-style: normal; font-weight: 900; }
.invite-screen .section-label { margin-top: 8px; }
.invite-screen h2 { margin: 12px 0; }
.invite-screen > p { max-width: 330px; margin: 0 auto 22px; color: #9a9389; font-size: 12px; line-height: 1.65; }
.invite-balance { margin: 12px 0 20px; padding: 12px; display: flex; justify-content: space-between; border: 1px solid var(--line); background: #1b1916; color: #80796f; font-size: 9px; }
.invite-balance b { color: var(--brass-light); }
.invite-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.invite-steps span { min-height: 64px; padding: 10px 5px; display: grid; place-items: center; align-content: center; background: #191815; }
.invite-steps i { color: var(--brass); font: 600 14px/1 Georgia, serif; }
.invite-steps b { margin-top: 6px; color: #8d867c; font-size: 7px; }

.rules-screen { padding-top: max(73px, calc(env(safe-area-inset-top) + 55px)); }
.rules-screen h2 { margin: 14px 0 22px; font-size: 42px; }
.rules-grid { display: grid; gap: 8px; margin-bottom: 16px; text-align: left; }
.rules-grid article { min-height: 79px; padding: 12px; display: grid; grid-template-columns: 38px 1fr; gap: 10px; border: 1px solid var(--line); background: #1b1a17; }
.rules-grid article > i { color: var(--brass); font: 700 17px/1 Georgia, serif; font-style: normal; }
.rules-grid b { font-size: 10px; }
.rules-grid p { margin: 5px 0 0; color: #938c82; font-size: 10px; line-height: 1.4; }
.image-credit-link { display: block; margin: -2px 0 13px; color: #817a70; font-size: 8px; text-underline-offset: 3px; }

.boot-screen { display: grid; place-items: center; align-content: center; text-align: center; background: radial-gradient(circle at center, #4a3823 0, #141310 42%); }
.boot-emblem { width: 105px; height: 105px; display: grid; place-items: center; border: 1px solid #79603e; border-radius: 50%; box-shadow: 0 0 55px #8e6d3a44; animation: boot-pulse 1.2s ease-in-out infinite alternate; }
.boot-emblem svg { width: 49px; height: 49px; color: var(--brass-light); }
@keyframes boot-pulse { to { transform: scale(1.04); box-shadow: 0 0 75px #8e6d3a66; } }
.boot-name { margin-top: 21px; font: 800 18px/1 Georgia, serif; letter-spacing: .12em; }
.boot-name span { color: var(--brass); font-weight: 400; }
.boot-line { width: 150px; height: 2px; margin: 19px auto 10px; overflow: hidden; background: #34302a; }
.boot-line i { display: block; width: 45%; height: 100%; background: var(--brass); animation: loading-line 1s ease-in-out infinite alternate; }
@keyframes loading-line { to { transform: translateX(125%); } }
.boot-screen p { color: #736d64; font-size: 7px; font-weight: 800; letter-spacing: .14em; }

@media (min-width: 700px) {
  .app-frame { min-height: 820px; height: min(900px, calc(100vh - 36px)); border: 1px solid #3a352d; border-radius: 23px; }
  .screen { min-height: 100%; height: 100%; }
}

@media (max-height: 720px) {
  .home-intro { margin-top: 16px; }
  .home-intro h1 { font-size: 40px; }
  .home-intro p { margin-top: 9px; font-size: 10px; }
  .level-deck { height: 180px; margin-top: 10px; }
  .level-card { height: 172px; }
  .level-card > small { bottom: 47px; }
  .level-card > b { bottom: 25px; font-size: 17px; }
  .level-card > em { bottom: 8px; }
  .level-stamp { top: 55px; width: 54px; height: 54px; }
  .quiz-promise > div { min-height: 52px; padding: 6px 5px; }
  .primary-button { min-height: 54px; }
  .primary-button > i { width: 43px; height: 43px; }
  .question-heading { flex-basis: 25px; }
  .haircut-question { min-height: 190px; }
  .answer-button { min-height: 49px; }
  .knowledge-pop { padding: 11px; }
  .knowledge-pop p { margin: 6px 0 8px; font-size: 10px; }
  .result-rays { width: 115px; height: 115px; margin-bottom: -96px; }
  .result-rank { width: 112px; height: 112px; }
  .result-rank strong { font-size: 44px; }
  .result-screen h2 { margin: 13px 0; font-size: 34px; }
}

@media (max-height: 600px) {
  .quiz-screen { padding-top: max(9px, env(safe-area-inset-top)); padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .quiz-header { flex-basis: 34px; height: 34px; }
  .icon-button { width: 34px; height: 34px; }
  .round-dots { margin-top: 3px; height: 10px; }
  .question-heading { flex-basis: 20px; font-size: 6px; }
  .haircut-question { min-height: 158px; max-height: 225px; }
  .timer-medallion { width: 52px; height: 52px; }
  .timer-medallion strong { font-size: 20px; }
  .timer-track { margin: 6px 0; }
  .answer-button { min-height: 44px; }
  .answer-button > span { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
