/* Air Hockey — le jeu est sur canvas, les écrans sont des surcouches. */
:root { --bg: #0d2b40; --panel: rgba(9, 28, 42, .92); --line: rgba(255, 255, 255, .16); --text: #eef5fa; --muted: #9fbacd; --accent: #46c2e8; --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; }
[hidden] { display: none !important; }

#splash { position: fixed; inset: 0; z-index: 50; background: linear-gradient(180deg, #14608c, #0d2b40); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .4s; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-puck { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #565e68, #14181d); box-shadow: 0 10px 24px rgba(0,0,0,.5); animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(-38px); } to { transform: translateX(38px); } }
.splash-title { font-family: ui-monospace, Menlo, monospace; font-size: 26px; letter-spacing: 7px; color: #cfeaf7; }

.screen { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: calc(var(--sat) + 14px) calc(var(--sar) + 14px) calc(var(--sab) + 14px) calc(var(--sal) + 14px); background: rgba(4, 16, 26, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.screen.active { display: flex; }
#screen-title { background: rgba(4, 16, 26, .45); }
.box { width: min(94vw, 400px); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.wide-box { width: min(94vw, 460px); }
h1 { font-size: 30px; letter-spacing: 8px; color: var(--accent); }
h2 { font-size: 20px; letter-spacing: 3px; }
h3 { font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.sub { margin: 0; font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.foot { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.help { font-size: 14px; line-height: 1.6; color: #d6e6f0; text-align: left; margin: 0; }

.btn { padding: 12px 16px; border-radius: 12px; font-weight: 800; font-size: 15px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.16); font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #5fd4f2, #2196c4); color: #04212e; border-color: transparent; }
.btn.big { width: 100%; font-size: 20px; padding: 15px; }
.btn.wide { width: 100%; }
.btn.small { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn.ghost { background: rgba(255,255,255,.05); }
.row-btns { display: flex; gap: 8px; width: 100%; }
.row-btns .btn { flex: 1; min-width: 0; font-size: 12px; padding: 10px 6px; }
#toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 62; max-width: 88vw; text-align: center; background: rgba(6,22,34,.92); border: 1px solid var(--accent); color: var(--text); font-size: 13px; line-height: 1.45; padding: 10px 16px; border-radius: 12px; pointer-events: none; }
.club { margin: -4px 0 2px; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--accent); }
.locked { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.hide { display: none !important; }
.hint { margin: -4px 0 6px; font-size: 11px; line-height: 1.45; color: var(--muted); text-align: center; }
.icon-btn { position: fixed; top: calc(var(--sat) + 10px); right: calc(var(--sar) + 12px); z-index: 12; width: 40px; height: 40px; border-radius: 12px; background: rgba(9,28,42,.65); border: 1px solid var(--line); color: #fff; font-family: ui-monospace, monospace; font-weight: 800; }

.teams-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.tcard { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.tcard b { font-size: 13px; font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.vs { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.score { font-family: ui-monospace, Menlo, monospace; font-size: 34px; margin: 0; letter-spacing: 4px; }
.stats { display: flex; gap: 10px; width: 100%; justify-content: center; font-size: 11px; color: var(--muted); }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats b { color: var(--text); font-size: 15px; font-family: ui-monospace, monospace; }

.tblock { width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; text-align: left; }
.trow { display: flex; gap: 12px; align-items: center; }
.tfields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tfields input[type=text] { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 8px; color: #fff; padding: 9px 10px; font-size: 15px; font-family: ui-monospace, Menlo, monospace; }
canvas.big-logo { width: 88px; height: 88px; flex: 0 0 88px; background: rgba(255,255,255,.07); border-radius: 12px; }
canvas.tlogo { background: rgba(255,255,255,.06); border-radius: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.sw { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; }
.sw.on { border-color: #fff; transform: scale(1.1); }
.frow { display: flex; gap: 8px; flex-wrap: wrap; }
.emblems { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin-top: 10px; }
.emb { background: rgba(255,255,255,.06); border: 2px solid transparent; border-radius: 10px; padding: 5px; display: flex; align-items: center; justify-content: center; }
.emb.on { border-color: var(--accent); background: rgba(70,194,232,.16); }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.srow span { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.chip { background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; }
.chip.on { background: var(--accent); color: #04212e; border-color: var(--accent); }
input[type=checkbox] { width: 44px; height: 26px; appearance: none; background: rgba(255,255,255,.15); border-radius: 999px; position: relative; transition: background .15s; }
input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
input[type=checkbox]:checked { background: var(--accent); }
input[type=checkbox]:checked::after { transform: translateX(18px); }
