:root {
  --bg: #130d33;
  --card: rgba(24, 18, 60, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f2f0ff;
  --muted: #a7a0d0;
  --accent: #ffcc33;
  --accent2: #ff5fa2;
  --good: #3dff9a;
  --bad: #ff3b4f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: 'Fredoka', system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- boutons ---------- */
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-size: 1rem; font-weight: 700; cursor: pointer;
  background: #2d2566; color: var(--text); box-shadow: 0 4px 0 #191340; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #191340; }
.btn.primary { background: var(--accent); color: #2a1a00; box-shadow: 0 4px 0 #b88a00; }
.btn.danger { background: #5a1a2a; box-shadow: 0 4px 0 #300c16; }
.btn.small { padding: 8px 12px; font-size: 0.85rem; }
.btn.on { background: var(--good); color: #003320; box-shadow: 0 4px 0 #0a8a50; }

/* ---------- écrans ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px; z-index: 20; }
.screen.modal { background: rgba(8, 5, 25, 0.6); backdrop-filter: blur(3px); }
#home { background: radial-gradient(ellipse at 30% 20%, rgba(255, 95, 162, .18), transparent 60%), radial-gradient(ellipse at 80% 80%, rgba(63, 167, 255, .2), transparent 55%), rgba(10, 7, 30, .55); flex-wrap: wrap; overflow-y: auto; }
.home-card, .help-card, .results-card { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5); max-width: 460px; width: 100%; }
.home-side { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 22px; width: 300px; max-width: 100%; align-self: center; }
.home-side h3 { margin: 0 0 8px; color: var(--accent); }
.logo { text-align: center; margin-bottom: 8px; }
.logo-top { font-size: 3.2rem; font-weight: 700; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #ffcc33 55%, #ff8a3d 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #6b2a00); transform: rotate(-2deg); }
.logo-top span { color: #ff5fa2; -webkit-text-fill-color: #ff5fa2; }
.logo-sub { display: inline-block; margin-top: 6px; background: var(--accent2); color: #fff; padding: 3px 14px; border-radius: 99px; font-weight: 700; transform: rotate(2deg); letter-spacing: 1px; }
.pitch { color: var(--muted); text-align: center; line-height: 1.4; }
.pitch b { color: var(--text); }
.field { display: block; margin: 14px 0; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
input { font-family: inherit; font-size: 1.05rem; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--line); background: #0f0b2a; color: var(--text); width: 100%; outline: none; -webkit-user-select: text; user-select: text; }
input:focus { border-color: var(--accent); }
.suits { display: flex; gap: 10px; flex-wrap: wrap; }
.suit { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; position: relative; box-shadow: inset 0 -5px 0 rgba(0,0,0,.25); }
.suit.sel { border-color: #fff; transform: scale(1.1); }
.suit.taken { opacity: .25; cursor: not-allowed; }
.suits.small .suit { width: 28px; height: 28px; }
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
.join-row { display: flex; gap: 10px; margin-top: 12px; }
.join-row input { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 700; }
.join-row .btn { flex: 0 0 auto; }
.error { color: var(--bad); min-height: 1.2em; margin-top: 8px; text-align: center; }
.hint { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.scores { margin: 0; padding-left: 22px; }
.scores li { margin: 5px 0; line-height: 1.25; }
.scores li .s { color: var(--accent); font-weight: 700; }
.scores li .st { color: var(--accent); letter-spacing: -2px; }
.scores li .tm { color: var(--muted); font-size: .85rem; display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 16px; z-index: 5; pointer-events: none; }
#hud > div { background: rgba(14, 10, 40, .78); border: 1px solid var(--line); border-radius: 18px; padding: 8px 16px; min-width: 150px; }
.hud-center { text-align: center; }
.hud-right { text-align: right; pointer-events: auto; }
.label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.big { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.timer { font-size: 2.3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.stars-bar { position: relative; height: 12px; background: rgba(255,255,255,.1); border-radius: 99px; margin: 8px 0 6px; width: 170px; }
#starsFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ffcc33, #ff8a3d); border-radius: 99px; transition: width .3s; }
.star-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 20px; color: #3a3360; text-shadow: 0 0 2px #000; }
.star-mark.got { color: var(--accent); text-shadow: 0 0 8px var(--accent); }
.hud-buttons { margin-top: 6px; display: flex; gap: 6px; justify-content: flex-end; }
.hud-buttons button { background: #2d2566; color: var(--text); border: 0; border-radius: 10px; width: 32px; height: 28px; cursor: pointer; font-size: .95rem; }
.hud-buttons button.off { opacity: .4; }

#ticker { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(14,10,40,.88); border: 1px solid var(--line); border-radius: 99px; padding: 8px 18px 8px 8px; z-index: 6; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); animation: tickIn .4s ease-out; }
@keyframes tickIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.pa-tag { background: var(--accent); color: #2a1a00; font-weight: 700; padding: 3px 10px; border-radius: 99px; font-size: .75rem; white-space: nowrap; }
#tickerText { font-size: .95rem; }

#toasts { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(14,10,40,.92); border: 2px solid var(--line); padding: 8px 18px; border-radius: 99px; font-weight: 700; animation: toastIn .3s ease-out; }
.toast.good { border-color: var(--good); color: var(--good); }
.toast.bad { border-color: var(--bad); color: #ff8a96; }
.toast.info { border-color: var(--accent); color: var(--accent); }
@keyframes toastIn { from { transform: scale(.6); opacity: 0; } }

#countdown { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 8; pointer-events: none;
  font-size: 9rem; font-weight: 700; color: var(--accent); text-shadow: 0 8px 0 #6b2a00, 0 0 40px rgba(255,204,51,.6); }
#countdown.go { font-size: 6rem; color: #fff; text-shadow: 0 8px 0 #c2456b, 0 0 40px rgba(255,95,162,.8); }
#countdown span { animation: pop .5s ease-out; display: inline-block; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } }

#roomTag { position: fixed; bottom: 14px; left: 14px; z-index: 5; background: rgba(14,10,40,.78); padding: 6px 12px; border-radius: 12px; font-size: .85rem; color: var(--muted); }
#roomTag b { color: var(--accent); letter-spacing: 2px; }

/* ---------- salon ---------- */
.panel { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); width: 280px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; z-index: 10; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.panel-title { font-size: 1.2rem; font-weight: 700; }
.code { color: var(--accent); letter-spacing: 4px; font-size: 1.6rem; }
.players { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); padding: 7px 10px; border-radius: 12px; }
.players .dot { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; }
.players .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .tag { font-size: .7rem; background: var(--accent); color: #2a1a00; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.players .rd { color: var(--good); font-weight: 700; }
.lobby-suits-label { font-size: .8rem; color: var(--muted); }

/* ---------- résultats ---------- */
.results-card { max-width: 560px; text-align: center; max-height: calc(100vh - 32px); overflow-y: auto; }
.res-title { font-size: 2rem; font-weight: 700; }
.res-stars { font-size: 4rem; letter-spacing: 6px; margin: 4px 0; }
.res-stars span { color: #3a3360; display: inline-block; }
.res-stars span.got { color: var(--accent); text-shadow: 0 0 20px rgba(255,204,51,.7); animation: starPop .5s ease-out backwards; }
.res-stars span.got:nth-child(2) { animation-delay: .35s; }
.res-stars span.got:nth-child(3) { animation-delay: .7s; }
@keyframes starPop { from { transform: scale(3) rotate(-40deg); opacity: 0; } }
.res-score { font-size: 2.6rem; font-weight: 700; color: var(--accent); }
.res-rank { color: var(--accent2); font-weight: 700; min-height: 1.2em; }
.res-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; margin: 14px 0; text-align: left; }
.res-stats div { background: rgba(255,255,255,.05); border-radius: 10px; padding: 6px 10px; font-size: .9rem; display: flex; justify-content: space-between; gap: 8px; }
.res-stats b { color: var(--text); }
.res-titles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.res-titles .tt { background: rgba(255,255,255,.06); border-radius: 14px; padding: 8px 12px; min-width: 140px; border-top: 4px solid; }
.res-titles .tt .n { font-weight: 700; }
.res-titles .tt .ti { color: var(--accent); font-size: .9rem; }
.res-titles .tt .de { color: var(--muted); font-size: .75rem; }
.res-cols { text-align: left; }
.res-cols h4 { margin: 8px 0 4px; color: var(--accent); }

/* ---------- aide ---------- */
.help-card { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.help-card.center { text-align: center; }
.help-card h2 { margin-top: 0; color: var(--accent); }
.steps li { margin: 6px 0; line-height: 1.35; }
.keys { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.keys td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.keys td:first-child { color: var(--muted); }
kbd { background: #2d2566; border-radius: 6px; padding: 2px 7px; font-family: inherit; font-weight: 700; box-shadow: 0 2px 0 #191340; }
.quick-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; }
.quick-list span { background: rgba(255,255,255,.06); padding: 4px 10px; border-radius: 99px; }

/* ---------- tactile ---------- */
#touch { display: none; }
#touch.show { display: block; }
#touch .stick { position: fixed; left: 24px; bottom: 24px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); z-index: 9; }
#touch .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,204,51,.7); }
#touch .tbtns { position: fixed; right: 18px; bottom: 18px; display: grid; grid-template-columns: repeat(2, 72px); gap: 10px; z-index: 9; }
#touch .tb { width: 72px; height: 72px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(45,37,102,.75); color: #fff; font-weight: 700; font-size: .8rem; }
#touch .tb.on { background: var(--accent); color: #2a1a00; }
#touch .tb.big { background: rgba(255,204,51,.8); color: #2a1a00; }

@media (max-width: 760px) {
  #hud { padding: 6px; }
  #hud > div { min-width: 0; padding: 5px 9px; border-radius: 12px; }
  .big { font-size: 1.15rem; }
  .timer { font-size: 1.5rem; }
  .stars-bar { width: 90px; }
  #phaseName { display: none; }
  .panel { left: 8px; right: 8px; top: auto; bottom: 8px; transform: none; width: auto; max-height: 55vh; overflow-y: auto; }
  .logo-top { font-size: 2.4rem; }
  #toasts { top: 70px; }
}

#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  body.ingame #rotate { display: flex; position: fixed; inset: 0; z-index: 30; background: rgba(10,7,30,.94); flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
  #rotate div { font-size: 4rem; }
}

/* =================================================================== v2 */
.quotas { display: flex; gap: 14px; justify-content: flex-end; }
.quotas .big.done { color: var(--good); }
.help-card h3 { margin: 14px 0 2px; color: var(--accent2); font-size: 1.05rem; }
.lobby-map { background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 10px; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; }
.lm-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.lm-btns .btn { flex: 1; padding: 6px 6px; font-size: .78rem; }
.scores li.map-h { list-style: none; margin: 10px 0 2px -18px; color: var(--accent2); font-weight: 700; }
.scores li.map-h:first-child { margin-top: 0; }

#alerts { position: fixed; top: 112px; left: 16px; z-index: 6; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
#alerts .al { background: rgba(60,10,20,.88); border: 2px solid var(--bad); color: #ffb0b8; padding: 5px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; animation: alPulse 1s infinite alternate; }
#alerts .al.crit { background: #ff3b4f; color: #fff; font-size: 1rem; }
@keyframes alPulse { to { filter: brightness(1.35); } }

/* ---------- guichet (Papers Please) ---------- */
#desk, #task { z-index: 25; }
.desk-card { position: relative; background: #2b2420; border: 3px solid #5a4636; border-radius: 18px; width: min(1060px, 100%); max-height: calc(100vh - 24px); overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); color: #2a1f16; font-family: 'Fredoka', sans-serif; }
.desk-head { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #3a2f28; color: #f1e3c8; border-bottom: 3px solid #5a4636; }
.desk-head > div:first-child { flex: 1; letter-spacing: 1px; }
.desk-date { background: #1d1814; padding: 4px 12px; border-radius: 8px; color: #9fffb0; font-family: monospace; }
.desk-x { background: #5a1a2a; color: #fff; border: 0; border-radius: 10px; width: 34px; height: 30px; font-size: 1rem; cursor: pointer; }
.desk-grid { display: grid; grid-template-columns: 1fr 1.25fr 1.15fr; gap: 12px; padding: 12px; }
.desk-col { background: #3d342d; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.desk-col h4 { margin: 0; color: #f1e3c8; font-size: .8rem; text-transform: uppercase; letter-spacing: 2px; }
.mono { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: 1px; }
.box3d { position: relative; height: 110px; background: #c9955b; border-radius: 8px; box-shadow: inset 0 -30px 0 #a87640; display: flex; align-items: center; justify-content: center; }
.box-top { position: absolute; left: 46%; top: 0; bottom: 0; width: 8%; background: rgba(255,240,200,.45); }
.box-label { position: relative; background: #f6f1e4; padding: 8px 14px; border-radius: 4px; text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.25); transform: rotate(-2deg); }
.lbl-t { font-size: .7rem; letter-spacing: 3px; color: #7a6650; }
.big-seal { font-size: 1.35rem; color: #1a1410; }
.scale { display: flex; justify-content: space-between; align-items: center; background: #1d1814; color: #9fffb0; border-radius: 8px; padding: 8px 12px; }
.scale b { font-size: 1.3rem; }
.scanner { position: relative; background: #062012; border: 3px solid #1d5a35; border-radius: 10px; height: 130px; overflow: hidden; text-align: center; }
.scan-t { font-size: .65rem; letter-spacing: 2px; color: #4dff9a; padding-top: 4px; }
.scan-img { font-size: 4.2rem; line-height: 1.4; filter: grayscale(1) brightness(1.6) sepia(1) hue-rotate(80deg) saturate(3); display: inline-block; }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: rgba(77,255,154,.6); box-shadow: 0 0 10px #4dff9a; animation: scan 2s linear infinite; }
@keyframes scan { from { top: 0; } to { top: 100%; } }
.paper { background: #efe6d2; border-radius: 6px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.paper-t, .permit-t { font-weight: 700; letter-spacing: 2px; font-size: .8rem; color: #6b4a2a; border-bottom: 2px dashed #b8a27f; padding-bottom: 4px; margin-bottom: 4px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(0,0,0,.08); font-size: .92rem; }
.row span { color: #7a6650; }
.row b { text-align: right; }
.cat-danger { color: #c0261b; } .cat-vivant { color: #1d7a35; }
.permit { background: #cfe2ff; border-radius: 6px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); border-left: 8px solid #3f6fd6; }
.permit-t { color: #1f3f8a; border-color: #8aa6d8; }
.holo { color: #ff5fa2; text-shadow: 0 0 6px #fff; }
.no-permit { color: #c9b9a0; font-style: italic; text-align: center; padding: 10px; border: 2px dashed #5a4a3d; border-radius: 8px; }
.rules { color: #f1e3c8; font-size: .88rem; }
.rules ol { margin: 0; padding-left: 20px; }
.rules li { margin: 4px 0; line-height: 1.3; }
.dir-t { font-weight: 700; color: var(--accent); letter-spacing: 1px; font-size: .8rem; text-transform: uppercase; }
.dirs { margin: 0; padding-left: 18px; }
.dirs li.new { color: #fff; }
.nb { background: var(--accent2); color: #fff; font-size: .65rem; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.tip { color: #a99a84; font-size: .75rem; margin: auto 0 0; }
[data-k] { cursor: help; border-radius: 4px; transition: background .1s, box-shadow .1s; }
[data-k].hl { background: #ffe066 !important; color: #1a1410 !important; box-shadow: 0 0 0 3px #ffe066; filter: none; }
.scan-img.hl { filter: none; }
.desk-foot { display: flex; gap: 20px; justify-content: center; padding: 6px 12px 16px; }
.stampbtn { border: 0; border-radius: 16px; padding: 10px 34px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; transition: transform .08s; }
.stampbtn span { font-size: 1.6rem; font-weight: 700; letter-spacing: 3px; }
.stampbtn small { font-size: .7rem; opacity: .8; }
.stampbtn.visa { background: #17b864; color: #fff; box-shadow: 0 5px 0 #0b6b39; }
.stampbtn.refuse { background: #e02a3e; color: #fff; box-shadow: 0 5px 0 #7d1220; }
.stampbtn:active { transform: translateY(4px); box-shadow: none; }
.desk-motifs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding: 6px 12px 16px; }
.m-t { color: #f1e3c8; font-weight: 700; width: 100%; text-align: center; }
.desk-motifs .motif { background: #7d1220; box-shadow: 0 4px 0 #3d0810; }
.desk-verdict { position: absolute; inset: 0; background: rgba(20,14,10,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; text-align: center; padding: 20px; cursor: pointer; }
.big-stamp { font-size: 5rem; font-weight: 700; letter-spacing: 8px; border: 10px solid; border-radius: 20px; padding: 0 30px; transform: rotate(-8deg); animation: stampIn .25s ease-out; }
.big-stamp.visa { color: #2ee87e; } .big-stamp.refuse { color: #ff4256; }
@keyframes stampIn { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } }
.v-msg { font-size: 1.15rem; max-width: 640px; }
.desk-verdict.bad .v-msg b { color: #ff6b7a; font-size: 1.4rem; }
.v-pts { font-size: 1.6rem; font-weight: 700; }
.desk-verdict.good .v-pts { color: var(--good); } .desk-verdict.bad .v-pts { color: var(--bad); } .desk-verdict.meh .v-pts { color: var(--accent); }
.v-next { color: #d8cbb5; }

/* ---------- mini-jeux de réparation ---------- */
.task-card { background: #1b1f36; border: 3px solid #3a4270; border-radius: 20px; width: min(440px, 100%); padding: 14px 16px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); position: relative; }
.task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-head b { font-size: 1.3rem; color: var(--accent); }
.task-m { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.task-help { color: var(--muted); margin: 6px 0 12px; font-size: .92rem; }
.task-help b { color: #ff8a96; }
.task-area { display: flex; flex-direction: column; gap: 12px; align-items: stretch; touch-action: none; }
.task-ok { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,40,25,.85); color: var(--good); font-size: 2.6rem; font-weight: 700; border-radius: 18px; animation: pop .3s ease-out; }
.big-btn { font-size: 1.2rem; padding: 14px; }
svg.wires { width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.debris-frame { position: relative; height: 240px; border: 4px dashed #ffcc33; border-radius: 14px; background: repeating-linear-gradient(90deg, #23283a 0 24px, #1a1d2b 24px 48px); }
.debris { position: absolute; font-size: 2.6rem; cursor: grab; user-select: none; touch-action: none; transition: opacity .25s; z-index: 2; }
.debris.grab { cursor: grabbing; z-index: 3; filter: drop-shadow(0 6px 4px rgba(0,0,0,.5)); }
.debris.gone { opacity: 0; }
.dial { position: relative; height: 34px; background: #0f1226; border-radius: 10px; border: 3px solid #2d3360; overflow: hidden; }
.dial.active { border-color: var(--accent); }
.dial.ok { border-color: var(--good); }
.dial.miss { animation: shake .3s; border-color: var(--bad); }
.dial-zone { position: absolute; top: 0; bottom: 0; background: rgba(61,255,154,.45); }
.dial.ok .dial-zone { background: var(--good); }
.dial-cur { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; background: #fff; box-shadow: 0 0 8px #fff; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.gauge-wrap { display: flex; gap: 18px; align-items: stretch; }
.gauge { position: relative; width: 90px; height: 240px; background: #0f1226; border: 4px solid #2d3360; border-radius: 16px; overflow: hidden; }
.gauge-band { position: absolute; left: 0; right: 0; background: rgba(61,255,154,.3); border-top: 2px solid var(--good); border-bottom: 2px solid var(--good); z-index: 2; }
.gauge-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #4b1fb0, #8d66ff); }
.gauge-fill.in { background: linear-gradient(0deg, #0a8a50, #3dff9a); }
.gauge-side { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.gauge-msg { font-size: 1.1rem; font-weight: 700; text-align: center; }
.switches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sw { position: relative; height: 92px; border-radius: 12px; border: 3px solid #3a4270; background: #2a0f18; color: #ff8a96; cursor: pointer; font-family: inherit; }
.sw .sw-knob { position: absolute; left: 50%; width: 30px; height: 30px; margin-left: -15px; top: 48px; background: #c5cbe0; border-radius: 8px; transition: top .12s; }
.sw em { position: absolute; top: 8px; left: 0; right: 0; font-style: normal; font-weight: 700; }
.sw.on { background: #0d2a1c; color: var(--good); border-color: var(--good); }
.sw.on .sw-knob { top: 34px; background: var(--good); }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.keypad.miss { animation: shake .3s; }
.kp { height: 64px; border-radius: 12px; border: 0; background: #2d2566; color: #fff; font-size: 1.5rem; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 4px 0 #191340; }
.kp.ok { background: var(--good); color: #003320; box-shadow: 0 4px 0 #0a8a50; }

@media (max-width: 860px) {
  .desk-grid { grid-template-columns: 1fr 1fr; }
  .desk-col.rules { grid-column: 1 / -1; }
  #alerts { top: 70px; left: 8px; }
  #alerts .al { font-size: .72rem; padding: 3px 8px; }
  .quotas { gap: 8px; }
}
@media (max-width: 560px) {
  .desk-grid { grid-template-columns: 1fr; }
  .big-stamp { font-size: 3rem; }
}
.desk-foot, .desk-motifs { position: sticky; bottom: 0; background: #2b2420; z-index: 2; }
@media (max-height: 520px) {
  .desk-grid { gap: 8px; padding: 8px; }
  .box3d { height: 70px; }
  .scanner { height: 90px; }
  .scan-img { font-size: 2.6rem; }
  .desk-foot { padding: 6px; }
  .stampbtn { padding: 6px 24px; }
  .stampbtn span { font-size: 1.2rem; }
  .task-card { padding: 10px 12px; }
  .debris-frame { height: 170px; }
  .gauge { height: 170px; }
  .kp { height: 46px; }
}
