/* Case Files look sheet: loads after the inline <style> (and after style/gameplay.css), so on equal specificity this wins.
   What lives here: the transparent screens over the living backdrop (style/scene.css), the desktop column, readable passage and
   question text, the characters in the speech bubbles, the document pictures, the Erie route map, the CASE CLOSED celebration, and
   the feedback classes (.fb-right, .fb-wrong, .word-chip, .tag.stretch). */

/* ---------- screens sit on the scene ---------- */
#screen-case, #screen-closed { background: transparent; }
.topbar h2 { text-shadow: 0 2px 0 rgba(4,9,22,.9), 0 0 14px rgba(4,9,22,.8); }

/* ---------- desktop: the main column in the middle, the scene fills the sides ---------- */
@media (min-width: 1100px) {
  :root { --col: 1040px; }
  .screen { padding-left: max(var(--pad-l), calc((100% - var(--col)) / 2)); padding-right: max(var(--pad-r), calc((100% - var(--col)) / 2)); }
}
@media (min-width: 1100px) and (min-height: 700px) {
  .screen { padding-top: max(var(--pad-t), 18px); padding-bottom: max(var(--pad-b), 22px); }
}

/* ---------- readability: passages and questions at 18-19px, line-height 1.5+, a ~65 character column ---------- */
.para p { font-size: 18px; line-height: 1.7; }
.para { margin-left: auto; margin-right: auto; width: 100%; }
.nb-q { font-size: 18px; line-height: 1.45; }
.nb-hint, .nb-why { font-size: 17px; }
.wordcard .wc-sent { font-size: 18px; line-height: 1.5; }
.wordcard .wc-mean { font-size: 18px; }
.frame { font-size: 18px; line-height: 2; }
.modal-text p { font-size: 19px; }
@media (min-width: 700px) {
  .para p { font-size: 19px; line-height: 1.75; }
  .nb-q { font-size: 19px; }
  .wordcard .wc-sent, .frame { font-size: 19px; }
  .bubble { font-size: 19px; }
}
.doc-text { padding: 16px 16px 22px; }

/* ---------- the cast: portraits in the speech bubbles ---------- */
.bubble { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 14px; font-size: 18px; line-height: 1.5; box-shadow: 0 5px 0 rgba(2,6,16,.5); }
.bubble.chief { background: linear-gradient(170deg, #26426f, #1a3157); }
.bubble.partner { background: linear-gradient(170deg, #14505a, #0f3a46); }
.bubble .who { width: 60px; height: 60px; padding: 0; border: 0; background: none; font-size: 0; color: transparent; filter: drop-shadow(0 3px 0 rgba(0,0,0,.4)); overflow: visible; }
.bubble.partner .who { background: none; }
.bubble .who svg { display: block; width: 100%; height: 100%; }
.bubble .who-name { font-size: 12px; color: #dfe9f7; }
@media (min-width: 700px) { .bubble .who { width: 72px; height: 72px; } }
@media (orientation: landscape) and (max-height: 500px) {
  .bubble { padding: 6px 10px 6px 8px; font-size: 17px; }
  .bubble .who { width: 46px; height: 46px; font-size: 0; }
}
.face { display: block; flex: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.4)); }
.face svg { display: block; width: 100%; height: 100%; }

/* ---------- document pictures ---------- */
.docfolder { padding-right: 88px; min-height: 132px; }
.df-art { position: absolute; right: 10px; top: 14px; width: 66px; height: 66px; transform: rotate(6deg); filter: drop-shadow(0 3px 0 rgba(60,35,8,.35)); pointer-events: none; }
.df-art svg, .dh-art svg { display: block; width: 100%; height: 100%; }
.docfolder:hover .df-art { transform: rotate(2deg) translateY(-2px); }
.df-art { transition: transform .15s; }
.dh-art { flex: none; width: 38px; height: 38px; margin-right: -2px; filter: drop-shadow(0 2px 0 rgba(60,35,8,.3)); }
.doc-head h4 { font-size: 18px; }

/* ---------- the agency home ---------- */
.board-title { flex-wrap: wrap; row-gap: 6px; }
.board-title .team { margin-left: auto; display: inline-flex; align-items: center; }
.board-title .team .face { width: 52px; height: 52px; }
.board-title .team .face + .face { margin-left: -14px; }
.wen-note { display: flex; align-items: center; gap: 14px; max-width: 720px; margin: 0 0 16px; padding: 10px 14px 10px 10px; border-radius: 12px; background: #fff6dc; color: var(--manila-ink); border: 2px solid var(--manila-edge); box-shadow: 0 5px 0 rgba(60,35,8,.4); }
.wen-note .face { width: 68px; height: 68px; }
.wen-note p { margin: 0; font: 400 18px/1.45 var(--font-body); }
.wen-note b { display: block; margin-bottom: 2px; font: 400 12px/1 var(--font-type); letter-spacing: .12em; text-transform: uppercase; color: #7a5410; }
.home-body { box-shadow: 0 8px 0 rgba(2,6,16,.55), 0 18px 40px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,255,255,.06), inset 0 8px 24px rgba(40,20,5,.45); }
.folder, .case-card, .routemap { text-shadow: none; }

/* the Erie route map (src/ui/art/routemap.js) */
.routemap { position: relative; width: 100%; margin: 4px 0 20px; min-height: 210px; border-radius: 10px; box-shadow: 0 6px 0 rgba(60,35,8,.45), 0 14px 22px rgba(40,20,5,.3); transform: rotate(-.35deg); }
.routemap::before { content: ''; position: absolute; left: 50%; top: -9px; width: 18px; height: 18px; margin-left: -9px; z-index: 2; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a8f, var(--string) 55%, #8f1f1a); box-shadow: 0 3px 3px rgba(0,0,0,.4); }
.rm-svg { display: block; max-width: 100%; border-radius: 10px; }
.rm-stop { position: absolute; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
span.rm-stop { cursor: default; }
.rm-stop:not(.sealed):hover { box-shadow: 0 0 0 3px rgba(47,209,192,.45); }
.rm-stop:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.rm-pulse { transform-box: fill-box; transform-origin: center; animation: rmPulse 2.2s ease-out infinite; }
@keyframes rmPulse { 0% { transform: scale(.9); opacity: .95; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.reduced-motion .rm-pulse { animation: none; }
@media (prefers-reduced-motion: reduce) { .rm-pulse { animation: none; } }

/* ---------- the closed screen: stamp, thump, confetti, the reward ---------- */
.closed-body { width: min(100%, 720px); margin: 0 auto; gap: 16px; padding: 12px 4px 18px; }
.closed-body > * { width: 100%; max-width: 680px; }
.closed-hero { display: flex; align-items: center; justify-content: center; gap: 8px; }
.closed-hero .face { width: clamp(64px, 17vw, 120px); height: clamp(64px, 17vw, 120px); }
.closed-hero .f-pip { transform: rotate(-4deg); }
.closed-hero .f-chief { transform: rotate(4deg); }
.stamp-wrap { position: relative; flex: 0 1 auto; display: grid; place-items: center; padding: 14px 8px; }
.big-stamp { font-size: clamp(26px, 7.2vw, 52px); padding: 12px 22px 9px; text-align: center; border-width: 6px; box-shadow: 0 7px 0 rgba(90,60,10,.55), 0 14px 26px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,255,255,.25); }
.big-stamp::before, .big-stamp::after { content: ''; position: absolute; top: 50%; width: .5em; height: .5em; margin-top: -.25em; background: #8a6418; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); opacity: .75; }
.big-stamp::before { left: .22em; } .big-stamp::after { right: .22em; }
.big-stamp.slam { animation: stampSlam .62s cubic-bezier(.2,1.4,.4,1) both; }
.big-stamp.fade { animation: stampFade .5s ease-out both; }
@keyframes stampSlam { 0% { transform: rotate(-14deg) scale(2.8); opacity: 0; } 46% { transform: rotate(-5deg) scale(.9); opacity: 1; } 62% { transform: rotate(-5deg) scale(1.07); } 80% { transform: rotate(-5deg) scale(.985); } 100% { transform: rotate(-5deg) scale(1); opacity: 1; } }
@keyframes stampFade { from { opacity: 0; transform: rotate(-5deg) scale(1); } to { opacity: 1; transform: rotate(-5deg) scale(1); } }
.shock { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; margin: 0; border-radius: 50%; border: 5px solid rgba(255,226,140,.8); opacity: 0; transform: translate(-50%, -50%) scale(.3); pointer-events: none; }
.celebrating .shock { animation: shockRing .75s ease-out .3s both; }
@keyframes shockRing { 0% { opacity: .95; transform: translate(-50%, -50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); } }
.closed-body.celebrating { animation: thump .5s cubic-bezier(.3,0,.2,1) .3s both; }
@keyframes thump { 0%, 100% { transform: translate3d(0, 0, 0); } 14% { transform: translate3d(0, 7px, 0); } 30% { transform: translate3d(-3px, -3px, 0); } 46% { transform: translate3d(3px, 2px, 0); } 64% { transform: translate3d(-1px, -1px, 0); } }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; overflow: hidden; pointer-events: none; }
.confetti > * { opacity: 0; transform-box: fill-box; transform-origin: center; will-change: transform, opacity; animation: confFall var(--d) cubic-bezier(.25,.3,.5,1) var(--dl) both; }
@keyframes confFall { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); } 6% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; transform: translate3d(var(--dx), 108vh, 0) rotate(var(--rot)); } }
.payout { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: auto; max-width: 100%; padding: 12px 24px 10px; border-radius: 999px; background: linear-gradient(#ffe27a, #f0b13b); border: 3px solid #8a6418; color: #4a3000; font: 400 clamp(20px, 5.6vw, 30px)/1.1 var(--font-display); text-align: center; box-shadow: 0 5px 0 #8a6418, 0 12px 22px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.55); text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.payout .pay-coin { flex: none; width: 1.3em; height: 1.3em; }
.payout .pay-coin svg { display: block; width: 100%; height: 100%; }
.celebrating .payout { animation: payPop .6s cubic-bezier(.2,1.5,.4,1) 1.05s both; }
.celebrating .payout .pay-coin { animation: coinSpin 1.4s ease-in-out 1.5s 2; }
@keyframes payPop { 0% { opacity: 0; transform: scale(.4) translateY(14px); } 100% { opacity: 1; transform: none; } }
@keyframes coinSpin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
.calm .payout { animation: stampFade .5s ease-out .4s both; }
.fact-card p { font-size: 18px; }
.teaser { font-size: 17px; background: rgba(4,9,22,.55); }
.see-you { text-shadow: 0 3px 0 #000, 0 0 16px rgba(4,9,22,.9); }
.reduced-motion .big-stamp.slam, .reduced-motion .celebrating, .reduced-motion .celebrating * { animation: none !important; }
.reduced-motion .confetti { display: none; }

/* ---------- feedback classes from the gameplay agent ---------- */
.fb-right { animation: fbGold .95s ease-out; }
@keyframes fbGold { 0% { box-shadow: 0 0 0 0 rgba(255,214,102,.95); background-color: rgba(255,226,122,.95); } 55% { box-shadow: 0 0 0 12px rgba(255,214,102,0); } 100% { box-shadow: 0 0 0 0 rgba(255,214,102,0); } }
.fb-wrong { animation: fbShake .5s ease-in-out, fbSoft 1s ease-out; }
@keyframes fbShake { 0%, 100% { transform: translateX(0); } 18% { transform: translateX(-5px); } 36% { transform: translateX(5px); } 54% { transform: translateX(-3px); } 72% { transform: translateX(2px); } }
@keyframes fbSoft { 0% { box-shadow: 0 0 0 4px rgba(142,176,255,.65); } 100% { box-shadow: 0 0 0 4px rgba(142,176,255,0); } }
.word-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.word-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 0 16px; border-radius: 24px; background: #fbf3dc; color: var(--manila-ink); border: 2px solid var(--manila-edge); font: 700 18px/1.1 var(--font-body); box-shadow: 0 4px 0 var(--manila-edge); transition: transform .06s, box-shadow .06s, background .1s; cursor: pointer; }
.word-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--manila-edge); }
.word-chip[aria-pressed="true"], .word-chip.sel { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge); }
.word-chip.right { background: #ffe27a; border-color: var(--brass-edge); color: var(--brass-ink); box-shadow: 0 4px 0 var(--brass-edge); }
.word-chip[disabled] { opacity: .55; cursor: default; }
/* short landscape phones: the chips are one row that scrolls sideways, so the keyboard keeps its room above the home indicator */
@media (orientation: landscape) and (max-height: 500px) {
  .word-chips { flex-wrap: nowrap; overflow: auto hidden; gap: 6px; margin-bottom: 4px; scrollbar-width: none; touch-action: pan-x; }
  .word-chip { min-height: 44px; min-width: 44px; font-size: 16px; padding: 0 12px; }
}
.tag.stretch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 4px; border-radius: 4px; background: linear-gradient(#ffe27a, #e9ae38); color: var(--brass-ink); border: 1px solid var(--brass-edge); box-shadow: 0 2px 0 var(--brass-edge); font-size: 12px; font-weight: 400; letter-spacing: .06em; }
.tag.stretch::before { content: ''; width: 11px; height: 11px; background: #8a5a0a; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }

/* ---------- small fixes ---------- */
.pl-name { overflow: visible; text-overflow: clip; white-space: normal; text-align: center; line-height: 1.12; }
.pl-tile { height: auto; min-height: 168px; }

/* ---------- titles never cut mid-word with "..." ; headings and notes over the scene stay readable ---------- */
.topbar h2 { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.12; font-size: clamp(17px, 2.6vw, 24px); }
.players-top h2 { display: block; }
.sec-head h3 { padding: 6px 12px 4px; border-radius: 6px; background: rgba(4,9,22,.72); }
.teaser { background: rgba(4,9,22,.82); }
.msg { text-shadow: 0 1px 0 #000, 0 0 10px rgba(4,9,22,.9); }
@media (max-width: 520px) { .topbar h2 { -webkit-line-clamp: 3; font-size: 16px; } .board-title .team .face { width: 42px; height: 42px; } }
@media (orientation: landscape) and (max-height: 500px) { .topbar h2 { -webkit-line-clamp: 3; font-size: 15px; } }
