:root { color-scheme: light; font-family: Nunito, "Arial Rounded MT Bold", system-ui, sans-serif; background: #fff8e8; color: #263044; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
.setup-screen { height: 100dvh; min-height: 100dvh; display: grid; place-items: center; padding: clamp(.65rem, 3vw, 1.5rem); background: radial-gradient(circle at 85% 15%, #d5f3ff 0 8%, transparent 9%), #fff8e8; }
.setup-card { width: min(100%, 36rem); max-height: calc(100dvh - 1.3rem); overflow: auto; padding: clamp(1rem, 5vw, 2.25rem); border: .22rem solid #263044; border-radius: 2rem; background: #fff; box-shadow: .55rem .55rem 0 #263044; }
.kicker { margin: 0; color: #1277a5; font-weight: 900; letter-spacing: .15em; }
h1 { margin: .25rem 0 .5rem; font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1; }
.intro { margin: 0 0 1.5rem; font-size: 1.1rem; line-height: 1.45; }
fieldset { margin: 0; padding: 1rem; border: .14rem solid #d4dce8; border-radius: 1rem; }
legend { padding: 0 .35rem; font-weight: 900; }
fieldset label { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; font-size: 1.05rem; }
input[type="checkbox"] { width: 1.35rem; height: 1.35rem; accent-color: #1277a5; }
.primary-button, .resume-row button, .secondary-button { border: 0; border-radius: 1rem; background: #1277a5; color: #fff; font-weight: 900; }
.primary-button { width: 100%; min-height: 3.4rem; margin-top: 1.25rem; font-size: 1.2rem; }
.primary-button:disabled { background: #8792a3; cursor: wait; }
.secondary-button { width: 100%; min-height: 3.2rem; margin-top: .75rem; border: .14rem solid #1277a5; background: #fff; color: #1277a5; font-size: 1.05rem; }
.link-share-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: 0 0 1rem; }
.link-share-row .primary-button, .link-share-row .secondary-button { min-height: 3rem; margin: 0; font-size: 1rem; }
.resume-box { margin-top: 1.5rem; padding-top: 1.25rem; border-top: .14rem dashed #c6cfdb; }
.resume-box h2 { margin: 0; font-size: 1.2rem; }
.resume-box p { margin: .3rem 0 .8rem; }
.resume-row { display: flex; gap: .6rem; }
.resume-row input { min-width: 0; flex: 1; border: .14rem solid #7d8999; border-radius: .8rem; padding: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.resume-row button { padding: 0 1rem; }
.message { min-height: 1.4em; margin: .9rem 0 0; color: #9d2d27; font-weight: 700; }
.result-screen { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(145deg, #f9fafc, #f2f6f8); }
.result-card { width: min(100%, 32rem); padding: clamp(1.4rem, 6vw, 2.5rem); border: .22rem solid #263044; border-radius: 2rem; background: #fff; box-shadow: .55rem .55rem 0 #263044; text-align: center; }
.result-card h1 { margin-bottom: 1.5rem; font-size: clamp(2rem, 9vw, 3rem); }
.result-stats { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.result-stat { margin: 0; border-radius: 1rem; font-weight: 900; text-align: left; overflow: hidden; }
.result-stat summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; list-style: none; }
.result-stat summary::-webkit-details-marker { display: none; }
.result-stat summary::after { content: "⌄"; order: 3; font-size: 1.25rem; }
.result-stat[open] summary::after { transform: rotate(180deg); }
.result-stat strong { font-size: clamp(2rem, 10vw, 3.2rem); line-height: .9; }
.result-words { max-height: 11rem; margin: 0; padding: 0 1rem 1rem 2.2rem; overflow: auto; font-weight: 750; }
.result-stat--correct { background: #dff1e6; color: #215c3d; }
.result-stat--partial { background: #faebc8; color: #83580d; }
.result-stat--incorrect { background: #f7dfdd; color: #8a322e; }
.learning-screen { position: relative; height: 100dvh; min-height: 100dvh; overflow: hidden; display: grid; place-items: center; padding: max(1rem, env(safe-area-inset-top)) max(1.1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.1rem, env(safe-area-inset-left)); background: linear-gradient(145deg, #f9fafc, #f2f6f8); touch-action: none; user-select: none; }
.link-share-row button.copied::after { content: " ✓"; color: #16824a; }
.edge { position: absolute; z-index: 0; pointer-events: none; }
.edge--top { inset: 0 0 auto; height: 4.1rem; background: linear-gradient(180deg, #f7d8d5, #f2c7c4); box-shadow: inset 0 -1px rgba(145, 59, 53, .14); }
.edge--left { inset: 0 auto 0 0; width: 4.5rem; background: linear-gradient(90deg, #c8e7d7, #e0f1e7); box-shadow: inset -1px 0 rgba(43, 118, 76, .12); }
.edge--bottom { inset: auto 0 0; height: 4.1rem; background: linear-gradient(0deg, #f7dca4, #f9e8bf); box-shadow: inset 0 1px rgba(151, 104, 25, .13); }
.learning-screen.confirmation--correct .edge--left { background: #7dcea1; box-shadow: inset -1px 0 rgba(22, 105, 60, .3), 0 0 1.4rem rgba(61, 165, 104, .5); animation: edge-confirmation .26s ease-out; }
.learning-screen.confirmation--partial .edge--bottom { background: #f2bc62; box-shadow: inset 0 1px rgba(137, 85, 8, .28), 0 0 1.4rem rgba(220, 153, 32, .45); animation: edge-confirmation .26s ease-out; }
.learning-screen.confirmation--incorrect .edge--top { background: #ed9e99; box-shadow: inset 0 -1px rgba(132, 43, 38, .3), 0 0 1.4rem rgba(207, 86, 78, .42); animation: edge-confirmation .26s ease-out; }
@keyframes edge-confirmation { 0% { filter: brightness(1); } 45% { filter: brightness(1.18) saturate(1.2); } 100% { filter: brightness(1); } }
.exercise-card { position: relative; z-index: 1; align-self: center; justify-self: center; width: min(100%, 38rem); padding: clamp(1.25rem, 5vw, 2.2rem); border: .25rem solid #263044; border-radius: 2rem; background: #fff; box-shadow: .5rem .5rem 0 #263044; text-align: center; will-change: transform, opacity; transition: transform .18s ease-out, opacity .18s ease-out; }
.exercise-card.entering { animation: card-entering .3s ease-out; }
@keyframes card-entering {
    from { opacity: 0; transform: translateX(120vw) rotate(12deg); }
    to { opacity: 1; transform: translateX(0) rotate(0); }
}
.exercise-card:focus-visible { outline: .25rem solid #1277a5; outline-offset: .35rem; }
.exercise-card.leaving { opacity: 0; transition: transform .3s ease-in, opacity .3s ease-in; }
.exercise-card.leaving--correct { transform: translateX(-120vw) rotate(-12deg); }
.exercise-card.leaving--partial { transform: translateY(120vh) rotate(4deg); }
.exercise-card.leaving--incorrect { transform: translateY(-120vh) rotate(-4deg); }
.letter { margin: 0; color: #1277a5; font-size: clamp(3.4rem, 17vw, 7rem); font-weight: 950; line-height: .9; }
.card-image { display: block; width: min(82%, 19rem); max-height: 34dvh; margin: 0 auto; object-fit: contain; pointer-events: none; }
.card-symbol { display: grid; place-items: center; width: min(82%, 19rem); min-height: min(48vw, 13rem); margin: 0 auto; font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: clamp(6rem, 30vw, 12rem); line-height: 1; pointer-events: none; }
.word { margin: 1rem 0 0; color: #263044; font-weight: 950; line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.word[hidden] { display: block !important; visibility: hidden; }
.word--short { font-size: clamp(3.35rem, 16vw, 5.6rem); }
.word--medium { font-size: clamp(2.9rem, 14vw, 5rem); }
.word--long { font-size: clamp(2.45rem, 12vw, 4.25rem); }
.word--very-long { font-size: clamp(2.05rem, 10vw, 3.5rem); }
.word .initial { color: #1277a5; }
@media (min-width: 720px) { .edge--left { width: 6.4rem; } .edge--top, .edge--bottom { height: 4.8rem; } }

@media (max-height: 720px) {
    .setup-card { padding: 1rem; border-radius: 1.35rem; box-shadow: .35rem .35rem 0 #263044; }
    h1 { font-size: clamp(1.7rem, 8vw, 2.35rem); }
    .intro { margin-bottom: .8rem; font-size: 1rem; }
    fieldset { padding: .65rem .85rem; }
    fieldset label { padding: .3rem 0; font-size: .96rem; }
    .primary-button { min-height: 2.9rem; margin-top: .8rem; }
    .resume-box { margin-top: .9rem; padding-top: .8rem; }
    .resume-box p { margin-bottom: .5rem; }
}
