.mastery-card, .mastery-card__question { position: relative; width: 100%; height: 100%; min-height: 0; }
.mastery-card .question-card { padding-top: calc(var(--format-top) + 64px); }
.mastery-card .question-card__meta { display: none; }
.mastery-card__progress { position: absolute; z-index: 1; top: var(--format-top); left: max(var(--edge), env(safe-area-inset-left)); right: max(var(--edge), env(safe-area-inset-right)); max-width: 640px; margin-inline: auto; color: #6b4b96; }
.mastery-card__progress-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.mastery-card__label { font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.mastery-card__count { margin-left: auto; white-space: nowrap; font-size: 11px; font-weight: 650; }
.mastery-card__back { width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid #d6c8e7; border-radius: 50%; background: #ffffff80; color: #69438f; font-size: 20px; cursor: pointer; }
.mastery-card__back:focus-visible { outline: 2px solid #7950aa; outline-offset: 2px; }
.mastery-card__back:disabled { opacity: .5; cursor: default; }
.mastery-card__track { display: flex; gap: 8px; margin-top: 4px; }
.mastery-card__segment { flex: 1; height: 4px; border-radius: 8px; background: #dfd6ec; }
.mastery-card__segment.is-current { background: #a089c0; }
.mastery-card__segment.is-complete { background: #4a8063; }
.feed-header__achievements { flex: none; display: flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 6px; color: inherit; background: none; border: 0; border-radius: 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; pointer-events: auto; }
.feed-header__achievements svg { width: 24px; height: 24px; transform-origin: center; }
.feed-header__achievements:focus-visible { outline: 2px solid #b98935; outline-offset: 2px; }
.feed-header__achievements.is-receiving svg { animation: achievement-receive 900ms ease-in-out both; }
.knowledge-medal { position: relative; flex: none; width: 210px; aspect-ratio: 1; border-radius: 50%; padding: 8px; background: conic-gradient(from 20deg, #fff0b5, #c48b30, #ffe6a0, #fff3cb, #a86d23, #ffe7a4, #fff0b5); box-shadow: 0 8px 0 #a8772c, 0 12px 0 #704921, 0 28px 50px #0005; transform-style: preserve-3d; }
.knowledge-medal__rim { height: 100%; padding: 10px; border: 2px dashed #8e642d99; border-radius: 50%; }
.knowledge-medal__face { display: flex; align-items: center; justify-content: center; flex-direction: column; height: 100%; border: 3px solid #ffe4a0; border-radius: 50%; background: radial-gradient(circle at 35% 20%, #7088b8, #334873 65%, #263253); color: #ffedbc; box-shadow: inset 0 4px 12px #10172d66; }
.knowledge-medal__face svg { width: 65%; height: 65%; }
.knowledge-medal__face span { margin-top: -9px; font-size: 13px; letter-spacing: .3em; font-weight: 750; padding-left: .3em; }
.achievement-celebration { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: calc(var(--header-bottom) + 14px) 20px max(22px, env(safe-area-inset-bottom)); border: 0; color: #fff7e7; background: transparent; overflow: hidden; font-family: inherit; perspective: 1000px; isolation: isolate; }
.achievement-celebration[open] { display: grid; place-items: center; }
.achievement-celebration::backdrop { background: transparent; }
.achievement-celebration__background { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 40%, #344671f2, #12192ef5 74%); backdrop-filter: blur(4px); opacity: 1; transition: opacity 850ms ease; }
.achievement-celebration[open] .achievement-celebration__background { animation: achievement-surface-in 1000ms ease both; }
.achievement-celebration[open] .achievement-celebration__content { animation: achievement-content-in 1200ms 150ms ease both; }
.achievement-celebration__content { width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; text-align: center; padding: 12px 4px 4px; scrollbar-width: none; }
.achievement-celebration__eyebrow { color: #f0d699; font-size: 9px; letter-spacing: .18em; font-weight: 650; margin: 0 0 12px; }
.achievement-celebration__title { font-size: clamp(34px, 7vw, 48px); letter-spacing: -.05em; margin: 0; }
.achievement-celebration__stage { position: relative; display: grid; place-items: center; margin: 28px auto 34px; width: fit-content; perspective: 900px; }
.achievement-celebration__name { margin: 0 0 10px; font-size: 29px; line-height: 1.12; letter-spacing: -.03em; overflow-wrap: anywhere; }
.achievement-celebration__description { margin: 0 auto 24px; font-size: 14px; line-height: 1.5; color: #d9dfed; max-width: 32ch; }
.achievement-celebration__accept { min-height: 50px; width: 100%; padding: 13px 18px; border: 1px solid #f7df9f; border-radius: 14px; color: #3c2d12; background: linear-gradient(120deg, #ffe7a4, #e7bf68); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 6px 28px #e2b45030; }
.achievement-celebration__accept:focus-visible { outline: 2px solid white; outline-offset: 4px; }
.achievement-celebration__note { font-size: 12px; line-height: 1.4; color: #cad2e4; margin: 14px auto 0; max-width: 36ch; }
.achievement-celebration__demo { margin: 16px 0 0; color: #c0c9dc; font-size: 10px; }
.achievement-celebration__error { font-size: 13px; line-height: 1.4; color: #ffccbc; }
.achievement-celebration__retry { min-height: 44px; border: 0; background: none; color: #fff0c8; text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; }
.achievement-celebration__particles { pointer-events: none; position: absolute; inset: 0; overflow: hidden; }
.achievement-celebration__particles i { position: absolute; left: 50%; top: 42%; width: 7px; height: 12px; background: #eed18b; border-radius: 2px; animation: achievement-confetti 2200ms calc(700ms + var(--delay)) cubic-bezier(.1,.7,.3,1) both; }
.achievement-celebration__particles i:nth-child(3n) { background: #9ab8f3; border-radius: 50%; height: 7px; }
.achievement-celebration__particles i:nth-child(3n + 1) { background: #c2abea; }
.achievement-celebration.is-collecting { overflow: visible; }
.achievement-celebration.is-collecting .achievement-celebration__background { animation: none; opacity: 0; }
.achievement-celebration.is-collecting .achievement-celebration__particles { opacity: 0; transition: opacity 220ms; }
.achievement-celebration.is-collecting .achievement-celebration__content { overflow: visible; }
.achievement-celebration.is-collecting .achievement-celebration__content > :not(.achievement-celebration__stage) { opacity: 0; transition: opacity 220ms; pointer-events: none; }
.achievement-arrival { position: fixed; z-index: 5; top: calc(var(--header-bottom) + 14px); width: min(288px, calc(100% - 24px)); padding: 14px 16px; margin: 0; color: #36301f; background: #fff7df; border: 1px solid #ddc080; border-radius: 14px; font-size: 12px; line-height: 1.45; box-shadow: 0 10px 30px #0002; pointer-events: none; animation: achievement-content-in 300ms ease both; }
.achievement-arrival::before { content: ''; position: absolute; width: 12px; height: 12px; left: var(--pointer-x); top: -7px; transform: translateX(-50%) rotate(45deg); background: #fff7df; border-top: 1px solid #ddc080; border-left: 1px solid #ddc080; }
.achievement-arrival strong, .achievement-arrival span { display: block; }
.achievement-arrival strong { margin-bottom: 4px; font-size: 13px; }
.achievement-arrival span { color: #6c6045; }

.achievement-sheet { --sheet-surface: #faf7f0; --sheet-ink: #31374e; --sheet-muted: #727383; --sheet-border: #e2dccf; --sheet-control: #ede8db; --sheet-control-ink: #73603f; --sheet-focus: #7d6236; --sheet-handle: #d8cdb8; }
.achievement-sheet__body { padding: 16px max(var(--edge), env(safe-area-inset-left)); }
.achievement-sheet__intro { font-size: 13px; line-height: 1.55; color: #6c6a73; margin: 0 0 20px; }
.achievement-sheet .achievement-sheet__badge { width: 100%; display: flex; align-items: center; gap: 20px; padding: 20px 16px; margin-bottom: 12px; border-radius: 18px; border: 1px solid #dfd0af; background: #f0e8d7; text-align: left; color: #30384d; }
.achievement-sheet__badge .knowledge-medal { width: 84px; padding: 4px; box-shadow: 0 3px 0 #a8772c, 0 10px 14px #40301720; }
.achievement-sheet__badge .knowledge-medal__rim { padding: 3px; border-width: 1px; }
.achievement-sheet__badge .knowledge-medal__face { border-width: 2px; }
.achievement-sheet__badge .knowledge-medal__face span { font-size: 6px; margin-top: -4px; }
.achievement-sheet__badge > span { min-width: 0; }
.achievement-sheet__badge small { font-size: 8px; letter-spacing: .1em; color: #7c643c; }
.achievement-sheet__badge strong { display: block; font-size: 19px; line-height: 1.15; margin: 8px 0; overflow-wrap: anywhere; }
.achievement-sheet__badge span span { display: block; font-size: 11px; color: #726650; }
.achievement-sheet .achievement-sheet__back { color: #6e5e43; background: transparent; padding: 4px 0; min-height: 44px; font-size: 12px; }
.achievement-sheet__hero { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 18px; align-items: center; padding: 20px 0; }
.achievement-sheet__hero .knowledge-medal { grid-row: 1 / 3; width: 96px; padding: 4px; margin: 0 0 12px; }
.achievement-sheet__hero .knowledge-medal__rim { padding: 5px; border-width: 1px; }
.achievement-sheet__hero .knowledge-medal__face { border-width: 2px; }
.achievement-sheet__hero .knowledge-medal__face span { font-size: 7px; margin-top: -4px; }
.achievement-sheet__hero h3 { font-size: 22px; letter-spacing: -.03em; margin: 0; overflow-wrap: anywhere; }
.achievement-sheet__hero p { font-size: 12px; line-height: 1.5; color: #6c6a73; margin: 0; }
.achievement-sheet__hero .achievement-sheet__date { grid-column: 1 / -1; font-size: 11px; }
.achievement-sheet__review-title { font-size: 16px; margin: 8px 0 12px; }
.achievement-sheet .achievement-sheet__resource { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; padding: 16px 0; background: none; border-bottom: 1px solid #e2dccf; text-align: left; color: #30384d; }
.achievement-sheet__resource small { color: #84714e; font-size: 10px; }
.achievement-sheet__resource strong { display: block; font-size: 13px; line-height: 1.4; margin-top: 5px; }
.achievement-sheet__note { flex: none; font-size: 10px; line-height: 1.4; color: #756958; margin: 0; padding: 14px max(var(--edge), env(safe-area-inset-left)) var(--content-bottom); border-top: 1px solid #e2dccf; }
@keyframes achievement-surface-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes achievement-content-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes achievement-confetti { from { opacity: 0; transform: translate(0,0) scale(0); } 10% { opacity: 1; } to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.8); } }
@keyframes achievement-receive { 0%, 100% { transform: scale(1); color: inherit; filter: none; } 20% { transform: scale(1.34); color: #d6a035; filter: drop-shadow(0 0 3px #ecc97999); } 38% { transform: scale(.96); color: inherit; filter: none; } 62% { transform: scale(1.24); color: #d6a035; filter: drop-shadow(0 0 3px #ecc97999); } 82% { transform: scale(.99); color: inherit; filter: none; } }
@media (max-width: 699px) { .feed-header__achievements-label { display: none; } .feed-header__tools { gap: 6px; } .feed-header__achievements { padding: 6px; } }
@media (max-height: 660px) { .achievement-celebration { padding-top: calc(var(--header-bottom) + 8px); } .achievement-celebration__content { padding-top: 6px; } .achievement-celebration .knowledge-medal { width: 148px; } .achievement-celebration__stage { margin: 16px auto 24px; } .achievement-celebration__title { font-size: 30px; } .achievement-celebration__name { font-size: 24px; } .achievement-celebration__description { font-size: 12px; margin-bottom: 16px; } .achievement-celebration__note { margin-top: 10px; font-size: 11px; } .achievement-celebration__demo { margin-top: 10px; } }
@media (max-height: 480px) and (min-width: 560px) { .achievement-celebration__content { display: grid; grid-template-columns: 180px minmax(0, 1fr); max-width: 760px; gap: 8px 24px; text-align: left; align-items: center; } .achievement-celebration__stage { grid-row: 1 / 8; grid-column: 1; margin: 10px auto; } .achievement-celebration__content > :not(.achievement-celebration__stage) { grid-column: 2; margin: 0; } .achievement-celebration__description { max-width: none; } .achievement-celebration__eyebrow { font-size: 8px; } }
@media (prefers-reduced-motion: reduce) { .achievement-celebration__particles { display: none; } .feed-header__achievements.is-receiving svg, .achievement-arrival, .achievement-celebration[open] .achievement-celebration__background, .achievement-celebration[open] .achievement-celebration__content { animation: none; } .achievement-celebration__background { transition: none; } .achievement-celebration.is-collecting .achievement-celebration__content > * { transition: none; } }
