:root {
  --ink: #0a3027;
  --muted: #5c776f;
  --green: #078052;
  --green-dark: #064c39;
  --green-deep: #03392c;
  --mint: #e1f4eb;
  --yellow: #ffd51f;
  --orange: #ed8c22;
  --paper: #fff;
  --line: rgba(7, 93, 66, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eaf5f0;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; background: #eff7f3; }
.topbar { height: 76px; position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px clamp(18px, 3.4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 60px; height: 58px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.header-button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--green-dark); font-size: 13px; font-weight: 800; }
.screen { min-height: calc(100vh - 76px); }
.eyebrow { display: block; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }

.home-screen { position: relative; display: grid; grid-template-columns: 53% 47%; overflow: hidden; background: radial-gradient(circle at 85% 15%, rgba(255,215,36,.34), transparent 24%), radial-gradient(circle at 11% 17%, rgba(255,255,255,.72), transparent 19%), linear-gradient(145deg, #eff9f4 0%, #e0f1e8 55%, #cce5d8 100%); }
.home-screen::before { content: ""; position: absolute; left: 29%; top: -12%; width: 110px; height: 38%; background: linear-gradient(90deg, var(--yellow) 0 42%, var(--green) 42% 74%, transparent 74%); transform: skewX(-29deg); opacity: .92; }
.home-screen::after { content: ""; position: absolute; left: -8%; right: -8%; bottom: -31%; height: 54%; border-radius: 50% 50% 0 0; background: rgba(10,117,77,.2); transform: rotate(-3deg); }
.home-content { position: relative; z-index: 4; align-self: center; padding: clamp(38px, 6vh, 78px) 3vw clamp(38px, 6vh, 78px) clamp(30px, 6vw, 92px); }
.home-content h1 { margin: 13px 0 18px; font-size: clamp(54px, 7vw, 102px); line-height: .84; letter-spacing: -.065em; text-transform: uppercase; }
.home-content h1 em { color: var(--green); font-style: normal; }
.home-content > p { max-width: 670px; margin: 0; color: #426b60; font-size: clamp(16px, 1.55vw, 21px); line-height: 1.5; }
.audience-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: clamp(28px, 4.5vh, 48px); }
.audience-button { min-height: 116px; display: grid; grid-template-columns: 60px 1fr 40px; align-items: center; gap: 13px; padding: 15px 14px; border: 1px solid rgba(255,255,255,.9); border-radius: 25px; background: rgba(255,255,255,.86); box-shadow: 0 17px 38px rgba(0,70,48,.13); backdrop-filter: blur(16px); transition: transform .2s ease, box-shadow .2s ease; }
.audience-button:hover { transform: translateY(-4px); box-shadow: 0 23px 46px rgba(0,70,48,.2); }
.audience-button.student { background: linear-gradient(145deg, rgba(222,245,235,.94), rgba(255,255,255,.9)); }
.choice-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: #fff5b1; font-size: 30px; }
.student .choice-icon { background: #d8f1e5; }
.audience-button small, .audience-button strong { display: block; }
.audience-button small { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.audience-button strong { margin-top: 5px; font-size: clamp(24px, 2.5vw, 35px); letter-spacing: -.035em; }
.audience-button i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); box-shadow: 0 5px 0 var(--orange); font-size: 22px; font-style: normal; font-weight: 900; }
.home-links { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.home-links a { color: var(--green-dark); font-size: 13px; font-weight: 900; text-decoration: underline; text-decoration-color: rgba(6,76,57,.25); text-underline-offset: 5px; }
.home-links a[data-resume-game] { color: var(--green); }
.home-links a[hidden] { display: none; }
.home-characters { position: relative; z-index: 3; min-height: 100%; }
.sun-disc { position: absolute; width: min(41vw, 590px); aspect-ratio: 1; left: 2%; top: 10%; border-radius: 50%; background: linear-gradient(150deg, #fff8b4, #cdeedf); box-shadow: 0 0 0 32px rgba(255,255,255,.24), 0 0 0 64px rgba(255,255,255,.1); }
.home-characters img { position: absolute; object-fit: contain; filter: drop-shadow(0 30px 28px rgba(0,64,44,.2)); }
.hero-wolf { z-index: 1; width: 57%; left: 3%; bottom: -4%; }
.hero-raccoon { z-index: 3; width: 67%; right: -3%; bottom: -5%; }
.hero-lynx { z-index: 2; width: 45%; right: 20%; top: 6%; }
.mission-sticker { position: absolute; z-index: 5; right: 7%; top: 10%; width: 145px; height: 145px; display: grid; grid-template-columns: auto 1fr; place-items: center; gap: 6px; padding: 18px; border-radius: 50%; background: var(--yellow); box-shadow: 0 10px 0 var(--orange), 0 22px 42px rgba(0,65,45,.18); transform: rotate(7deg); }
.mission-sticker b { font-size: 43px; }
.mission-sticker span { font-size: 11px; font-weight: 900; line-height: 1.05; text-transform: uppercase; }

.create-screen { padding: clamp(24px, 3.8vh, 42px) clamp(22px, 4vw, 62px); background: radial-gradient(circle at 92% 5%, rgba(255,213,31,.22), transparent 24%), linear-gradient(155deg, #eef8f3, #e4f2eb); }
.create-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 22px; }
.create-heading h1 { margin: 8px 0 0; font-size: clamp(34px, 4.2vw, 62px); line-height: .9; letter-spacing: -.055em; text-transform: uppercase; }
.create-heading p { max-width: 430px; margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.player-form { display: grid; grid-template-columns: minmax(280px, 35%) minmax(0, 65%); gap: 18px; }
.identity-card, .avatar-card { border: 1px solid rgba(255,255,255,.88); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: 0 20px 55px rgba(0,66,45,.12); }
.identity-card { display: flex; flex-direction: column; padding: 20px; }
.selected-preview { position: relative; height: clamp(170px, 27vh, 260px); display: grid; place-items: end center; overflow: hidden; border-radius: 23px; background: linear-gradient(145deg, #fff4a5, #ccebdc); }
.selected-preview::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 12px; height: 18px; border-radius: 50%; background: rgba(1,64,44,.15); filter: blur(8px); }
.selected-preview img { position: relative; z-index: 2; max-width: 88%; max-height: 98%; object-fit: contain; }
.preview-orbit { position: absolute; width: 190px; height: 190px; border: 2px dashed rgba(5,111,75,.24); border-radius: 50%; }
.fields { display: grid; gap: 12px; margin-top: 18px; }
.fields label span { display: block; margin: 0 0 6px 4px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .055em; }
.fields input { width: 100%; height: 50px; padding: 0 15px; border: 2px solid #d9ebe3; border-radius: 14px; outline: none; color: var(--ink); background: #f8fbfa; font-size: 16px; }
.fields input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(7,128,82,.1); }
.form-note { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 14px; color: var(--muted); }
.form-note span { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); }
.form-note p { margin: 0; font-size: 11px; line-height: 1.3; }
.avatar-card { min-width: 0; display: flex; flex-direction: column; padding: 20px; }
.avatar-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.avatar-card-head small { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.avatar-card-head h2 { margin: 3px 0 0; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.04em; }
.selection-label { padding: 8px 11px; border-radius: 99px; color: var(--muted); background: #edf6f2; font-size: 11px; font-weight: 800; }
.avatar-grid { min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.avatar-option { position: relative; aspect-ratio: 1; display: grid; place-items: end center; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 18px; background: linear-gradient(145deg, #f2f8f5, #e2f1ea); cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.avatar-option:hover { transform: translateY(-3px); }
.avatar-option img { max-width: 92%; max-height: 94%; object-fit: contain; filter: drop-shadow(0 7px 8px rgba(0,61,42,.12)); }
.avatar-option[data-selected="true"] { border-color: var(--green); background: linear-gradient(145deg, #fff5a9, #d6f0e3); box-shadow: 0 0 0 3px rgba(7,128,82,.12); }
.avatar-option[data-selected="true"]::after { content: "✓"; position: absolute; right: 5px; top: 5px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 13px; font-weight: 900; box-shadow: 0 3px 8px rgba(0,70,48,.24); }
.create-button { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: auto; padding: 0 22px; border: 0; border-radius: 16px; color: #123628; background: var(--yellow); box-shadow: 0 6px 0 var(--orange); font-weight: 900; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.create-button i { font-size: 22px; font-style: normal; }
.create-button:disabled { color: #71837d; background: #e7eeeb; box-shadow: 0 5px 0 #cbd8d2; cursor: default; }

.ready-screen { display: grid; place-items: center; padding: 32px; background: radial-gradient(circle at 50% 35%, #147755 0, #074c39 52%, #033426 100%); }
.ready-card { position: relative; width: min(760px, 92vw); overflow: hidden; padding: 32px 46px 38px; border-radius: 34px; background: #fff; box-shadow: 0 34px 90px rgba(0,0,0,.34); text-align: center; }
.ready-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 10px; background: linear-gradient(90deg, var(--yellow), var(--green)); }
.ready-kicker { color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ready-avatar { width: 210px; height: 210px; display: grid; place-items: end center; overflow: hidden; margin: 16px auto; border: 7px solid #fff; border-radius: 50%; background: linear-gradient(145deg, #fff3a2, #d8f1e5); box-shadow: 0 0 0 4px var(--yellow), 0 18px 35px rgba(0,72,49,.2); }
.ready-avatar img { max-width: 94%; max-height: 97%; object-fit: contain; }
.ready-card h1 { margin: 0; font-size: clamp(34px, 4.5vw, 54px); letter-spacing: -.05em; }
.ready-message { margin-top: 14px; padding: 14px 18px; border-radius: 16px; background: #fff4ad; font-size: 16px; font-weight: 900; }
.ready-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 16px; }
.secondary-button, .map-button { min-height: 50px; display: grid; place-items: center; padding: 0 14px; border-radius: 14px; font-weight: 800; }
.secondary-button { border: 1px solid var(--line); color: var(--green-dark); background: #fff; }
.map-button { border: 0; color: #15392c; background: var(--yellow); box-shadow: 0 5px 0 var(--orange); }
.map-button span { margin-left: 7px; font-size: 20px; }

.map-screen { height: calc(100vh - 76px); min-height: 620px; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: #dceee6; }
.map-hud { position: relative; z-index: 5; min-height: 106px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(380px, 1.5fr) minmax(220px, 1fr); align-items: center; gap: 20px; padding: 12px clamp(18px, 3vw, 44px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 8px 28px rgba(0,63,44,.1); }
.player-chip { min-width: 0; display: flex; align-items: center; gap: 10px; }
.player-avatar { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: end center; overflow: hidden; border: 3px solid #fff; border-radius: 19px; background: linear-gradient(145deg, #fff3a5, #d9f0e5); box-shadow: 0 0 0 2px var(--yellow), 0 8px 18px rgba(0,65,44,.13); }
.player-avatar img { max-width: 96%; max-height: 98%; object-fit: contain; }
.player-copy { min-width: 0; }
.player-copy small, .player-copy strong { display: block; }
.player-copy small { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.player-copy strong { max-width: 155px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.score-chip { display: grid; grid-template-columns: 28px auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; margin-left: auto; padding: 8px 12px; border-radius: 15px; background: #fff5b5; }
.score-chip i { grid-row: 1 / 3; color: var(--orange); font-size: 24px; font-style: normal; }
.score-chip b { font-size: 19px; line-height: 1; }
.score-chip small { color: #756b2e; font-size: 9px; }
.map-heading { text-align: center; }
.map-heading h1 { max-width: 600px; margin: 4px auto 0; font-size: clamp(16px, 1.8vw, 23px); line-height: 1.12; letter-spacing: -.025em; }
.progress-chip { justify-self: end; display: flex; align-items: center; gap: 10px; }
.progress-ring { --progress: 0; position: relative; width: 68px; height: 68px; display: grid; grid-template-columns: auto auto; place-content: center; align-items: baseline; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--progress) * 1turn), #dceee6 0); box-shadow: 0 7px 17px rgba(0,66,45,.1); }
.progress-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.progress-ring b, .progress-ring small { position: relative; z-index: 1; }
.progress-ring b { font-size: 25px; }
.progress-ring small { color: var(--muted); font-size: 11px; }
.progress-chip > span:last-child strong { display: block; font-size: 11px; line-height: 1.15; text-transform: uppercase; }
.map-canvas { position: relative; min-height: 0; overflow: hidden; isolation: isolate; background: #d9f1f8; }
.map-art { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.map-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4,61,46,.03), transparent 38%, rgba(3,45,34,.1)); }
.mission-pins { position: absolute; z-index: 3; inset: 0; }
.mission-pin { position: absolute; width: clamp(58px, 6.4vw, 82px); aspect-ratio: 1; display: grid; place-items: end center; padding: 0; transform: translate(-50%, -50%); border: 4px solid #fff; border-radius: 50%; background: linear-gradient(145deg, #fff5a2, #d9f2e6); box-shadow: 0 0 0 5px var(--yellow), 0 11px 24px rgba(0,50,35,.35); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.mission-pin::before { content: ""; position: absolute; left: 50%; bottom: -16px; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; background: var(--yellow); box-shadow: 4px 4px 9px rgba(0,55,38,.18); }
.mission-pin:hover { transform: translate(-50%, -50%) scale(1.08); }
.mission-pin img { position: relative; z-index: 1; max-width: 96%; max-height: 96%; object-fit: contain; }
.mission-pin[data-state="selected"] { z-index: 6; transform: translate(-50%, -50%) scale(1.14); box-shadow: 0 0 0 7px #fff, 0 0 0 12px var(--green), 0 16px 32px rgba(0,50,35,.4); }
.mission-pin[data-state="completed"] { box-shadow: 0 0 0 6px #fff, 0 0 0 11px var(--green), 0 12px 25px rgba(0,50,35,.32); }
.mission-pin[data-state="completed"]::after { content: "✓"; position: absolute; z-index: 4; right: -9px; top: -9px; width: 28px; height: 28px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--green); font-size: 14px; font-weight: 900; }
.map-hint { position: absolute; z-index: 4; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 15px; border: 1px solid rgba(255,255,255,.75); border-radius: 999px; background: rgba(255,255,255,.88); box-shadow: 0 10px 26px rgba(0,62,43,.18); color: var(--green-dark); backdrop-filter: blur(12px); font-size: 12px; font-weight: 800; white-space: nowrap; }
.map-hint span { margin-right: 5px; }
.mission-detail { position: absolute; z-index: 10; left: clamp(18px, 3vw, 44px); bottom: clamp(18px, 3vh, 30px); width: min(590px, calc(100% - 36px)); min-height: 152px; display: grid; grid-template-columns: 122px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 18px; align-items: center; padding: 15px 18px 15px 14px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: 0 25px 70px rgba(0,46,32,.34); backdrop-filter: blur(18px); }
.mission-detail[hidden] { display: none; }
.detail-close { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--green-dark); background: var(--mint); font-size: 22px; cursor: pointer; }
.detail-avatar { grid-row: 1 / 3; height: 122px; display: grid; place-items: end center; overflow: hidden; border-radius: 21px; background: linear-gradient(145deg, #fff4aa, #d9f1e5); }
.detail-avatar img { max-width: 96%; max-height: 97%; object-fit: contain; }
.detail-copy { align-self: end; padding-right: 32px; }
.detail-copy small { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.detail-copy h2 { margin: 4px 0 4px; font-size: clamp(20px, 2.1vw, 28px); line-height: 1; letter-spacing: -.035em; }
.detail-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.start-mission { align-self: end; min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 9px; padding: 0 16px; border: 0; border-radius: 13px; color: #15382c; background: var(--yellow); box-shadow: 0 4px 0 var(--orange); font-size: 12px; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.start-mission span { font-size: 18px; }

/* One-card player setup with a centered avatar wheel */
.create-screen { display: grid; place-items: center; padding: clamp(18px, 3vh, 34px) clamp(22px, 4vw, 62px); }
.player-form { width: min(980px, 100%); display: block; margin: 0 auto; padding: clamp(20px, 3vh, 30px) clamp(24px, 4vw, 44px) 24px; border: 1px solid rgba(255,255,255,.92); border-radius: 32px; background: rgba(255,255,255,.94); box-shadow: 0 24px 64px rgba(0,66,45,.15); }
.profile-card { display: flex; flex-direction: column; min-width: 0; }
.profile-intro { text-align: center; }
.profile-intro h1 { margin: 7px 0 4px; font-size: clamp(34px, 4.2vw, 54px); line-height: .95; letter-spacing: -.05em; text-transform: uppercase; }
.profile-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.identity-fields { width: min(720px, 100%); grid-template-columns: 1fr 1fr; gap: 14px; margin: 17px auto 0; }
.profile-card .avatar-card-head { justify-content: center; margin: 15px 0 7px; padding-top: 13px; border-top: 1px solid var(--line); text-align: center; }
.avatar-wheel { display: grid; grid-template-columns: 48px minmax(90px, 150px) minmax(190px, 260px) minmax(90px, 150px) 48px; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 16px); min-height: 232px; }
.avatar-peek, .avatar-selected { position: relative; aspect-ratio: 1; display: grid; place-items: end center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #eef7f3, #dcefe6); }
.avatar-peek { width: 100%; padding: 0; border: 2px solid rgba(7,128,82,.12); opacity: .62; cursor: pointer; transform: scale(.82); transition: opacity .18s ease, transform .18s ease; }
.avatar-peek:hover { opacity: .9; transform: scale(.9); }
.avatar-peek img, .avatar-selected img { display: block; max-width: 96%; max-height: 98%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,61,42,.14)); }
.avatar-selected { width: 100%; border: 6px solid #fff; background: linear-gradient(145deg, #fff3a2, #d8f1e5); box-shadow: 0 0 0 4px var(--yellow), 0 18px 36px rgba(0,72,49,.2); }
.avatar-selected .selection-label { position: absolute; z-index: 3; left: 50%; bottom: 8px; transform: translateX(-50%); max-width: 86%; padding: 6px 12px; overflow: hidden; border-radius: 999px; color: #fff; background: rgba(4,76,57,.9); font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.carousel-arrow { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #17382c; background: var(--yellow); box-shadow: 0 5px 0 var(--orange); font-size: 23px; font-weight: 900; cursor: pointer; }
.profile-card .create-button { width: min(430px, 100%); margin: 5px auto 0; }

/* Map pin artwork always stays inside the circular icon */
.mission-pin { place-items: center; }
.pin-avatar { position: absolute; inset: 2px; z-index: 1; display: grid; place-items: end center; overflow: hidden; border-radius: 50%; }
.mission-pin .pin-avatar img { display: block; max-width: 94%; max-height: 94%; object-fit: contain; }

/* Mission player and score result */
.mission-play-screen { height: calc(100vh - 76px); min-height: 620px; position: relative; display: grid; grid-template-rows: 58px minmax(0, 1fr); overflow: hidden; background: radial-gradient(circle at center, #2a6e5c, #073f31 74%); }
.mission-toolbar { position: relative; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 7px clamp(16px, 3vw, 42px); color: #eaf8f3; background: #06372b; border-bottom: 1px solid rgba(255,255,255,.1); }
.back-to-map { justify-self: start; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 900; }
.mission-toolbar > div { text-align: center; }
.mission-toolbar small, .mission-toolbar strong { display: block; }
.mission-toolbar small { color: #9dcbbe; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.mission-toolbar strong { max-width: 440px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mission-toolbar-right { justify-self: end; display: flex; align-items: center; gap: 15px; }
.mission-timer { min-width: 82px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-radius: 12px; color: #12372c; background: var(--yellow); font-size: 11px; font-weight: 900; }
.mission-timer i { font-style: normal; }
.mission-timer b { font-size: 15px; font-variant-numeric: tabular-nums; }
.mission-timer[data-warning="true"] { color: #fff; background: #cb4b36; }
.toolbar-score { justify-self: end; color: #cbe7dd; font-size: 11px; font-weight: 800; }
.toolbar-score i { color: var(--yellow); font-style: normal; font-size: 18px; }
.toolbar-score b { margin-left: 3px; color: #fff; font-size: 16px; }
.mission-frame-stage { min-height: 0; display: grid; place-items: center; padding: 14px; }
.mission-frame-stage iframe { width: min(calc((100vh - 164px) * 4 / 3), calc(100vw - 28px)); aspect-ratio: 4 / 3; display: block; border: 0; border-radius: 20px; background: #dce9e4; box-shadow: 0 28px 75px rgba(0,0,0,.42); }
.mission-result { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(2,50,37,.88); backdrop-filter: blur(14px); }
.mission-result[hidden] { display: none; }
.result-card { position: relative; width: min(600px, 92vw); padding: 30px 38px 34px; border-radius: 32px; background: #fff; box-shadow: 0 32px 90px rgba(0,0,0,.4); text-align: center; }
.result-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 9px; border-radius: 32px 32px 0 0; background: linear-gradient(90deg, var(--yellow), var(--green)); }
.result-badge { position: absolute; right: 28px; top: 24px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 7px 0 #035d3c; font-size: 27px; font-weight: 900; }
.result-avatar { width: 145px; height: 145px; display: grid; place-items: end center; overflow: hidden; margin: 0 auto 13px; border: 5px solid #fff; border-radius: 50%; background: linear-gradient(145deg, #fff2a3, #d8f1e5); box-shadow: 0 0 0 4px var(--yellow), 0 14px 30px rgba(0,62,43,.18); }
.result-avatar img { max-width: 95%; max-height: 97%; object-fit: contain; }
.result-kicker { color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.result-card h2 { margin: 6px 0 12px; font-size: clamp(27px, 4vw, 42px); line-height: 1; letter-spacing: -.045em; }
.earned-points { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 18px; border-radius: 16px; background: #fff3a8; }
.earned-points b { font-size: 34px; line-height: 1; }
.earned-points span { color: #665e25; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.result-card p { margin: 14px 0; color: var(--muted); line-height: 1.45; }
.result-ok { width: 100%; min-height: 52px; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--green), var(--green-dark)); font-weight: 900; cursor: pointer; }

/* Five-mission celebration and shared leaderboard */
.finish-screen { display: grid; place-items: center; padding: clamp(16px, 3vw, 38px); overflow: hidden; background: radial-gradient(circle at 16% 20%, rgba(255,213,31,.3), transparent 28%), linear-gradient(145deg, #063e30, #0a7652); }
.finish-card { width: min(1180px, 100%); max-height: calc(100vh - 108px); display: grid; grid-template-columns: minmax(330px, .86fr) minmax(500px, 1.14fr); overflow: hidden; border-radius: 34px; background: #fff; box-shadow: 0 36px 90px rgba(0,0,0,.38); }
.finish-celebration { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 27px 30px; text-align: center; background: radial-gradient(circle at 50% 34%, #fffbdc 0 24%, #e1f4ea 62%, #c9e8da 100%); }
.celebration-rays { position: absolute; width: 520px; aspect-ratio: 1; border-radius: 50%; opacity: .23; background: repeating-conic-gradient(from 0deg, var(--yellow) 0 8deg, transparent 8deg 18deg); animation: rays 24s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.finish-kicker, .finish-avatar, .finish-celebration h1, .finish-message, .finish-score, .finish-actions { position: relative; z-index: 1; }
.finish-kicker { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.finish-avatar { width: clamp(128px, 15vw, 188px); aspect-ratio: 1; display: grid; place-items: end center; overflow: hidden; margin: 13px auto; border: 6px solid #fff; border-radius: 50%; background: linear-gradient(145deg, #fff2a2, #d1ecdf); box-shadow: 0 0 0 5px var(--yellow), 0 17px 38px rgba(0,68,46,.22); }
.finish-avatar img { max-width: 94%; max-height: 98%; object-fit: contain; }
.finish-celebration h1 { margin: 3px 0 5px; font-size: clamp(30px, 4vw, 51px); line-height: .95; letter-spacing: -.05em; }
.finish-message { max-width: 450px; margin: 6px 0 11px; color: #3e685c; font-size: 13px; line-height: 1.35; }
.finish-score { display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 8px 18px; border-radius: 17px; color: #413b10; background: var(--yellow); box-shadow: 0 6px 0 var(--orange); }
.finish-score span { grid-row: 1 / 3; color: #ca7111; font-size: 31px; }
.finish-score b { font-size: 27px; line-height: 1; }
.finish-score small { font-size: 9px; font-weight: 900; text-transform: uppercase; }
.finish-actions { width: 100%; display: grid; gap: 8px; margin-top: 18px; }
.finish-actions button { min-height: 48px; border: 0; border-radius: 14px; font-weight: 900; cursor: pointer; }
.continue-game { color: #fff; background: linear-gradient(135deg, var(--green), var(--green-dark)); box-shadow: 0 5px 0 #043e2f; }
.continue-game span { margin-left: 6px; font-size: 18px; }
.restart-game { color: var(--green-dark); background: rgba(255,255,255,.72); outline: 1px solid rgba(5,99,70,.16); }
.finish-leaderboard { min-width: 0; padding: 25px 27px 27px; background: #fff; }
.board-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.board-head span { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.board-head h2 { margin: 2px 0 0; font-size: 28px; letter-spacing: -.04em; }
.board-head a { color: var(--green); font-size: 10px; font-weight: 900; text-decoration: underline; text-underline-offset: 4px; }
.leader-list { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; counter-reset: leaders; }
.leader-row { min-height: 45px; display: grid; grid-template-columns: 30px 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 14px; background: #f2f8f5; }
.leader-row.current { color: #12392c; background: linear-gradient(90deg, #fff2a2, #e1f3e9); box-shadow: inset 0 0 0 2px var(--yellow); }
.leader-row.outside { margin-top: 5px; border-top: 2px dashed #c6ddd3; }
.leader-rank { color: var(--muted); font-size: 12px; font-weight: 900; text-align: center; }
.leader-row:nth-child(1) .leader-rank { color: #d98913; font-size: 17px; }
.leader-avatar { width: 38px; height: 38px; display: grid; place-items: end center; overflow: hidden; border-radius: 50%; background: #dcefe6; }
.leader-avatar img { max-width: 94%; max-height: 97%; object-fit: contain; }
.leader-name { min-width: 0; }
.leader-name strong, .leader-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-name strong { font-size: 12px; }
.leader-name small { margin-top: 1px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.leader-points { color: var(--green-dark); font-size: 14px; font-weight: 900; }
.leader-points::before { content: "★"; margin-right: 4px; color: var(--orange); }

.leaderboard-screen { padding: 25px clamp(24px, 5vw, 76px) 34px; background: radial-gradient(circle at 90% 8%, rgba(255,213,31,.28), transparent 24%), linear-gradient(145deg, #edf8f3, #d9eee4); }
.leaderboard-shell { width: min(1180px, 100%); margin: 0 auto; }
.leaderboard-title { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.leaderboard-title h1 { margin: 4px 0 0; font-size: clamp(35px, 5vw, 62px); line-height: .95; letter-spacing: -.055em; }
.leaderboard-summary { display: flex; align-items: center; gap: 10px; padding: 11px 17px; border-radius: 18px; background: #fff; box-shadow: 0 12px 28px rgba(0,65,44,.1); }
.leaderboard-summary b { color: var(--green); font-size: 29px; }
.leaderboard-summary span { color: var(--muted); font-size: 10px; font-weight: 900; line-height: 1.1; text-transform: uppercase; }
.dashboard-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 15px; }
.dashboard-stats article { min-width: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: end; column-gap: 9px; padding: 10px 13px; border-radius: 17px; background: rgba(255,255,255,.82); box-shadow: 0 9px 23px rgba(0,65,44,.07); }
.dashboard-stats span { grid-column: 1 / -1; color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-stats b { margin-top: 3px; font-size: 23px; line-height: 1; }
.dashboard-stats small { align-self: center; color: var(--muted); font-size: 8px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.leader-tabs { display: inline-flex; gap: 4px; margin-top: 14px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.76); box-shadow: 0 8px 22px rgba(0,65,44,.07); }
.leader-tabs button { min-height: 34px; padding: 0 17px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 900; cursor: pointer; }
.leader-tabs button[aria-selected="true"] { color: #fff; background: var(--green); box-shadow: 0 5px 12px rgba(4,98,67,.22); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 12px; }
.podium-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 10px 25px rgba(0,65,44,.09); }
.podium-card:first-child { background: linear-gradient(135deg, #fff2a0, #fff); box-shadow: 0 0 0 2px var(--yellow), 0 12px 28px rgba(0,65,44,.12); }
.podium-card .leader-avatar { width: 48px; height: 48px; }
.podium-card b { color: var(--green-dark); font-size: 15px; }
.leaderboard-table { padding: 13px; border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: 0 18px 45px rgba(0,65,44,.12); }
.leaderboard-columns { display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 90px; gap: 10px; padding: 0 10px 7px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.leaderboard-columns span:last-child { text-align: right; }
.leader-list.full { grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.leader-list.full .leader-row { grid-template-columns: 30px 40px minmax(0, 1fr) auto; }
.leader-pagination { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 11px; }
.leader-pagination button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #163a2e; background: var(--yellow); font-size: 18px; font-weight: 900; cursor: pointer; }
.leader-pagination button:disabled { color: #8a9994; background: #e4ece8; cursor: default; }
.leader-pagination span { min-width: 126px; color: var(--muted); font-size: 10px; font-weight: 900; text-align: center; text-transform: uppercase; }

@media (max-width: 1050px) {
  .home-screen { grid-template-columns: 58% 42%; }
  .home-content { padding-left: 38px; }
  .home-content h1 { font-size: 66px; }
  .audience-choices { grid-template-columns: 1fr; max-width: 480px; }
  .audience-button { min-height: 92px; }
  .hero-raccoon { width: 83%; right: -17%; }
  .hero-wolf { width: 72%; left: -13%; }
  .hero-lynx { width: 55%; right: 8%; }
  .mission-sticker { width: 116px; height: 116px; right: 3%; padding: 14px; }
  .mission-sticker b { font-size: 35px; }
  .avatar-wheel { grid-template-columns: 46px 120px 220px 120px 46px; }
  .finish-card { grid-template-columns: minmax(300px, .9fr) minmax(440px, 1.1fr); }
  .finish-celebration { padding-inline: 22px; }
  .finish-leaderboard { padding: 20px; }
}
@media (max-height: 720px) and (min-width: 760px) {
  .create-screen { padding-top: 18px; padding-bottom: 18px; }
  .player-form { padding-top: 16px; padding-bottom: 16px; }
  .profile-intro h1 { font-size: 34px; }
  .avatar-wheel { min-height: 185px; grid-template-columns: 44px 105px 175px 105px 44px; }
}
@media (max-width: 760px) {
  .topbar { height: 68px; padding: 7px 13px; }
  .brand img { width: 51px; height: 51px; }
  .brand small { display: none; }
  .screen { min-height: calc(100vh - 68px); }
  .home-screen { display: block; padding-bottom: 300px; }
  .home-content { padding: 42px 18px 20px; }
  .home-content h1 { font-size: 51px; }
  .home-characters { position: absolute; inset: auto 0 0; height: 330px; }
  .mission-sticker { top: 13px; right: 14px; }
  .create-screen { padding: 28px 14px; }
  .player-form { display: block; padding: 15px; }
  .identity-fields { grid-template-columns: 1fr; }
  .avatar-wheel { grid-template-columns: 40px 70px minmax(130px, 180px) 70px 40px; min-height: 175px; gap: 5px; }
  .avatar-peek { transform: scale(.72); }
  .create-button { margin-top: 18px; }
  .ready-card { padding: 28px 18px; }
  .ready-actions { grid-template-columns: 1fr; }
  .map-screen { height: calc(100vh - 68px); min-height: 700px; overflow: auto; }
  .map-hud { grid-template-columns: 1fr auto; min-height: 92px; padding: 10px 13px; }
  .map-heading { grid-column: 1 / -1; grid-row: 2; }
  .player-chip { grid-column: 1; grid-row: 1; }
  .progress-chip { grid-column: 2; grid-row: 1; }
  .score-chip { display: none; }
  .map-heading h1 { font-size: 14px; }
  .map-canvas { min-height: 560px; }
  .mission-pin { width: 55px; }
  .mission-detail { grid-template-columns: 90px 1fr; min-height: 130px; }
  .detail-avatar { height: 94px; }
  .map-hint { display: none; }
  .mission-play-screen { height: calc(100vh - 68px); min-height: 600px; }
  .mission-toolbar { grid-template-columns: 1fr auto; padding-inline: 12px; }
  .mission-toolbar > div:not(.mission-toolbar-right) { display: none; }
  .toolbar-score { display: none; }
  .mission-frame-stage iframe { width: min(calc((100vh - 145px) * 4 / 3), calc(100vw - 20px)); }
  .result-card { padding: 26px 18px; }
  .finish-screen { overflow: auto; padding: 14px; }
  .finish-card { max-height: none; display: block; }
  .finish-leaderboard { padding: 20px 14px; }
  .leaderboard-screen { padding: 22px 13px; }
  .leaderboard-title { align-items: end; }
  .leaderboard-summary { padding: 8px 10px; }
  .podium { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .leader-list.full { grid-template-columns: 1fr; }
  .leaderboard-columns { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
