/* Pigeonhole Academy — ported from templates/academy-reference.jsx (v3).
   Design tokens: sky #DDEBFF · cloud #F6FAFF · ink #28324E · coral #FF7A59
   sunny #FFC53D · grass #3BB273 · pigeon #8D86C9 · bad #E45858 */

.ph-page { background: #DDEBFF; margin: 0 -16px; padding: 0 16px 64px; font-family: 'Nunito', system-ui, sans-serif; color: #28324E; }
.ph-disp { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; }

.ph-hero { text-align: center; padding: 40px 16px 24px; }
.ph-hero h1 { font-size: 2.6rem; margin: .2em 0; color: #28324E; }
.ph-hero .ph-sub { font-weight: 700; color: #4a5572; font-size: 1.1rem; margin: 0; }
.ph-mascots { font-size: 3.4rem; line-height: 1; }

.ph-progress-wrap { max-width: 430px; margin: 16px auto 0; }
.ph-progress { height: 24px; border-radius: 999px; position: relative; background: #fff; border: 2px solid #28324E; }
.ph-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FFC53D, #FF7A59); transition: width .7s; }
.ph-progress-bird { position: absolute; top: 50%; transform: translateY(-58%); font-size: 19px; transition: left .7s; }
.ph-star-count { font-weight: 900; margin: 4px 0 0; }

.ph-story-btn { margin-top: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: .9rem; border: 2.5px solid #28324E; background: #fff; color: #28324E; cursor: pointer; }
.ph-story-btn.on { background: #FF7A59; color: #fff; box-shadow: 0 3px 0 #c9543a; }
.ph-story-note { font-size: .75rem; font-weight: 700; color: #5b6680; margin: 4px auto 0; max-width: 460px; }
.ph-perfect { font-size: 1.25rem; font-weight: 900; color: #3BB273; }

.ph-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 12px; margin-bottom: 24px; }
.ph-nav button { padding: 10px 16px; border-radius: 16px; font-weight: 900; font-size: .95rem; border: 3px solid #28324E; background: #fff; color: #28324E; cursor: pointer; font-family: 'Baloo 2', 'Nunito', sans-serif; }
.ph-nav button.active { background: #28324E; color: #fff; transform: translateY(-2px); }
.ph-nav button .stars { color: #FFC53D; }

.ph-main { max-width: 760px; margin: 0 auto; }

.ph-card { border-radius: 24px; padding: 20px; margin-bottom: 20px; background: #fff; border: 3px solid #8D86C9; }
.ph-card.coral { border-color: #FF7A59; }
.ph-card.sunny { border-color: #FFC53D; }
.ph-card h3 { font-size: 1.3rem; margin: 0 0 8px; color: #28324E; font-family: 'Baloo 2', 'Nunito', sans-serif; }
.ph-card p { color: #3c4660; margin: 0 0 8px; font-size: 1rem; }
.ph-hi { font-weight: 900; padding: 0 4px; border-radius: 4px; background: #FFF3D6; color: #28324E; }

.ph-sim { border-radius: 24px; padding: 20px; margin-bottom: 20px; border: 3px solid #28324E; background: linear-gradient(180deg, #DDEBFF, #F6FAFF); }
.ph-sim.white { background: #fff; border-color: #8D86C9; }
.ph-sim.trick { background: linear-gradient(180deg, #FFF0EA, #F6FAFF); border-color: #FF7A59; }
.ph-sim.pair { background: #fff; border-color: #FFC53D; }
.ph-sim h3 { margin: 0 0 4px; font-size: 1.25rem; font-family: 'Baloo 2', 'Nunito', sans-serif; }
.ph-sim .ph-lead { font-weight: 600; color: #3c4660; margin: 0 0 12px; }

.ph-btn { padding: 12px 20px; border-radius: 16px; font-weight: 900; font-size: 1.05rem; color: #fff; background: #FF7A59; border: 0; cursor: pointer; box-shadow: 0 4px 0 #c9543a; }
.ph-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9543a; }
.ph-btn.ghost { background: #fff; color: #28324E; border: 2px solid #28324E; box-shadow: none; }
.ph-btn.purple { background: #8D86C9; box-shadow: 0 3px 0 #6a64a0; }
.ph-btn.sm { padding: 8px 14px; font-size: .92rem; }
.ph-btn:disabled { opacity: .55; cursor: default; }

.ph-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ph-row .spacer { margin-left: auto; }
.ph-slider-label { display: flex; align-items: center; gap: 8px; font-weight: 700; }

.ph-coops { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.ph-coop { border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px; width: 86px; min-height: 110px; background: #fff; border: 3px solid #8D86C9; transition: all .3s; }
.ph-coop.crowded { background: #FFE3D9; border-color: #FF7A59; transform: scale(1.06); }
.ph-coop .birds { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; min-height: 64px; align-items: flex-end; font-size: 28px; }
.ph-coop.crowded .birds { font-size: 20px; }
.ph-coop .lbl { font-size: .72rem; font-weight: 700; margin-top: 4px; }

.ph-msg { text-align: center; font-weight: 700; font-size: 1.05rem; margin: 6px 0; }
.ph-msg.alert { color: #FF7A59; }
.ph-msg.good { color: #3BB273; }
.ph-msg.bad { color: #E45858; }
.ph-note { text-align: center; font-weight: 600; margin: 4px 0; }
.ph-note small { color: #5b6680; }

.ph-bins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.ph-bin { border-radius: 14px; padding: 8px; text-align: center; min-width: 72px; min-height: 92px; background: #F6FAFF; border: 3px solid #cfd8ea; transition: all .3s; }
.ph-bin.hot { background: #FFE3D9; border-color: #FF7A59; }
.ph-bin.max { background: #FFF3D6; border-color: #FFC53D; }
.ph-bin .bin-lbl { font-size: .7rem; font-weight: 900; color: #8D86C9; margin-bottom: 4px; }
.ph-bin .chip { display: inline-block; border-radius: 8px; padding: 1px 6px; margin: 1px; font-size: .85rem; font-weight: 900; color: #fff; background: #8D86C9; }
.ph-bin.hot .chip { background: #FF7A59; }
.ph-bin .cnt { font-weight: 900; font-size: .95rem; }

.ph-trick-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 12px; }
.ph-trick-type { border-radius: 16px; padding: 10px 14px; text-align: center; background: #fff; border: 3px solid #8D86C9; min-width: 86px; cursor: pointer; font-size: 1.4rem; }
.ph-trick-type.busted { border-color: #E45858; }
.ph-trick-type:disabled { opacity: .6; cursor: default; }
.ph-dots { display: flex; justify-content: center; gap: 3px; margin-top: 5px; }
.ph-dot { width: 10px; height: 10px; border-radius: 50%; background: #e3e9f5; }
.ph-dot.fill { background: #FF7A59; }
.ph-dot.last { background: #E45858; }

.ph-pairbox { border-radius: 16px; padding: 8px; text-align: center; background: #F6FAFF; border: 3px solid #cfd8ea; transition: all .3s; }
.ph-pairbox.half { border-color: #FFC53D; }
.ph-pairbox.full { background: #FFE3D9; border-color: #E45858; }
.ph-pairbox .pair-lbl { font-size: .7rem; font-weight: 900; color: #8D86C9; margin-bottom: 4px; }
.ph-pairnum { width: 44px; height: 44px; border-radius: 12px; font-weight: 900; font-size: 1.1rem; background: #fff; color: #28324E; border: 2.5px solid #28324E; cursor: pointer; margin: 0 3px; }
.ph-pairnum.picked { background: #FF7A59; color: #fff; border-color: #FF7A59; }

.ph-quiz { border-radius: 24px; padding: 20px; margin-bottom: 20px; position: relative; overflow: hidden; background: #fff; border: 3px solid #28324E; }
.ph-quiz.solved { border-color: #3BB273; }
.ph-quiz .qhead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.ph-quiz .qnum { padding: 3px 10px; border-radius: 999px; color: #fff; font-weight: 900; font-size: .88rem; background: #8D86C9; flex-shrink: 0; }
.ph-quiz .qtext { flex: 1; font-weight: 700; font-size: 1.05rem; margin: 0; }
.ph-quiz .qstar { margin-left: auto; font-size: 1.5rem; }
.ph-story-tag { font-size: .75rem; font-weight: 700; color: #8D86C9; margin: 4px 0 0; }
.ph-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (max-width: 560px) { .ph-choices { grid-template-columns: 1fr; } }
.ph-choice { text-align: left; padding: 12px 16px; border-radius: 12px; font-weight: 600; background: #fff; border: 2.5px solid #cfd8ea; color: #28324E; cursor: pointer; transition: all .2s; font-size: .98rem; }
.ph-choice.right { background: #E2F6EB; border-color: #3BB273; }
.ph-choice.wrong { background: #FBE3E3; border-color: #E45858; }
.ph-verdict { font-weight: 700; margin: 0 0 8px; }
.ph-verdict.good { color: #3BB273; }
.ph-verdict.bad { color: #E45858; }
.ph-hint { border-radius: 12px; padding: 8px 12px; font-size: .92rem; font-weight: 600; background: #FFF3D6; border: 2px dashed #FFC53D; margin-bottom: 8px; }
.ph-qlinks { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.ph-qlinks button { background: none; border: 0; font-size: .9rem; font-weight: 900; text-decoration: underline; cursor: pointer; padding: 0; }
.ph-qlinks .hintbtn { color: #c98a00; }
.ph-qlinks .solbtn { color: #8D86C9; }
.ph-sol { margin-top: 12px; border-radius: 16px; padding: 16px; background: #F6FAFF; border: 2px dashed #8D86C9; }
.ph-sol .roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; font-size: .9rem; font-weight: 700; }
@media (max-width: 560px) { .ph-sol .roles { grid-template-columns: 1fr; } }
.ph-sol .roles .pigeons { border-radius: 12px; padding: 8px 12px; background: #FFE9E2; }
.ph-sol .roles .holes { border-radius: 12px; padding: 8px 12px; background: #E8E6F7; }
.ph-sol .step { font-size: .94rem; margin: 0 0 6px; }
.ph-sol .step b.n { color: #FF7A59; }
.ph-sol .ans { font-size: .94rem; font-weight: 900; color: #3BB273; margin: 8px 0 0; }

.ph-lightning { border-radius: 24px; padding: 24px; background: #fff; border: 3px solid #28324E; }
.ph-lightning.center { text-align: center; }
.ph-timerbar { height: 12px; border-radius: 999px; margin-bottom: 16px; overflow: hidden; background: #F6FAFF; border: 2px solid #cfd8ea; }
.ph-timerbar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FFC53D, #FF7A59); transition: width 1s linear; }
.ph-timerbar > div.low { background: #E45858; }
.ph-lr-head { display: flex; justify-content: space-between; font-weight: 900; margin-bottom: 8px; }
.ph-lr-head .low { color: #E45858; }
.ph-recap { border-radius: 16px; padding: 16px; margin-bottom: 12px; background: #fff; border: 3px solid #3BB273; }
.ph-recap.miss { border-color: #E45858; }
.ph-recap p { margin: 0 0 4px; font-size: .95rem; }

.ph-wild { border-radius: 24px; padding: 20px; margin-bottom: 20px; background: #fff; border: 3px solid #3BB273; }
.ph-wild h3 { margin: 0 0 6px; font-size: 1.3rem; }
.ph-wild .skel { font-weight: 900; color: #8D86C9; margin: 12px 0 4px; }
.ph-wild a { display: block; padding: 8px 12px; border-radius: 10px; margin: 4px 0; background: #F6FAFF; border: 2px solid #cfd8ea; color: #28324E; text-decoration: none; font-weight: 600; font-size: .95rem; }
.ph-wild a:hover { border-color: #3BB273; background: #E2F6EB; }

.ph-pagenav { display: flex; justify-content: space-between; margin-top: 8px; }

/* animations */
@keyframes ph-drop { 0% { transform: translateY(-60px) rotate(-20deg); opacity: 0; } 60% { transform: translateY(6px); opacity: 1; } 100% { transform: translateY(0); } }
.ph-drop { animation: ph-drop .5s ease-out; display: inline-block; }
@keyframes ph-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ph-shake { animation: ph-shake .3s ease-in-out; }
@keyframes ph-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ph-pop { animation: ph-pop .25s ease-out; }
@keyframes ph-rise { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(-150px) rotate(45deg); opacity: 0; } }
.ph-confetti { position: absolute; bottom: 0; animation: ph-rise 1.3s ease-out forwards; pointer-events: none; }
@keyframes ph-starpop { 0% { transform: scale(0) rotate(-40deg); } 60% { transform: scale(1.6) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
.ph-starpop { display: inline-block; animation: ph-starpop .55s ease; }
@keyframes ph-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ph-floaty { animation: ph-float 3s ease-in-out infinite; display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .ph-drop, .ph-shake, .ph-pop, .ph-confetti, .ph-starpop, .ph-floaty { animation: none !important; }
  .ph-progress-fill, .ph-progress-bird, .ph-coop, .ph-timerbar > div { transition: none !important; }
}
