.pemdas-page { --pemdas-pink: #f3d9e6; --pemdas-plum: #713050; --pemdas-green: #e0eed9; }
.pemdas-page main { max-width: 1440px; margin: auto; padding: 0 48px; }
.pemdas-hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 72px; padding: 80px 0; }
.pemdas-hero h1 { font-size: clamp(3.5rem, 7vw, 7rem); line-height: .98; letter-spacing: -.065em; margin: 24px 0; }
.pemdas-hero h1 em, .pemdas-section-heading h2 em { color: var(--pemdas-plum); font-family: Georgia, serif; font-weight: 400; }
.pemdas-intro { position: relative; padding-top: 100px; max-width: 480px; }
.pemdas-intro p { font-size: 1.1rem; line-height: 1.7; }
.pemdas-intro a, .pemdas-related a { display: inline-block; font-weight: 800; margin-top: 12px; text-underline-offset: 5px; }
.pemdas-stamp { position: absolute; top: 0; right: 24px; padding: 14px 22px; border: var(--line); box-shadow: 5px 5px 0 var(--ink); background: var(--pemdas-pink); font-size: 1.35rem; font-weight: 800; transform: rotate(7deg); }
.pemdas-stamp em { font: italic 1.8rem Georgia, serif; color: var(--pemdas-plum); }
.pemdas-section-heading h2 { margin: 18px 0 28px; font-size: clamp(2.5rem, 4.2vw, 4rem); line-height: 1.02; letter-spacing: -.05em; }
.pemdas-section-heading > p:last-child { line-height: 1.65; }
.pemdas-rules { padding: 20px 0 54px; }
.pemdas-order { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pemdas-order li { display: flex; align-items: start; gap: 14px; padding: 22px; border: var(--line); background: #fffaf1; box-shadow: 4px 4px 0 var(--ink); }
.pemdas-order li:nth-child(2) { background: #e5dcf4; }
.pemdas-order li:nth-child(3) { background: var(--pemdas-pink); }
.pemdas-order li:nth-child(4) { background: #cde9ed; }
.rule-number { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border: 1px solid var(--ink); border-radius: 50%; font-size: .75rem; font-weight: 800; margin-top: 6px; }
.pemdas-order strong { display: block; font-size: 2rem; line-height: 1.25; white-space: nowrap; letter-spacing: -.04em; }
.pemdas-order small { display: block; font-size: .65rem; letter-spacing: .03em; text-transform: uppercase; margin-top: 3px; }
.pemdas-order h3 { font-size: .95rem; margin: 15px 0 10px; }
.pemdas-order p { font-size: .85rem; line-height: 1.65; margin-bottom: 0; }
.pemdas-trap { border-left: 5px solid var(--pemdas-plum); padding: 8px 0 8px 22px; margin: 32px 0 0; max-width: 920px; font-size: 1rem; line-height: 1.7; }
.pemdas-learn { padding: 40px 0 70px; border-top: var(--line); scroll-margin-top: 24px; }
.walkthrough { display: grid; grid-template-columns: 1fr 1.3fr; border: var(--line); box-shadow: 8px 8px 0 var(--ink); }
.walkthrough-controls { padding: 30px; background: var(--pemdas-pink); border-right: var(--line); min-width: 0; }
.walkthrough-controls label, .quiz-setup label { display: block; font-weight: 800; margin-bottom: 12px; }
.pemdas-page select { width: 100%; max-width: 100%; min-height: 48px; padding: 12px; font: inherit; font-size: .9rem; border: var(--line); background: var(--paper); color: var(--ink); }
#example-original { font-size: 1.5rem; font-weight: 800; line-height: 1.5; margin: 28px 0 14px; }
#example-caption { font-size: .9rem; line-height: 1.65; }
.walkthrough-buttons { display: flex; gap: 12px; margin-top: 28px; }
.walkthrough-buttons button, .quiz-help button { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 12px; min-height: 44px; font: inherit; font-size: .85rem; font-weight: 750; cursor: pointer; }
.walkthrough-buttons button { flex: 1; }
.walkthrough-buttons button:disabled { opacity: .45; cursor: default; }
.text-button { font: inherit; font-weight: 750; font-size: .8rem; background: transparent; color: var(--ink); padding: 12px 0; margin-top: 14px; border: 0; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; min-height: 44px; }
.walkthrough-stage { padding: 34px; min-width: 0; display: flex; flex-direction: column; justify-content: center; background: #fffaf1; }
.math-expression { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .12em; font-family: 'Arial Black', 'Avenir Next', sans-serif; font-size: clamp(2rem, 3.2vw, 3.2rem); font-weight: 800; line-height: 1.65; letter-spacing: -.035em; overflow-wrap: anywhere; }
.math-expression .math-token { padding: 0 .04em; border-radius: 3px; }
.math-expression .math-selected { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.math-expression sup { font-size: .6em; position: relative; top: -.48em; margin-left: -.1em; }
#example-expression { padding: 30px 0; min-height: 140px; }
.next-operation { font-size: 1.15rem; font-weight: 800; margin: 12px 0; }
#example-reason { font-size: .95rem; line-height: 1.7; margin: 0; }
.pemdas-quiz { border-top: var(--line); padding: 50px 0; scroll-margin-top: 24px; }
.quiz-shell { border: var(--line); box-shadow: 8px 8px 0 var(--ink); background: #fffaf1; padding: 36px; }
.quiz-setup { display: grid; grid-template-columns: 1fr auto; gap: 64px; align-items: center; }
.quiz-setup > div { max-width: 560px; }
.quiz-setup p { font-size: .9rem; line-height: 1.65; }
#level-description { font-weight: 750; }
.pemdas-button { display: inline-block; background: var(--ink); color: var(--paper); font: inherit; font-weight: 800; border: 2px solid var(--ink); padding: 15px 22px; cursor: pointer; box-shadow: 4px 4px 0 var(--pemdas-plum); min-height: 48px; line-height: 1.4; }
.pemdas-button:hover { background: var(--pemdas-plum); }
.pemdas-button:disabled { opacity: .5; cursor: default; }
.quiz-topline { display: flex; gap: 20px; justify-content: space-between; font-weight: 800; font-size: .9rem; }
.quiz-topline p { margin: 0 0 16px; line-height: 1.5; }
#quiz-progress { width: 100%; height: 13px; accent-color: var(--pemdas-plum); display: block; }
.quiz-question { max-width: 740px; margin: 36px auto 0; }
.quiz-question h3 { font-size: 1.2rem; text-align: center; margin-bottom: 8px; }
.quiz-level-tag { text-align: center; font-size: .75rem; color: var(--pemdas-plum); font-weight: 800; margin: 0; }
#question-expression { margin: 20px 0 30px; padding: 18px; background: var(--pemdas-pink); border: 2px solid var(--ink); }
#answer-form { max-width: 550px; margin: auto; }
#answer-form > label { display: block; font-size: .85rem; font-weight: 800; margin: 0 0 10px; }
.answer-row { display: flex; gap: 14px; align-items: stretch; }
#quiz-answer { width: 0; flex: 1; min-width: 70px; padding: 10px; border: var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 1.5rem; font-weight: 800; }
#quiz-answer:disabled { opacity: .75; }
#answer-help { font-size: .8rem; line-height: 1.6; }
.quiz-error { padding: 12px; border: 2px solid #8c2920; background: #fff2ed; color: #702016; font-size: .9rem; line-height: 1.5; }
.quiz-help { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.quiz-help button { background: transparent; font-size: .8rem; }
.quiz-hint { padding: 18px; border: 2px dashed var(--pemdas-plum); font-size: .95rem; line-height: 1.7; background: #f8eaf1; }
.quiz-feedback { border: 2px solid var(--ink); background: var(--pemdas-pink); padding: 26px; max-width: 740px; margin: 28px auto 0; }
.quiz-feedback[data-correct="true"] { background: var(--pemdas-green); }
.quiz-feedback h3 { margin: 0 0 12px; font-size: 1.5rem; }
.quiz-feedback > p { line-height: 1.7; }
.quiz-feedback summary, #missed-questions summary { cursor: pointer; font-weight: 800; padding: 12px 0; line-height: 1.6; }
.solution-steps { padding-left: 24px; }
.solution-steps li { padding: 10px 0; line-height: 1.7; font-size: .9rem; }
.solution-steps strong { display: block; font-size: 1.05rem; }
.solution-steps p { margin: 6px 0; }
.solution-expression { font-family: Georgia, serif; font-size: 1.1rem; font-weight: 800; }
#next-question { margin-top: 18px; }
#reset-quiz { display: block; margin: 28px auto 0; }
.quiz-results { max-width: 850px; margin: auto; }
.quiz-results h3 { font-size: 2rem; margin-bottom: 8px; }
.results-score { font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; letter-spacing: -.06em; line-height: 1.2; margin: 18px 0; color: var(--pemdas-plum); }
#results-copy { font-size: 1.05rem; line-height: 1.7; }
.results-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.results-stats p { border: 2px solid var(--ink); background: var(--pemdas-pink); padding: 14px; font-size: .85rem; margin: 0; line-height: 1.6; }
#review-misses { margin: 36px 0; border-block: 2px solid var(--ink); padding: 20px 0; }
#review-misses h4 { font-size: 1.25rem; margin: 0; }
#review-misses > p { font-size: .9rem; line-height: 1.7; }
#missed-questions details { padding: 10px 0; border-top: 1px solid var(--ink); }
.quiz-noscript { font-size: 1rem; line-height: 1.8; border: var(--line); padding: 24px; background: var(--yellow); }
.pemdas-related { display: flex; gap: 36px; align-items: center; border: var(--line); background: #cde9ed; padding: 32px; margin: 20px 0 80px; }
.pemdas-related > span { font: 4rem Georgia, serif; color: #174f62; }
.pemdas-related h2 { font-size: 1.5rem; margin: 0; }
.pemdas-related p { line-height: 1.6; }
.pemdas-page :focus-visible { outline: 3px solid var(--pemdas-plum); outline-offset: 5px; }
.pemdas-page [tabindex="-1"]:focus { outline: none; }
.pemdas-page [hidden] { display: none !important; }
@media (max-width: 1100px) { .pemdas-page main { padding: 0 28px; } .pemdas-hero { gap: 32px; } .pemdas-order { grid-template-columns: repeat(2, 1fr); } .quiz-setup { gap: 32px; } }
@media (max-width: 760px) { .pemdas-hero { grid-template-columns: 1fr; padding: 44px 0; gap: 8px; } .pemdas-hero h1 { font-size: clamp(3.3rem, 12vw, 5rem); } .pemdas-intro { max-width: none; padding-top: 0; } .pemdas-stamp { display: none; } .walkthrough { grid-template-columns: 1fr; } .walkthrough-controls { border-right: 0; border-bottom: var(--line); } .walkthrough-stage, .walkthrough-controls, .quiz-shell { padding: 24px; } .quiz-setup { grid-template-columns: 1fr; gap: 20px; } .quiz-setup .pemdas-button { justify-self: start; } .math-expression { font-size: 2rem; } .quiz-feedback { padding: 20px; } .pemdas-section-heading h2 { font-size: 2.8rem; } .pemdas-related { gap: 20px; padding: 24px; } }
@media (max-width: 440px) { .pemdas-page main { padding: 0 18px; } .pemdas-order { grid-template-columns: 1fr; } .pemdas-order li { padding: 20px; } .pemdas-order strong { font-size: 1.8rem; } .pemdas-order small { display: inline; margin-left: 10px; } .walkthrough-controls, .walkthrough-stage, .quiz-shell { padding: 20px; } .quiz-topline { display: block; } .quiz-topline p { margin-bottom: 8px; } .answer-row { flex-wrap: wrap; } #quiz-answer { flex-basis: 100%; } .answer-row .pemdas-button { width: 100%; } #question-expression { padding: 14px; font-size: 1.7rem; } .quiz-feedback { padding: 16px; } .pemdas-related > span { display: none; } #example-expression { font-size: 1.9rem; } }
