.debrief[hidden], .debrief [hidden] { display: none !important; }
.debrief { position: fixed; inset: 0; z-index: 70; overflow: auto; padding: clamp(12px, 3vh, 36px); display: grid; place-items: center; background: #071219ed; color: #f2e5c9; font: calc(16px * var(--debrief-type, 1))/1.4 "Oxanium", "Trebuchet MS", sans-serif; }
.debrief * { box-sizing: border-box; }
.debrief { align-items: safe center; }
.debrief:focus { outline: none; }
.debrief-shell { width: min(1120px, 100%); min-width: 0; display: grid; grid-template-columns: .8fr 1.2fr; overflow: hidden; border: 1px solid #657467; border-radius: 24px; background: linear-gradient(135deg,#1e343a,#0c202b); box-shadow: inset 0 1px 0 #efdfbb55, 0 14px 0 #030c12, 0 28px 70px #0008; }
.debrief-art { background: linear-gradient(0deg,#10212bbb,transparent 60%),url("assets/title-farm-v210.png") left center/cover; min-height: 480px; border-right: 1px solid #67786a55; }
.debrief-art-reward { position:relative; }
.debrief-reward { position:absolute; bottom:24px; left:24px; right:24px; padding:16px 18px; border:1px solid #91b5a373; border-radius:12px; background:linear-gradient(125deg,#173538fa,#0a2028fa); box-shadow:inset 0 1px 0 #d4e5be20,0 8px 24px #0004; }
.debrief-reward-label,.debrief-reward-name,.debrief-reward-count { display:block; }
.debrief-reward-label { color:#b6d2bf; font-size:.65em; line-height:1.3; }
.debrief-reward-name { margin-top:3px; color:#f2e5c9; font-size:1.02em; line-height:1.25; overflow-wrap:anywhere; }
.debrief-reward-count { color:#b8cabe; font-size:.68em; line-height:1.3; font-variant-numeric:tabular-nums; }
.debrief-reward progress { display:block; appearance:none; width:100%; height:5px; margin:10px 0 6px; border:0; border-radius:4px; overflow:hidden; background:#061820; color:#a6cfae; }
.debrief-reward progress::-webkit-progress-bar { background:#061820; }
.debrief-reward progress::-webkit-progress-value { background:linear-gradient(90deg,#6eb6ac,#c4d9a7); border-radius:4px; }
.debrief-reward progress::-moz-progress-bar { background:#a6cfae; border-radius:4px; }
.debrief-victory .debrief-art-reward .debrief-victory-seal { top:48px; bottom:auto; }
.debrief-art-reward .debrief-art-caption { display:none; }
.debrief-content { padding: clamp(20px,3vw,42px); min-width: 0; }
.debrief header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:26px; }
.debrief-eyebrow { color:#abc6b7; font-size:.65em; font-weight:700; letter-spacing:.16em; }
.debrief h1 { font-size:clamp(23px,2.3vw,34px); line-height:1.14; margin:0 0 22px; font-weight:700; }
.debrief-score span { display:block; color:#a9bdb5; font-size:.85em; }
.debrief-score strong { display:block; font-size:clamp(40px,5vw,70px); line-height:1.12; letter-spacing:-.045em; font-weight:750; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.debrief-best { color:#e4c38b; font-size:.85em; margin:6px 0 24px; }
.debrief-stats { display:flex; flex-wrap:wrap; gap:16px 32px; margin:0; padding:18px 0; border-block:1px solid #7a8d7433; }
.debrief-stats dt { color:#a6bbb3; font-size:.72em; }
.debrief-stats dd { margin:2px 0 0; font-size:1.25em; font-weight:700; }
.debrief-tip { color:#cfceba; font-size:.83em; margin:18px 0 22px; max-width:55ch; }
.debrief-actions { display:flex; flex-wrap:wrap; gap:10px; }
.debrief button { min-height:46px; padding:11px 17px; border:1px solid #728777; border-radius:9px; background:linear-gradient(#223b42,#10242e); color:#f0e5ca; font:600 .86em "Oxanium",sans-serif; cursor:pointer; box-shadow:inset 0 1px 0 #ffffff18,0 3px 0 #06141b; }
.debrief .debrief-primary { min-width:140px; color:#102c2b; background:linear-gradient(#c3d7a6,#83b4a4); border-color:#d4dfb2; }
.debrief .debrief-title-action { min-height:44px; padding:8px 10px; font-size:.7em; white-space:nowrap; background:transparent; box-shadow:none; border-color:#687d6e55; }
.debrief button:hover { filter:brightness(1.12); }
.debrief button:disabled { opacity:.6; cursor:default; }
.debrief :focus-visible { outline:3px solid #e8bf76; outline-offset:4px; }
.debrief-details { margin-top:12px; border-top:1px solid #7a8d7433; font-size:.85em; }
.debrief summary { min-height:44px; padding:13px 0; color:#afcbbd; cursor:pointer; }
.debrief-details h2 { font-size:1.05em; margin-bottom:4px; }
.debrief-details .debrief-actions { margin-top:12px; }
.debrief-notice { font-size:.8em; color:#e2c88f; margin:14px 0 0; }
.debrief-notice:empty { display:none; }
.debrief-form { margin-top:18px; display:flex; flex-wrap:wrap; gap:10px; align-items:end; }
.debrief-form label { display:block; flex:1 1 220px; font-size:.85em; }
.debrief-form input { display:block; margin-top:5px; width:100%; min-height:46px; padding:10px; background:#071c25; color:#f3e6c9; border:1px solid #87a48c; border-radius:7px; font:inherit; }
.debrief-share-text { display:block; width:100%; min-height:110px; margin-top:12px; padding:12px; resize:vertical; background:#071c25; color:#f3e6c9; border:1px solid #87a48c; border-radius:7px; font:inherit; font-size:.8em; }
.debrief-victory { background:radial-gradient(ellipse at 25% 35%,#454535,#071219 75%); }
.debrief-victory .debrief-shell { border-color:#b4a16d; background:linear-gradient(135deg,#283c3c,#10252c 65%); box-shadow:inset 0 1px 0 #f3dfad77,0 14px 0 #081419,0 28px 70px #0008; }
.debrief-victory .debrief-art { position:relative; background-image:linear-gradient(0deg,#172b2bf5,transparent 70%),url("assets/title-farm-v210.png"); }
.debrief-victory .debrief-eyebrow { color:#e4c38b; }
.debrief-victory .debrief-score strong { color:#eddbb2; text-shadow:0 3px 0 #07161c; }
.debrief-victory h1 { max-width:13ch; font-size:clamp(30px,3.4vw,46px); }
.debrief-victory .debrief-primary { background:linear-gradient(#efdcaa,#c0a16d); border-color:#f6e4bb; color:#26352c; }
.debrief-victory-seal { position:absolute; left:50%; bottom:68px; transform:translateX(-50%); width:152px; height:152px; border:1px solid #e2c38a; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; background:radial-gradient(circle at 35% 25%,#344c45ee,#11272df2); box-shadow:0 0 0 6px #182d2bb8,0 0 0 7px #b6a07488,0 8px 28px #0007; color:#ead3a0; }
.debrief-victory-seal strong { font-size:60px; line-height:.95; font-weight:700; }
.debrief-victory-seal span { font-size:9px; letter-spacing:.15em; margin-top:9px; }
.debrief-victory-seal .debrief-seal-star { font-size:22px; line-height:1; margin:0 0 4px; }
.debrief-art-caption { position:absolute; bottom:20px; width:100%; margin:0; text-align:center; color:#e6d7b6; font-size:10px; letter-spacing:.12em; }
@media(max-width:760px) { .debrief-shell{grid-template-columns:1fr;max-width:580px}.debrief-art{min-height:125px;max-height:155px;background-position:center 44%;border-right:0;border-bottom:1px solid #657467}.debrief header{margin-bottom:20px}.debrief-content{padding:22px}.debrief-score strong{font-size:clamp(42px,11vw,65px)} }
@media(max-width:400px) and (max-height:650px) { .debrief-art{min-height:75px}.debrief-content{padding:16px}.debrief header{margin-bottom:12px}.debrief h1{font-size:21px;margin-bottom:12px}.debrief-best{margin-bottom:12px}.debrief-stats{padding:10px 0;gap:12px 24px}.debrief-tip{margin:12px 0}.debrief button{padding:10px 12px}.debrief .debrief-primary{min-width:110px} }
@media(max-width:760px) { .debrief-art{background-position:center top} }
@media(max-width:760px) { .debrief-victory .debrief-art{min-height:140px;max-height:140px;background-position:center 20%}.debrief-victory-seal{left:auto;right:16px;bottom:16px;transform:none;width:92px;height:92px}.debrief-victory-seal strong{font-size:36px}.debrief-victory-seal span{font-size:6px;margin-top:5px}.debrief-victory-seal .debrief-seal-star{font-size:14px}.debrief-victory .debrief-art-caption{display:none}.debrief-victory h1{max-width:15ch;font-size:30px} }
@media(max-height:540px) and (min-width:650px) { .debrief{padding:10px}.debrief-shell{grid-template-columns:.48fr 1fr;border-radius:16px}.debrief-art{min-height:330px;max-height:none}.debrief-content{padding:16px 22px}.debrief header{margin-bottom:8px}.debrief h1{font-size:23px;margin-bottom:8px}.debrief-score strong{font-size:42px}.debrief-best{margin-bottom:10px}.debrief-stats{padding:8px 0}.debrief-tip{margin:10px 0}.debrief-details{margin-top:8px} }
@media(max-height:540px) and (min-width:650px) { .debrief-victory .debrief-art{min-height:330px;max-height:none}.debrief-victory h1{font-size:27px;max-width:none}.debrief-victory-seal{width:115px;height:115px;bottom:56px}.debrief-victory-seal strong{font-size:46px}.debrief-victory-seal span{font-size:7px} }
@media(max-width:400px) and (max-height:650px) { .debrief-victory .debrief-art{min-height:75px;max-height:75px}.debrief-victory-seal{width:58px;height:58px;bottom:8px}.debrief-victory-seal strong{font-size:25px}.debrief-victory-seal .debrief-seal-star{display:none}.debrief-victory-seal span{font-size:4px}.debrief-victory h1{font-size:23px} }
@media(max-height:540px) and (min-width:650px) { .debrief-victory .debrief-content{padding:10px 18px}.debrief-victory .debrief-stats{padding:5px 0}.debrief-victory .debrief-best{margin:3px 0 6px}.debrief-victory .debrief-tip{margin:6px 0;font-size:.78em}.debrief-victory .debrief-score strong{font-size:38px} }
@media(max-width:400px) and (max-height:650px) { .debrief-victory{padding:12px}.debrief-victory .debrief-content{padding:12px 16px}.debrief-victory .debrief-tip{display:none} }
@media(max-width:760px) { .debrief-reward{left:12px;right:12px;bottom:10px;padding:10px 14px}.debrief-reward-name{font-size:.9em}.debrief-reward progress{margin:6px 0 4px}.debrief-art-reward .debrief-victory-seal{display:none} }
@media(max-height:540px) and (min-width:650px) { .debrief-reward{left:12px;right:12px;bottom:14px;padding:12px}.debrief-reward-name{font-size:.88em}.debrief-victory .debrief-art-reward .debrief-victory-seal{top:32px;bottom:auto} }
@media(max-width:400px) and (max-height:650px) { .debrief-reward{bottom:4px;left:8px;right:8px;padding:5px 10px;border-radius:8px}.debrief-reward-label{font-size:.55em}.debrief-reward-name{font-size:.8em;margin-top:1px}.debrief-reward-count{font-size:.55em}.debrief-reward progress{height:3px;margin:4px 0 3px} }
@media(max-height:540px) and (min-width:650px) { .debrief-art-reward{height:calc(100dvh - 22px);min-height:0!important}.debrief-content{padding:12px 20px}.debrief header{margin-bottom:6px}.debrief-best{margin-bottom:6px}.debrief-stats dd{line-height:1.2}.debrief-tip{margin:8px 0} }
@media(max-width:400px) and (max-height:650px) { .debrief header{justify-content:flex-end}.debrief-eyebrow{display:none}.debrief-reward-complete .debrief-reward-label{display:none} }

/* Busted: a story scene and a short score receipt, not a wall of statistics. */
.debrief-defeat { background: radial-gradient(ellipse at 18% 60%, #284a4e88, transparent 58%), radial-gradient(ellipse at 90% 20%, #67432650, transparent 55%), #080f18f7; }
.debrief-defeat .debrief-shell { max-width:1180px; grid-template-columns:1.08fr 1fr; border-color:#92866b80; border-radius:22px; background:linear-gradient(125deg,#213641,#10202b 75%); box-shadow:0 24px 80px #0009,inset 0 1px 0 #ecdabb40; }
.debrief-defeat .debrief-art { position:relative; isolation:isolate; min-height:610px; height:auto; max-height:none; overflow:hidden; border-color:#a3977940; background:#091825; }
.debrief-scene { position:absolute; left:0; top:50%; width:100%; height:auto; transform:translateY(-35%); mask-image:linear-gradient(transparent,#000 12%,#000 88%,transparent); z-index:-2; }
.debrief-defeat .debrief-art::after { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background:linear-gradient(#06121be8,transparent 33%,transparent 70%,#071620f0); }
.debrief-scene-title { position:relative; padding:26px 28px; text-align:center; text-shadow:0 4px 0 #182026,0 8px 25px #0008; }
.debrief-defeat h1 { color:#f4c38c; font-size:clamp(56px,6.5vw,90px); font-weight:800; letter-spacing:-.045em; line-height:1; transform:rotate(-3deg); margin:0 0 12px; }
.debrief-scene-title p { margin:0; color:#f3e4c5; font-weight:550; font-size:.85em; }
.debrief-defeat .debrief-content { display:flex; flex-direction:column; justify-content:center; padding:30px 34px; }
.debrief-defeat header { margin:0 0 26px; gap:10px; }
.debrief-defeat .debrief-eyebrow { color:#b3c1bc; font-size:.61em; letter-spacing:.12em; }
.debrief-defeat .debrief-title-action { border-color:#89998a55; color:#d1d7c9; }
.debrief-defeat .debrief-score span { text-transform:uppercase; font-size:.7em; letter-spacing:.13em; color:#c5c8b5; }
.debrief-defeat .debrief-score strong { font-size:clamp(42px,5.4vw,72px); color:#fae4b6; letter-spacing:-.05em; text-shadow:0 3px 0 #05101c; }
.debrief-defeat .debrief-best { font-size:.75em; margin:8px 0 24px; align-self:flex-start; }
.debrief-defeat .debrief-new-best { border:1px solid #dab97666; background:#b78d3c15; border-radius:5px; padding:4px 8px; font-weight:650; letter-spacing:.03em; }
.debrief-defeat .debrief-stats { justify-content:space-between; gap:12px; padding:14px 0; }
.debrief-form { padding:16px 0; margin:8px 0 0; gap:10px; }
.debrief-form label { flex:1 1 160px; color:#dce1d3; font-size:.78em; font-weight:600; }
.debrief-form input { min-height:48px; font-size:18px; padding:11px 12px; border-color:#92b5a38c; background:#081722; border-radius:8px; }
.debrief-form input::placeholder { color:#81958f; }
.debrief-form input[readonly] { color:#c4d8af; border-color:#79937766; }
.debrief-form button { min-height:48px; padding-inline:12px; font-size:.78em; border-color:#9eba9777; }
.debrief-form-hint { flex-basis:100%; color:#a8b9b2; font-size:.67em; font-weight:400; margin:0; line-height:1.35; }
.debrief-defeat .debrief-content > .debrief-actions { margin-top:12px; }
.debrief-defeat .debrief-primary { width:100%; min-height:56px; font-size:1.06em; font-weight:750; border-radius:10px; background:linear-gradient(#dfdba6,#9fc2a3); box-shadow:inset 0 1px 0 #fff7,0 4px 0 #061621; }
.debrief button { transition:filter .15s,transform .15s; }
.debrief button:not(:disabled):hover { filter:brightness(1.13); transform:translateY(-1px); }
.debrief button:not(:disabled):active { transform:translateY(1px); }
.debrief-defeat .debrief-details { margin-top:18px; }
.debrief-defeat .debrief-details summary { font-size:.88em; }
.debrief-defeat .debrief-reward { bottom:20px; left:20px; right:20px; padding:12px 16px; background:#0b202ce8; border-color:#b0a98960; }
.debrief-defeat .debrief-notice { margin:0 0 10px; line-height:1.4; }
.debrief-defeat .debrief-tip { text-transform:none; font-size:.85em; margin:12px 0; }
.debrief-cause { color:#e2c3a8; font-size:.8em; line-height:1.35; margin:10px 0 0; }
.debrief-defeat .debrief-details .debrief-reward { position:static; margin:16px 0; }
@media(min-width:761px) and (min-height:700px) {
  .debrief-defeat:not(.debrief-quiet) .debrief-shell { animation:debrief-arrive .4s ease-out both; }
}
@keyframes debrief-arrive { from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none} }
@media(max-width:760px) {
  .debrief-defeat { padding:12px; }
  .debrief-defeat .debrief-shell { grid-template-columns:1fr; max-width:540px; }
  .debrief-defeat .debrief-art { min-height:230px; border-right:0; border-bottom:1px solid #a3977940; }
  .debrief-defeat .debrief-scene { object-fit:cover; object-position:50% 58%; }
  .debrief-scene-title { padding:12px 18px; text-align:left; }
  .debrief-defeat h1 { font-size:48px; margin-bottom:8px; }
  .debrief-scene-title p { font-size:.7em; }
  .debrief-defeat .debrief-reward { position:relative; margin:230px 12px 12px; inset:auto; padding:9px 12px; }
  .debrief-defeat .debrief-content { padding:18px 20px; }
  .debrief-defeat header { margin-bottom:12px; }
  .debrief-defeat .debrief-score strong { font-size:clamp(40px,11vw,58px); }
  .debrief-defeat .debrief-best { margin:6px 0 12px; }
  .debrief-defeat .debrief-stats { padding:10px 0; }
  .debrief-defeat .debrief-details { margin-top:12px; }
}
@media(max-height:540px) and (min-width:650px) {
  .debrief-defeat { padding:10px; }
  .debrief-defeat .debrief-shell { grid-template-columns:.9fr 1.1fr; }
  .debrief-defeat .debrief-art { min-height:360px!important; height:auto; border-right:1px solid #a3977940; border-bottom:0; }
  .debrief-defeat .debrief-content { position:relative; padding:12px 20px; }
  .debrief-defeat header { position:absolute; top:12px; right:20px; margin:0; }
  .debrief-defeat header .debrief-eyebrow { display:none; }
  .debrief-defeat .debrief-score { padding-right:94px; }
  .debrief-defeat .debrief-scene { object-fit:contain; object-position:50% 75%; }
  .debrief-defeat h1 { font-size:54px; }
  .debrief-scene-title { padding:20px 16px; text-align:center; }
  .debrief-defeat .debrief-score strong { font-size:36px; }
  .debrief-defeat .debrief-best { margin:4px 0 6px; }
  .debrief-defeat .debrief-stats { padding:7px 0; }
  .debrief-defeat .debrief-stats dd { font-size:1.05em; }
  .debrief-defeat .debrief-cause { margin:5px 0 0; }
  .debrief-defeat .debrief-form { padding:9px 0 6px; margin:0; gap:5px 8px; }
  .debrief-defeat .debrief-form input,.debrief-defeat .debrief-form button { min-height:44px; }
  .debrief-defeat .debrief-form input { padding:9px; }
  .debrief-defeat .debrief-primary { min-height:46px; }
  .debrief-defeat .debrief-content > .debrief-actions { margin-top:8px; }
  .debrief-defeat .debrief-details { margin-top:8px; }
  .debrief-defeat .debrief-details summary { padding:10px 0; }
  .debrief-defeat .debrief-reward { position:absolute; margin:0; bottom:12px; left:12px; right:12px; padding:10px 12px; }
}
@media(prefers-reduced-motion:reduce) { .debrief .debrief-shell { animation:none!important; }.debrief button{transition:none!important;} }
.debrief-quiet button { transition:none; }
/* Short portrait phones (iPhone SE class): keep Fly again on screen without scrolling. */
@media(max-width:420px) and (max-height:700px) {
  .debrief-defeat { padding:8px; }
  .debrief-defeat .debrief-art { min-height:84px; max-height:84px; }
  .debrief-defeat .debrief-scene { object-position:50% 62%; }
  .debrief-scene-title { padding:8px 14px; }
  .debrief-defeat h1 { font-size:30px; margin-bottom:0; }
  .debrief-scene-title p { display:none; }
  .debrief-defeat .debrief-content { padding:10px 16px; }
  .debrief-defeat header { margin-bottom:6px; }
  .debrief-defeat .debrief-score strong { font-size:40px; }
  .debrief-defeat .debrief-best { margin:2px 0 6px; }
  .debrief-defeat .debrief-stats { padding:6px 0; }
  .debrief-defeat .debrief-form-hint { display:none; }
  .debrief-defeat .debrief-details { margin-top:6px; }
}
