/* Fonts (SIL Open Font License, see /assets/CREDITS.md). Anybody's + is tiny: Rubik draws that one. */
@font-face { font-family: 'Anybody'; src: url('/assets/fonts/anybody.woff2') format('woff2'); font-weight: 100 900; font-stretch: 50% 150%; font-style: normal; font-display: swap; unicode-range: U+0000-002A, U+002C-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anybody'; src: url('/assets/fonts/anybody-italic.woff2') format('woff2'); font-weight: 100 900; font-stretch: 50% 150%; font-style: italic; font-display: swap; unicode-range: U+0000-002A, U+002C-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; src: url('/assets/fonts/rubik.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
/* Fraunces: the signs painted in the 3D world (place.js, garden.js), and the federation on the licence card. */
@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces.woff2') format('woff2'); font-weight: 500 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/assets/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 500 900; font-style: italic; font-display: swap; }

/* Riviera sport: night-blue plates with a hard shadow under them, pastis yellow, tomato red, cream ink,
   slanted like a sports broadcast, a striped café awning on top of the panels. */
:root {
  --night: #0a1130;
  --navy: #121b46;
  --navy-2: #1a2760;
  --navy-3: #24357c;
  --plate: rgba(10, 17, 48, 0.86);
  --well: rgba(5, 10, 31, 0.5);
  --ink: #fff4de;
  --ink-2: rgba(255, 244, 222, 0.74);
  --ink-3: rgba(255, 244, 222, 0.5);
  --line: rgba(255, 244, 222, 0.14);
  --line-2: rgba(255, 244, 222, 0.3);
  --lip: #050a1f;
  --pastis: #ffd23f;
  --pastis-2: #ffe17a;
  --pastis-lip: #b38600;
  --tomato: #ff5b3a;
  --tomato-lip: #a32d16;
  --blue: #3b82f6;
  --red: #ef4444;
  --good: #3fe0a0;
  --bad: #ff7a66;
  --shadow: 0 30px 80px rgba(2, 5, 20, 0.55);
  --skew: -11deg;
  --unskew: 11deg;
  --display: 'Anybody', 'Rubik', 'Arial Black', sans-serif;
  --ui: 'Rubik', system-ui, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; line-height: 1.5; }
b { font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
::selection { background: var(--pastis); color: var(--night); }

/* ---------- screens & panels ---------- */
.screen, .overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 28px; overflow: auto;
}
.screen { background: radial-gradient(ellipse at center, rgba(8, 13, 40, 0.35), rgba(8, 13, 40, 0.78)); backdrop-filter: blur(5px); }
.overlay { background: rgba(6, 10, 30, 0.55); backdrop-filter: blur(8px); z-index: 20; }
.screen:not(.hidden) > .panel, .overlay:not(.hidden) > .panel { animation: rise 0.4s cubic-bezier(0.2, 1.25, 0.35, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(0.97); } to { opacity: 1; transform: none; } }

.panel {
  position: relative; background: linear-gradient(180deg, rgba(255, 244, 222, 0.05), rgba(255, 244, 222, 0) 140px), var(--navy);
  border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 10px 0 var(--lip), var(--shadow);
  padding: 36px 32px 30px; width: min(580px, 100%); display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 66px); overflow: auto;
}
/* The café awning: tomato and cream stripes with a scalloped edge, along the top of panels and banners. */
.panel::before, #mene-banner::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 16px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--tomato) 0 18px, var(--ink) 18px 36px);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 7px no-repeat, radial-gradient(circle at 50% 7px, #000 8.5px, transparent 9px) 0 0 / 18px 16px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% 7px no-repeat, radial-gradient(circle at 50% 7px, #000 8.5px, transparent 9px) 0 0 / 18px 16px repeat-x;
}
.panel.narrow { width: min(440px, 100%); }
.panel.wide { width: min(1060px, 100%); }
.panel.center { text-align: center; align-items: center; }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 2px; }
.panel h2, .overlay h2 {
  font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 110%; font-size: 32px; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.005em; text-shadow: 3px 3px 0 var(--lip);
}
h3 { font-size: 17px; font-weight: 700; }
h4 {
  display: flex; align-items: center; gap: 9px; margin-top: 4px;
  font-family: var(--display); font-size: 12.5px; font-weight: 800; font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.16em; color: var(--pastis);
}
h4::before { content: ''; flex: none; width: 14px; height: 5px; background: currentColor; transform: skewX(-25deg); }
.panel::-webkit-scrollbar, .chat-log::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb, .chat-log::-webkit-scrollbar-thumb { background: rgba(255, 244, 222, 0.18); border-radius: 8px; }

/* ---------- brand ---------- */
.logo {
  font-family: var(--display); font-weight: 900; font-stretch: 118%; text-transform: uppercase;
  font-size: clamp(56px, 7.2vw, 108px); line-height: 0.92; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap;
  text-shadow: 0.035em 0.035em 0 var(--tomato), 0.07em 0.07em 0 var(--lip);
}
.logo-jack {
  display: inline-block; width: 0.2em; height: 0.2em; border-radius: 50%; margin-left: 0.1em;
  background: radial-gradient(circle at 35% 30%, #fff6c8, var(--pastis) 42%, #d99a00);
  box-shadow: 0.035em 0.035em 0 var(--tomato), 0.07em 0.07em 0 var(--lip);
}

/* ---------- main menu ---------- */
.screen-menu {
  --mw: min(780px, 62vw); --ms: 150px;
  justify-content: flex-start; padding: 0; backdrop-filter: none;
  background: linear-gradient(0deg, rgba(8, 13, 40, 0.5), rgba(8, 13, 40, 0) 26%);
}
/* A slanted night-blue plate on the left with a pastis stripe along its edge. */
.screen-menu::before, .screen-menu::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; pointer-events: none; }
.screen-menu::before {
  width: var(--mw); background: linear-gradient(90deg, rgba(10, 17, 48, 0.95), rgba(10, 17, 48, 0.8)); backdrop-filter: blur(6px);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--ms)) 100%, 0 100%);
}
.screen-menu::after {
  width: calc(var(--mw) + 18px); background: var(--pastis);
  clip-path: polygon(calc(100% - 10px) 0, 100% 0, calc(100% - var(--ms)) 100%, calc(100% - var(--ms) - 10px) 100%);
}
.menu-col {
  position: relative; z-index: 1; width: min(460px, 100%); margin-left: clamp(24px, 6.5vw, 116px); display: flex; flex-direction: column; gap: 28px;
  animation: slideIn 0.6s cubic-bezier(0.2, 1.1, 0.3, 1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
/* No gap between the entries: each button reaches 6px into the space on either side and only paints its card inside,
   so a pointer sliding down the list is always on one, never on nothing (which would light Play online again). */
.menu-nav { display: flex; flex-direction: column; margin: -6px 0; }
.menu-item {
  position: relative; isolation: isolate; font: inherit; color: var(--ink); text-align: left; display: flex; align-items: center; gap: 16px; width: 100%;
  background: none; border: none; padding: 15px 20px 15px 12px; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1), color 0.1s;
}
.menu-item::before {
  content: ''; position: absolute; inset: 6px 0; z-index: -1; border-radius: 7px; transform: skewX(var(--skew));
  background: rgba(26, 39, 96, 0.8); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--lip);
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.menu-item:hover, .menu-item:focus-visible, .menu-item.primary { color: var(--night); outline: none; }
.menu-item:hover, .menu-item:focus-visible { transform: translateX(10px); }
.menu-item:hover::before, .menu-item:focus-visible::before, .menu-item.primary::before {
  background: var(--pastis); border-color: var(--pastis); box-shadow: 0 5px 0 var(--pastis-lip), 0 12px 30px rgba(255, 210, 63, 0.2);
}
.menu-item:active { transform: translate(10px, 3px); }
.menu-item:active::before { box-shadow: 0 2px 0 var(--pastis-lip); }
/* Like a console menu, one entry is lit: Play online, until you point at another one. */
.menu-nav:has(.menu-item:hover, .menu-item:focus-visible) .menu-item.primary:not(:hover, :focus-visible) { color: var(--ink); }
.menu-nav:has(.menu-item:hover, .menu-item:focus-visible) .menu-item.primary:not(:hover, :focus-visible)::before { background: rgba(26, 39, 96, 0.8); border-color: var(--line); box-shadow: 0 5px 0 var(--lip); }
.menu-item .mi-icon {
  flex: none; width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255, 244, 222, 0.08); transform: skewX(var(--skew)); transition: background 0.1s, color 0.1s;
}
.menu-item .mi-icon svg { transform: skewX(var(--unskew)); }
.menu-item:hover .mi-icon, .menu-item:focus-visible .mi-icon, .menu-item.primary .mi-icon { background: var(--night); color: var(--pastis); }
.menu-nav:has(.menu-item:hover, .menu-item:focus-visible) .menu-item.primary:not(:hover, :focus-visible) .mi-icon { background: rgba(255, 244, 222, 0.08); color: var(--ink); }
.menu-item svg, .icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-item b { font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 108%; font-size: 23px; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.01em; }
.mi-new {
  display: inline-block; margin-left: 10px; padding: 3px 9px 2px; vertical-align: 4px; border-radius: 4px; transform: rotate(-3deg);
  font-family: var(--ui); font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: none;
  color: #fff; background: var(--tomato); box-shadow: 0 2px 0 var(--tomato-lip);
}

.profile-ball, .ball-dot {
  flex: none; border-radius: 50%; background: #c9cdd3;
  background-image: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55) 90%);
  box-shadow: 0 2px 0 var(--lip);
}
.profile-ball { width: 46px; height: 46px; box-shadow: 0 3px 0 var(--lip), 0 0 0 3px rgba(255, 244, 222, 0.1); }
.menu-foot { display: flex; flex-wrap: wrap; gap: 8px 11px; align-items: center; padding-left: 4px; }
.menu-foot .link { font-size: 12.5px; white-space: nowrap; } /* (one line each: on a narrow screen, a second row) */
.menu-foot > span { font-size: 0; width: 6px; height: 6px; background: var(--pastis); transform: rotate(45deg); }
.link {
  font: inherit; font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); background: none; border: none; padding: 0; cursor: pointer; transition: color 0.12s;
}
.link:hover { color: var(--pastis); }
.menu-place {
  position: absolute; right: 26px; top: 22px; isolation: isolate; display: flex; align-items: center; gap: 10px; padding: 7px 18px;
  font-family: var(--display); font-weight: 800; font-stretch: 85%; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
}
.menu-place::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; transform: skewX(var(--skew));
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip);
}
.menu-place::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pastis); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.25); }
.menu-place:empty { display: none; }
/* The player corner, bottom right: you (your licence photo, your ball on it, your name and club) and
   what you can customize. */
.player-corner {
  position: absolute; right: clamp(20px, 3vw, 44px); bottom: clamp(20px, 4vh, 40px); z-index: 1; width: 420px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px 18px; padding: 18px 18px 16px 20px;
  background: var(--plate); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 8px 0 var(--lip), var(--shadow); backdrop-filter: blur(8px);
  animation: slideInRight 0.6s cubic-bezier(0.2, 1.1, 0.3, 1);
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
/* The photo, like the one on the card: tilted, in a cream frame; it opens the licence. */
.pc-photo {
  position: relative; width: 66px; aspect-ratio: 3 / 4; padding: 0; border: none; border-radius: 6px; cursor: pointer;
  background: #e6e0d0 center / cover no-repeat; box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--lip);
  transform: rotate(-4deg); transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.pc-photo:hover, .pc-photo:focus-visible { transform: rotate(0deg) scale(1.06); outline: none; }
.pc-photo .lc-sil { display: none; }
.pc-photo.empty .lc-sil { display: block; }
.pc-photo .profile-ball { position: absolute; right: -11px; bottom: -10px; width: 28px; height: 28px; }
.pc-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pc-name { display: flex; flex-direction: column; gap: 1px; cursor: text; }
.pc-name small { color: var(--pastis); font-family: var(--display); font-stretch: 85%; font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.pc-name-row { display: flex; align-items: center; gap: 8px; }
.pc-name input {
  flex: 1; min-width: 0; background: transparent; border: none; padding: 2px 0; box-shadow: none; border-radius: 6px;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 27px; line-height: 1.1;
}
.pc-name input:focus { box-shadow: none; background: var(--well); padding: 2px 8px; }
.pc-pen { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.12s; }
.pc-name:hover .pc-pen, .pc-name:focus-within .pc-pen { stroke: var(--pastis); }
.pc-club { font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-club b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pc-actions .btn { display: flex; align-items: center; justify-content: center; gap: 5px; padding-left: 6px; padding-right: 6px; }
.pc-actions svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controls ---------- */
/* Chunky buttons standing on a lip; pressing one pushes it down onto it. */
.btn {
  --liph: 4px; --lipc: var(--lip);
  font: inherit; font-family: var(--display); font-weight: 800; font-stretch: 95%; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); background: var(--navy-2); border: 2px solid var(--line); border-radius: 10px; padding: 10px 18px 9px; cursor: pointer;
  box-shadow: 0 var(--liph) 0 var(--lipc), var(--glow, 0 0 transparent);
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.07s, box-shadow 0.07s;
}
.btn:hover { background: var(--navy-3); border-color: var(--line-2); }
.btn:active { transform: translateY(calc(var(--liph) - 1px)); box-shadow: 0 1px 0 var(--lipc); }
.btn.primary { --lipc: var(--pastis-lip); --glow: 0 10px 26px rgba(255, 210, 63, 0.2); background: var(--pastis); border-color: var(--pastis); color: var(--night); }
.btn.primary:hover { background: var(--pastis-2); border-color: var(--pastis-2); }
.btn.danger { --lipc: var(--tomato-lip); background: var(--tomato); border-color: var(--tomato); color: #fff; }
.btn.danger:hover { background: #ff7759; border-color: #ff7759; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); background: rgba(255, 244, 222, 0.07); }
.btn.ghost:active { transform: translateY(1px); }
.btn.ghost-line { background: transparent; }
.btn.ghost-line:hover { background: rgba(255, 244, 222, 0.07); }
.btn.big { --liph: 5px; padding: 15px 24px 14px; font-size: 18px; border-radius: 12px; }
.btn.small { --liph: 3px; padding: 7px 12px 6px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled, .btn:disabled:hover { opacity: 0.4; cursor: default; transform: none; filter: grayscale(0.5); box-shadow: none; }
.icon-btn {
  flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  font: inherit; font-size: 20px; font-weight: 700; line-height: 1; color: var(--ink); background: var(--navy-2); border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--lip); transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.07s, box-shadow 0.07s;
}
.icon-btn:hover { background: var(--pastis); border-color: var(--pastis); color: var(--night); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .btn { flex: 1; }
.row.end { justify-content: flex-end; }
.row.end > .btn { flex: 0 0 auto; }
.row.center { justify-content: center; }
.row.center > .btn { flex: 0 1 auto; }

input, select {
  font: inherit; font-size: 15px; font-weight: 500; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--well); color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--ink-3); }
input:focus, select:focus { border-color: var(--pastis); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.2); }
select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffd23f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
select:disabled { opacity: 0.6; cursor: default; }
option { background: var(--navy); color: var(--ink); }
/* Sliders: a bar of 20 slanted blocks, lit in pastis up to the value (--p, set by main.js). */
input[type='range'] {
  --empty: rgba(255, 244, 222, 0.13);
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; padding: 0; border: none; border-radius: 0; box-shadow: none; cursor: pointer;
  background: linear-gradient(100deg, var(--pastis) 0 var(--p, 0%), var(--empty) var(--p, 0%) 100%);
  -webkit-mask: repeating-linear-gradient(100deg, #000 0 calc(5% - 4px), transparent calc(5% - 4px) 5%);
  mask: repeating-linear-gradient(100deg, #000 0 calc(5% - 4px), transparent calc(5% - 4px) 5%);
}
input[type='range']:hover { --empty: rgba(255, 244, 222, 0.2); }
input[type='range']:focus { box-shadow: none; }
input[type='range']:focus-visible { --empty: rgba(255, 244, 222, 0.26); }
input[type='range']::-webkit-slider-runnable-track { height: 22px; background: none; border: none; }
input[type='range']::-moz-range-track { height: 22px; background: none; border: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 22px; border: none; background: transparent; }
input[type='range']::-moz-range-thumb { width: 4px; height: 22px; border: none; background: transparent; }
input[type='color'] { padding: 3px; width: 58px; height: 38px; cursor: pointer; }
/* Checkboxes: a chunky square box on a lip, ticked in pastis. */
input.check {
  appearance: none; flex: none; position: relative; width: 28px; height: 28px; padding: 0; margin: 0; border-radius: 7px; cursor: pointer;
  background: var(--well); border: 2px solid var(--line-2); box-shadow: 0 3px 0 var(--lip);
  transition: background 0.12s, border-color 0.12s, transform 0.07s, box-shadow 0.07s;
}
input.check::before {
  content: ''; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px; border: solid var(--night); border-width: 0 4px 4px 0;
  transform: rotate(45deg) scale(0); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
input.check:hover { border-color: var(--pastis); }
input.check:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
input.check:checked { background: var(--pastis); border-color: var(--pastis); box-shadow: 0 3px 0 var(--pastis-lip); }
input.check:checked::before { transform: rotate(45deg) scale(1); }
input.check:focus-visible { box-shadow: 0 3px 0 var(--lip), 0 0 0 4px rgba(255, 210, 63, 0.3); }
/* Keys: little cream keycaps. */
kbd {
  display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 5px; text-align: center; white-space: nowrap;
  font: 700 11.5px/1.7 var(--ui); color: var(--night); background: var(--ink); border: none; box-shadow: 0 2px 0 #a99c80;
}

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.range-row { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; }
.range-row > span { display: flex; justify-content: space-between; align-items: baseline; }
.range-row b { color: var(--pastis); font-family: var(--display); font-style: italic; font-weight: 900; font-size: 16px; font-variant-numeric: tabular-nums; margin-left: auto; }
.range-row small { color: var(--ink-3); font-size: 12.5px; font-weight: 500; margin-left: 8px; }
.check-row, .select-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; }
.check-row > span, .select-row > span { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.check-row small, .select-row small { color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.select-row select { min-width: 170px; }
.settings-group { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; border-top: 2px dashed var(--line); }
.panel-head + .settings-group { border-top: none; padding-top: 0; }

.code-input { font-family: var(--display); font-style: italic; text-transform: uppercase; letter-spacing: 0.4em; font-size: 26px; font-weight: 900; text-align: center; flex: 1; min-width: 0; }
.join-row { display: flex; gap: 10px; }
.join-row .btn { padding-left: 24px; padding-right: 24px; }
.divider {
  display: flex; align-items: center; gap: 12px; color: var(--ink-3);
  font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 0; border-top: 2px dashed var(--line); }
.status { min-height: 20px; font-size: 14px; color: var(--bad); }
.acc-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.acc-note { font-size: 13px; }
#screen-account .panel > div > p + p, #screen-account .panel > div > p + .btn { margin-top: 10px; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  font: inherit; color: var(--ink); text-align: left; border: 2px solid var(--line); background: var(--navy-2); border-radius: 12px; box-shadow: 0 4px 0 var(--lip);
  padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--pastis); transform: translateY(-3px); }
.card b { font-family: var(--display); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 18px; }
.card span { color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }

/* Terrain picker. */
.map-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
#practice-map-cards { grid-template-columns: repeat(2, 1fr); }
.map-card {
  font: inherit; color: var(--ink); text-align: left; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--line); background: var(--navy-2); display: flex; flex-direction: column; box-shadow: 0 4px 0 var(--lip);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.map-card:hover:not(:disabled) { transform: translateY(-3px) rotate(-0.8deg); border-color: var(--line-2); }
.map-card .mc-img { aspect-ratio: 16 / 9; background: var(--navy-3) center / cover no-repeat; position: relative; }
.map-card .mc-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(5, 10, 31, 0.4)); }
.map-card .mc-text { flex: 1; padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 2px; transition: background 0.15s; }
.map-card b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.15; }
.map-card small { color: var(--ink-3); font-size: 12px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.map-card.on { border-color: var(--pastis); box-shadow: 0 4px 0 var(--pastis-lip), 0 10px 28px rgba(255, 210, 63, 0.18); }
.map-card.on .mc-text { background: var(--pastis); color: var(--night); }
.map-card.on small { color: rgba(10, 17, 48, 0.7); }
.map-card.on .mc-img::before {
  content: '✓'; position: absolute; top: 7px; right: 7px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 15px; color: var(--night); background: var(--pastis); box-shadow: 0 2px 0 var(--pastis-lip);
}
.map-card:disabled { cursor: default; }
.map-card:disabled:not(.on) { opacity: 0.5; }

/* ---------- lobby ---------- */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr auto; gap: 18px 24px; }
.lobby-head { grid-column: 1 / -1; flex-wrap: wrap; }
.lobby-head h2 { flex: 1; }
.invite { display: flex; gap: 10px; align-items: center; }
.code-label { color: var(--ink-3); font-family: var(--display); font-size: 11px; font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; }
/* The room code: a pastis-yellow ticket. */
.invite .code {
  font-family: var(--display); font-style: italic; font-size: 24px; font-weight: 900; letter-spacing: 0.28em; font-variant-numeric: tabular-nums;
  padding: 4px 8px 3px 18px; border-radius: 8px; color: var(--night); background: var(--pastis);
  outline: 2px dashed rgba(10, 17, 48, 0.32); outline-offset: -6px; box-shadow: 0 4px 0 var(--pastis-lip);
}
.lobby-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lobby-side { display: flex; flex-direction: column; gap: 8px; min-height: 280px; }
.lobby-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 6px; }
.lobby-foot #lobby-wait { flex: 1; font-size: 14px; }
.lobby-foot .btn.big { min-width: 210px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.team {
  border-radius: 12px; padding: 14px; border: 2px solid color-mix(in srgb, var(--team-c) 55%, transparent); box-shadow: 0 5px 0 var(--lip);
  background: linear-gradient(160deg, color-mix(in srgb, var(--team-c) 26%, var(--navy)) 0%, var(--navy) 60%);
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.team[data-team='0'] { --team-c: var(--blue); }
.team[data-team='1'] { --team-c: var(--red); }
.team-title {
  position: relative; isolation: isolate; align-self: flex-start; padding: 5px 16px 4px; margin-left: 4px; color: #fff;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 8px); cursor: text;
}
.team-title::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--skew));
  background: var(--team-c); box-shadow: 0 3px 0 rgba(5, 10, 31, 0.6); transition: box-shadow 0.15s;
}
/* The team's name, written straight on its plate: click it to rename the team (a pencil says you can). */
.team-title .team-name {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: none; border-radius: 0;
  padding: 0; margin: 0; min-width: 3ch; max-width: 100%; field-sizing: content; text-overflow: ellipsis;
}
@supports not (field-sizing: content) { .team-title .team-name { width: 11em; } }
.team-title .team-name::placeholder { color: inherit; opacity: 1; }
.team-title .team-name:focus { box-shadow: none; }
.team-title .team-name:focus::placeholder { opacity: 0.45; }
.team-title:focus-within::before { box-shadow: 0 3px 0 rgba(5, 10, 31, 0.6), 0 0 0 3px var(--pastis); }
.team-title .pen { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.65; transition: opacity 0.12s; }
.team-title:hover .pen, .team-title:focus-within .pen { opacity: 1; }
.team-title:has(.team-name:disabled) { cursor: default; }
.team-title:has(.team-name:disabled) .pen { display: none; }
.team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.team-list li {
  display: flex; align-items: center; gap: 10px; background: var(--well); border: 2px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 14.5px;
}
.team-list li.empty { background: transparent; border: 2px dashed var(--line); color: var(--ink-3); font-weight: 500; justify-content: center; }
.team-list li .ball-dot { width: 20px; height: 20px; }
.team-list li .tag {
  font-family: var(--display); font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--night); background: var(--ink-2); border-radius: 4px; padding: 2px 7px 1px;
}
.team-list li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-list li .x {
  border: none; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 15px; font-weight: 800;
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
}
.team-list li .x:hover { background: var(--tomato); color: #fff; }
.team-list li.me { border-color: var(--pastis); }
.team-list li.off { opacity: 0.5; }
.team-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.team-actions .btn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spectators {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px 10px 14px; border-radius: 12px;
  border: 2px dashed var(--line-2); background: rgba(255, 244, 222, 0.03);
}
.spec-head { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.spec-head > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.spec-head b { font-family: var(--display); font-style: italic; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.spec-head small { color: var(--ink-3); font-size: 12px; }
.spec-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 244, 222, 0.08); color: var(--pastis); transform: skewX(var(--skew)); }
.spec-icon svg { transform: skewX(var(--unskew)); }
.spec-icon svg, #spec-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.spec-list li { display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 6px; border-radius: 99px; background: var(--well); border: 2px solid var(--line); font-weight: 600; font-size: 13.5px; }
.spec-list li.me { border-color: var(--pastis); }
.spec-list li.empty { background: none; border: none; color: var(--ink-3); font-weight: 500; padding-left: 0; }
.spec-list .ball-dot { width: 16px; height: 16px; }
/* Top left, next to the menu button: what kind of session this is (spectating, warm-up). */
#spec-badge, #mode-badge {
  position: absolute; top: 16px; left: 72px; height: 42px; isolation: isolate; display: flex; align-items: center; gap: 9px; padding: 0 20px;
  font-family: var(--display); font-size: 13px; font-weight: 800; font-stretch: 90%; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
#spec-badge::before, #mode-badge::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 7px; transform: skewX(var(--skew));
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip); backdrop-filter: blur(10px);
}
#spec-badge svg { color: var(--pastis); }
/* Spectating a match: the places you can take (bots, players who left), on the right. Above the
   game menu, so that once Esc has freed the mouse you can click them. */
#seats {
  position: absolute; top: 50%; right: 16px; transform: translateY(-50%); z-index: 21; width: 280px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 10px; border-radius: 12px;
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--lip), var(--shadow); backdrop-filter: blur(10px);
}
.seats-head { display: flex; flex-direction: column; gap: 1px; padding: 0 2px; }
.seats-head b { font-family: var(--display); font-style: italic; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pastis); }
.seats-head small { color: var(--ink-3); font-size: 12px; }
.seats-team { display: flex; flex-direction: column; gap: 6px; }
.seats-title {
  position: relative; isolation: isolate; align-self: flex-start; padding: 2px 12px 1px; margin-left: 4px; color: #fff;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.seats-title::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--skew)); background: var(--team); }
.seat { display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 9px; border-radius: 9px; background: var(--well); border: 2px solid var(--line); border-left: 4px solid var(--team); }
.seat .ball-dot { width: 18px; height: 18px; }
.seat-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.seat-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-name small { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .btn { flex: none; }
.seats-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; }
.seats-hint kbd { font-size: 10.5px; padding: 0 5px; }
#seats:not(.locked) .seats-hint { display: none; }
#hud > #seats { pointer-events: auto; }
.lobby-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
body.not-host .host-only { display: none !important; }
body:not(.is-local) .local-only { display: none !important; }
body.is-local #lobby-invite, body.is-local .lobby-side, body.is-local #spectators-wrap { display: none !important; }
body.is-local .lobby { grid-template-columns: 1fr; width: min(820px, 100%); }

.chat-box { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--well); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-box .chat-log { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 5px; line-height: 1.4; }
.chat-box input { border: none; border-top: 2px solid var(--line); border-radius: 0; background: rgba(5, 10, 31, 0.35); }
.chat-box input:focus { box-shadow: none; background: rgba(5, 10, 31, 0.6); }

/* ---------- editor ---------- */
.editor-body { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.editor-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
/* The 3D previews stand on a sunburst, like an old poster. */
#editor-canvas, #outfit-canvas {
  border-radius: 14px; flex: none; cursor: grab; border: 2px solid var(--line); box-shadow: 0 6px 0 var(--lip);
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255, 210, 63, 0.07) 0deg 7deg, rgba(255, 210, 63, 0) 7deg 18deg),
    radial-gradient(circle at 50% 44%, #34489c 0%, #19255c 55%, #0a1130 100%);
}
#editor-canvas { width: 360px; height: 360px; }
.editor-controls { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.swatches, .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 72px; border: 2px solid var(--line); border-radius: 10px; padding: 8px 4px 7px; background: var(--navy-2); cursor: pointer; box-shadow: 0 3px 0 var(--lip);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.swatch i { width: 30px; height: 30px; border-radius: 50%; display: block; box-shadow: inset -4px -4px 8px rgba(0, 0, 0, 0.4), inset 3px 3px 6px rgba(255, 255, 255, 0.6); }
.swatch:hover, .chip:hover { border-color: var(--line-2); transform: translateY(-2px); }
.swatch.on { border-color: var(--pastis); background: rgba(255, 210, 63, 0.14); color: var(--ink); }
.chip {
  font: inherit; font-weight: 600; font-size: 13px; color: var(--ink-2); border: 2px solid var(--line); background: var(--navy-2); box-shadow: 0 3px 0 var(--lip);
  border-radius: 8px; padding: 6px 11px; cursor: pointer; transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.chip.on { border-color: var(--pastis); background: var(--pastis); color: var(--night); box-shadow: 0 3px 0 var(--pastis-lip); }
.stickers .chip { font-size: 20px; padding: 4px 8px; min-width: 44px; }
.stickers .chip.on { background: rgba(255, 210, 63, 0.18); }
/* Size and weight: a few presets, a stepped slider for each (a block per size, per weight), what it does
   and the way back to the standard boule. */
#ed-presets .chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 11px; }
#ed-presets .chip small { font-size: 11px; font-weight: 500; opacity: 0.75; }
.ed-spec { font-size: 13.5px; }
input[type='range'].steps {
  -webkit-mask: repeating-linear-gradient(100deg, #000 0 calc(100% / var(--n, 20) - 4px), transparent calc(100% / var(--n, 20) - 4px) calc(100% / var(--n, 20)));
  mask: repeating-linear-gradient(100deg, #000 0 calc(100% / var(--n, 20) - 4px), transparent calc(100% / var(--n, 20) - 4px) calc(100% / var(--n, 20)));
}
.ed-foot { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.ed-feel { flex: 1; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }

/* ---------- outfit ---------- */
.outfit-body { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.outfit-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
#outfit-canvas { width: 380px; height: 440px; touch-action: none; }
#outfit-canvas:active, #editor-canvas:active { cursor: grabbing; }
.outfit-team .chip { display: flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 12px; }
.outfit-team i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(5, 10, 31, 0.4); }
.outfit-team i.t0 { background: var(--blue); }
.outfit-team i.t1 { background: var(--red); }
.outfit-controls { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 12px; }
.outfit-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--well); border: 2px solid var(--line); }
.outfit-tabs .tab {
  flex: 1; font: inherit; font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-2); background: transparent; border: none; border-radius: 8px; padding: 9px 8px 8px; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.outfit-tabs .tab:hover { color: var(--ink); background: rgba(255, 244, 222, 0.07); }
.outfit-tabs .tab.on { background: var(--pastis); color: var(--night); box-shadow: 0 3px 0 var(--pastis-lip); }
.of-note { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; margin-top: 4px; }
.of-pane { display: flex; flex-direction: column; gap: 12px; }
.of-field { display: flex; flex-direction: column; gap: 7px; }
.of-field h4 small { text-transform: none; letter-spacing: 0; font-family: var(--ui); font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.dots { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.dot {
  position: relative; flex: none; width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 3px 0 var(--lip); transition: box-shadow 0.15s, transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.dot:hover { transform: scale(1.12); }
.dot.on { box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--pastis); }
.dot.team { background: linear-gradient(135deg, var(--blue) 50%, var(--red) 50%); }
.dot.none {
  background: rgba(255, 255, 255, 0.06)
    linear-gradient(135deg, transparent 44%, rgba(255, 255, 255, 0.55) 44%, rgba(255, 255, 255, 0.55) 56%, transparent 56%);
}
.dot.custom { background: conic-gradient(#ef4444, #f2a93b, #facc15, #34d399, #3b82f6, #a855f7, #ef4444); overflow: hidden; }
.dot.custom::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--c, transparent); }
.dot.custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: none; opacity: 0; cursor: pointer; }
.tattoos { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 7px; }
.tat {
  aspect-ratio: 1; padding: 3px; border: 2px solid var(--line); border-radius: 10px; background: var(--navy-2); cursor: pointer;
  display: grid; place-items: center; color: var(--ink-3); font: inherit; font-size: 18px; transition: border-color 0.12s, background 0.12s;
}
.tat img { width: 100%; height: 100%; border-radius: 7px; display: block; }
.tat:hover { border-color: var(--line-2); }
.tat.on { border-color: var(--pastis); background: rgba(255, 210, 63, 0.16); }
.row.end > .of-random { margin-right: auto; }

.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.help h3 { font-family: var(--display); font-style: italic; font-size: 20px; font-weight: 900; text-transform: uppercase; color: var(--pastis); margin-top: 4px; }
.help ul { padding-left: 18px; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 9px; line-height: 1.55; font-size: 14.5px; color: var(--ink-2); }
.help li::marker { color: var(--pastis); }
.help b { color: var(--ink); }

/* ---------- loading ---------- */
#loader {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; transition: opacity 0.6s ease;
  background: repeating-conic-gradient(from -3deg at 50% 46%, rgba(255, 210, 63, 0.05) 0deg 6deg, rgba(255, 210, 63, 0) 6deg 18deg),
    radial-gradient(ellipse at 50% 46%, #1d2b6a 0%, #0a1130 72%);
}
#loader.veil { background: rgba(6, 10, 30, 0.62); backdrop-filter: blur(12px); }
#loader.veil .logo { font-size: 60px; }
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; width: min(460px, 80vw); }
.loader-bar { height: 18px; border-radius: 99px; background: var(--well); border: 2px solid var(--line); overflow: hidden; margin: 40px 0 14px; box-shadow: 0 4px 0 var(--lip); }
/* A striped pastis bar, scrolling like a barber's pole. */
.loader-bar i {
  display: block; height: 100%; width: 0; border-radius: 99px; transition: width 0.25s ease; animation: stripes 0.7s linear infinite;
  background: linear-gradient(-45deg, transparent 25%, rgba(179, 134, 0, 0.45) 25% 50%, transparent 50% 75%, rgba(179, 134, 0, 0.45) 75%) 0 0 / 24px 24px, var(--pastis);
}
@keyframes stripes { to { background-position: 24px 0, 0 0; } }
#loader-text { font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.loader-tip { color: var(--ink-3); font-size: 14px; margin-top: 26px; min-height: 20px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
#hud > * { pointer-events: none; }
#hud-menu { position: absolute; top: 16px; left: 16px; pointer-events: auto; background: var(--plate); backdrop-filter: blur(12px); }
#topbar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 14px; }
/* The score, like a TV sports bug: slanted, team colours on either side of the mène. */
#scoreboard {
  position: relative; display: flex; align-items: stretch; flex: none; transform: skewX(var(--skew)); border-radius: 7px;
  background: var(--navy); border: 2px solid rgba(255, 244, 222, 0.22); box-shadow: 0 5px 0 var(--lip), 0 14px 30px rgba(0, 0, 0, 0.35);
}
#scoreboard > .sb-team > *, #scoreboard > .sb-mid > * { transform: skewX(var(--unskew)); }
.sb-team { display: flex; align-items: center; gap: 12px; padding: 3px 18px; }
.sb-team span {
  font-family: var(--display); font-size: 12px; font-weight: 800; font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.9);
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-team b {
  font-family: var(--display); font-style: italic; font-size: 40px; font-weight: 900; line-height: 1.05; min-width: 30px; text-align: center;
  font-variant-numeric: tabular-nums; color: #fff; text-shadow: 3px 3px 0 rgba(5, 10, 31, 0.35);
}
.sb-team.t0 { border-radius: 5px 0 0 5px; background: linear-gradient(180deg, #5293fa, #2563eb); }
.sb-team.t1 { border-radius: 0 5px 5px 0; background: linear-gradient(180deg, #f45d5d, #d42222); }
.sb-mid { padding: 5px 18px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
#score-mene { font-family: var(--display); font-style: italic; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; color: var(--pastis); }
#score-target { font-size: 11px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
#score-point {
  position: absolute; top: calc(100% + 11px); left: 50%; margin-left: 9px; transform: translateX(-50%) skewX(var(--unskew)); isolation: isolate;
  white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 4px 16px;
}
#score-point::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 5px; transform: skewX(var(--skew));
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--lip);
}
#score-point:empty { display: none; }
.team-balls { display: flex; flex-direction: column; gap: 6px; width: 220px; }
.team-balls.left { align-items: flex-end; }
.team-balls.right { align-items: flex-start; }
.tb-player {
  display: flex; align-items: center; gap: 9px; padding: 4px 12px; font-size: 13px; font-weight: 600; max-width: 220px;
  transform: skewX(var(--skew)); border-radius: 5px; background: var(--plate); box-shadow: 0 3px 0 var(--lip);
  border: 2px solid color-mix(in srgb, var(--team) 70%, transparent);
}
.tb-player > * { transform: skewX(var(--unskew)); }
.tb-player.current { background: var(--pastis); border-color: var(--pastis); color: var(--night); box-shadow: 0 3px 0 var(--pastis-lip); }
.tb-player.can-play { border-style: dashed; border-color: var(--team); }
.tb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bot { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.tb-player.current .tb-bot { color: rgba(10, 17, 48, 0.6); border-color: rgba(10, 17, 48, 0.3); }
.tb-player .dots { gap: 4px; flex: none; flex-wrap: nowrap; }
.tb-player .dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(255, 244, 222, 0.3); display: block; box-sizing: border-box; }
.tb-player.current .dots i { border-color: rgba(10, 17, 48, 0.35); }
.tb-player .dots i.on {
  border-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle at 35% 32%, #fff, var(--ball, #b7bcc4) 42%, #23262b);
}
#practice-panel {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); padding: 10px 24px; display: flex; gap: 22px; align-items: center;
  background: var(--navy); border: 2px solid var(--line); border-radius: 10px; box-shadow: 0 5px 0 var(--lip); font-size: 14px; color: var(--ink-2);
}
#practice-panel h3 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--pastis); }
#practice-panel b { color: var(--ink); font-family: var(--display); font-style: italic; font-weight: 900; font-size: 18px; margin-left: 4px; font-variant-numeric: tabular-nums; }
/* Whose turn: a slanted caption, underlined in the team's colour, and a pastis tag under it. */
#turn-banner {
  position: absolute; top: 122px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; animation: bannerIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.turn-main {
  position: relative; isolation: isolate; padding: 6px 30px 5px; white-space: nowrap;
  font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 105%; font-size: 32px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.01em;
}
.turn-main::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; transform: skewX(var(--skew));
  background: var(--plate); border-bottom: 5px solid currentColor; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); backdrop-filter: blur(8px);
}
.turn-sub { position: relative; isolation: isolate; padding: 5px 18px 4px; font-size: 14px; font-weight: 600; color: var(--night); }
.turn-sub::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 5px; transform: skewX(var(--skew));
  background: var(--pastis); box-shadow: 0 3px 0 var(--pastis-lip);
}
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -12px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Tab scoreboard (and end-of-game table). */
#tab-board {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 860px; max-width: 94vw; z-index: 12;
  background: var(--navy); border: 2px solid var(--line); border-radius: 16px; padding: 20px 24px 22px; box-shadow: 0 8px 0 var(--lip), var(--shadow);
}
.tab-title { text-align: center; font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pastis); margin-bottom: 14px; }
.tab-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tab-team { border: 2px solid color-mix(in srgb, var(--team) 50%, transparent); border-radius: 10px; overflow: hidden; padding-bottom: 6px; background: rgba(5, 10, 31, 0.35); }
.tab-head {
  display: flex; justify-content: space-between; align-items: center; padding: 4px 14px; background: var(--team); color: #fff;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
}
.tab-head b { font-size: 34px; line-height: 1.1; letter-spacing: 0; text-shadow: 3px 3px 0 rgba(5, 10, 31, 0.3); }
.board table { width: calc(100% - 20px); margin: 6px 10px 0; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.board th { text-align: right; font-family: var(--display); font-size: 10.5px; font-stretch: 80%; color: var(--ink-3); font-weight: 800; padding: 4px 6px; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.board td { text-align: right; padding: 6px; font-weight: 600; border-top: 1px dashed var(--line); white-space: nowrap; }
.board th:first-child, .board td:first-child { text-align: left; }
.board tr.me td { color: var(--pastis); }
/* Holding Tab frees the mouse: the board can be pointed at, a name opens their licence. */
#hud > #tab-board.free { pointer-events: auto; }
#tab-board.free tbody tr:hover td { background: rgba(255, 244, 222, 0.05); }
.board .lc-link { font-weight: inherit; }
.board td.star { color: var(--pastis); }
.tab-best { text-align: center; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
#end-board { width: 100%; overflow-x: auto; margin-top: 4px; background: var(--well); border: 2px solid var(--line); border-radius: 12px; padding: 14px; }
#end-board:empty { display: none; }
#hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); isolation: isolate; padding: 9px 22px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
#hint::before, #modal-note::before, #hover-tip::before, #jack-tip .jt-in::before, #drunk-badge::before, #drowsy-badge::before, #phone-chip::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; transform: skewX(var(--skew));
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip); backdrop-filter: blur(10px);
}
#mene-banner {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%); text-align: center; min-width: 340px; overflow: hidden;
  background: var(--navy); border: 2px solid var(--line); padding: 34px 46px 26px; border-radius: 16px;
  box-shadow: 0 8px 0 var(--lip), var(--shadow); animation: pop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.mb-title { font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 105%; font-size: 34px; line-height: 1.05; text-transform: uppercase; }
.mb-sub { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.mb-score { font-family: var(--display); font-style: italic; font-size: 64px; font-weight: 900; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; text-shadow: 4px 4px 0 var(--lip); }
#mene-banner > div:not([class]) { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.75) rotate(-3deg); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

#chat { position: absolute; left: 16px; bottom: 16px; width: 340px; display: flex; flex-direction: column; gap: 6px; }
#chat .chat-log { display: flex; flex-direction: column; gap: 4px; font-size: 14px; max-height: 230px; overflow: hidden; justify-content: flex-end; }
#chat .chat-line {
  opacity: 0; transition: opacity 0.6s; align-self: flex-start; max-width: 100%; padding: 5px 11px; border-radius: 6px;
  background: var(--plate); border-left: 3px solid var(--pastis); backdrop-filter: blur(10px);
}
#chat .chat-line.fresh, #chat.open .chat-line { opacity: 1; }
#chat input { pointer-events: auto; background: var(--plate); backdrop-filter: blur(12px); }
.chat-box .chat-line { color: var(--ink); }

#mode-badge b { color: var(--ink); font-weight: 900; font-style: italic; }
/* Pompette (too much pastis): a warm haze round the edges of the view, and how long it lasts. */
#drunk-haze {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 210, 110, 0) 50%, rgba(255, 190, 80, 0.1) 72%, rgba(70, 40, 8, 0.36) 100%);
}
#drunk-badge, #drowsy-badge {
  position: absolute; top: 72px; left: 20px; height: 34px; isolation: isolate; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-3);
}
#drunk-badge::before { border-color: var(--pastis); }
#drunk-badge b, #drowsy-badge b { font-family: var(--display); font-style: italic; font-weight: 900; color: var(--pastis); text-transform: uppercase; letter-spacing: 0.08em; }
#drunk-left, #drowsy-left { font-variant-numeric: tabular-nums; }
/* Défoncé (a joint too many): heavy eyelids closing in from the top and the bottom of the view (--top, --bottom: 0 open
   .. 1 meeting in the middle, set by main.js), the edges of the view gone soft, and how long it lasts (under pompette's). */
#drowsy-blur {
  position: absolute; inset: 0; opacity: 0; backdrop-filter: blur(4px);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 40%, #000 85%); mask-image: radial-gradient(ellipse at center, transparent 40%, #000 85%);
}
#eyelids { position: absolute; inset: 0; overflow: hidden; --top: 0; --bottom: 0; }
#eyelids i { position: absolute; left: -15%; width: 130%; height: 60%; background: #140b08; box-shadow: 0 0 40px 26px #140b08; }
#eyelids .top { top: 0; border-radius: 0 0 50% 50% / 0 0 34% 34%; transform: translateY(calc(var(--top) * (50vh + 66px) - 100% - 66px)); }
#eyelids .bottom { bottom: 0; border-radius: 50% 50% 0 0 / 34% 34% 0 0; transform: translateY(calc(100% + 66px - var(--bottom) * (50vh + 66px))); }
#drowsy-badge::before { border-color: var(--good); }
#drowsy-badge b { color: var(--good); }
#drowsy-badge.second { top: 114px; }
#mode-sub { font-family: var(--ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
#mode-sub::before { content: '·'; margin: 0 8px 0 2px; }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(63, 224, 160, 0.2); animation: modeDot 2.4s ease-in-out infinite; }
@keyframes modeDot { 50% { box-shadow: 0 0 0 5px rgba(63, 224, 160, 0.08); } }
/* Phone controller pairing. */
.phone-panel { width: min(760px, 100%); }
.phone-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.phone-qr-wrap { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.phone-qr { width: 260px; height: 260px; background: #fff; border-radius: 12px; padding: 10px; display: grid; place-items: center; color: #222; text-align: center; font-size: 13px; box-shadow: 0 6px 0 var(--lip); }
.phone-qr svg { width: 100%; height: 100%; }
.phone-code-row { display: flex; align-items: baseline; gap: 10px; }
.phone-code-row b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 30px; letter-spacing: 0.22em; font-variant-numeric: tabular-nums; color: var(--pastis); }
.phone-side { display: flex; flex-direction: column; gap: 12px; }
.phone-status { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 18px; text-transform: uppercase; }
.phone-status.ok { color: var(--good); }
.phone-steps { padding-left: 20px; color: var(--ink-2); line-height: 1.6; font-size: 14.5px; }
.phone-steps li::marker { color: var(--pastis); font-weight: 700; }
.phone-steps b { color: var(--ink); }
.phone-safety { font-size: 13.5px; color: var(--ink-3); }
.phone-warn { font-size: 13.5px; color: var(--pastis-2); padding: 10px 12px; border-radius: 10px; background: rgba(255, 210, 63, 0.1); border: 2px solid rgba(255, 210, 63, 0.4); }
#phone-chip {
  position: absolute; top: 18px; right: 20px; height: 34px; isolation: isolate; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  font-family: var(--display); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
#phone-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
@media (max-width: 760px) { .phone-body { grid-template-columns: 1fr; } }

/* Lost the server: shown over everything until we're back. */
#net-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 9px 20px;
  font-family: var(--display); font-size: 13.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
  background: var(--tomato); border-radius: 8px; box-shadow: 0 4px 0 var(--tomato-lip), 0 8px 24px rgba(0, 0, 0, 0.4);
}
#net-banner i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Emote wheel (hold X). */
#emote-wheel {
  position: absolute; left: 50%; top: 50%; width: 330px; height: 330px; margin: -165px 0 0 -165px; border-radius: 50%; z-index: 6;
  background: radial-gradient(circle, rgba(10, 17, 48, 0.25) 0 29%, rgba(10, 17, 48, 0.86) 30% 100%); border: 2px solid var(--line);
  backdrop-filter: blur(10px); box-shadow: 0 8px 0 var(--lip), var(--shadow); animation: wheelIn 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes wheelIn { from { opacity: 0; transform: scale(0.85) rotate(-8deg); } to { opacity: 1; transform: none; } }
.ew-item {
  position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; transition: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.1s;
}
.ew-icon { font-size: 30px; line-height: 1; white-space: nowrap; letter-spacing: -0.12em; }
.ew-name { font-family: var(--display); font-size: 10.5px; font-weight: 800; font-stretch: 90%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.ew-item.on { background: var(--pastis); transform: scale(1.14); box-shadow: 0 4px 0 var(--pastis-lip); }
.ew-item.on .ew-name { color: var(--night); }
.ew-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ew-center b { font-family: var(--display); font-style: italic; font-size: 20px; font-weight: 900; text-transform: uppercase; }
.ew-center small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
/* Toasts: slanted tags; the big ones (Carreau!) slam in like a sticker. */
#toasts { position: absolute; top: 190px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.toast {
  position: relative; isolation: isolate; color: var(--ink); padding: 9px 22px; font-weight: 700; font-size: 15px;
  max-width: min(640px, 90vw); text-align: center; line-height: 1.4;
  animation: toastIn 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); transition: opacity 0.5s, transform 0.5s;
}
.toast::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; transform: skewX(var(--skew));
  background: var(--navy); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip), 0 10px 24px rgba(0, 0, 0, 0.3);
}
.toast.out { opacity: 0; transform: translateY(-10px); }
.toast.good::before { border-color: var(--good); box-shadow: 0 4px 0 #13734d, 0 10px 24px rgba(0, 0, 0, 0.3); }
.toast.bad::before { border-color: var(--tomato); box-shadow: 0 4px 0 var(--tomato-lip), 0 10px 24px rgba(0, 0, 0, 0.3); }
.toast.gold { color: var(--night); }
.toast.gold::before { background: var(--pastis); border-color: var(--pastis); box-shadow: 0 4px 0 var(--pastis-lip), 0 10px 24px rgba(0, 0, 0, 0.3); }
.toast.big {
  font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 110%; font-size: 76px; line-height: 1.1; letter-spacing: 0; text-transform: uppercase;
  padding: 0 24px; color: var(--pastis); -webkit-text-stroke: 3px var(--night); paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--tomato), 9px 9px 0 var(--night), 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: rotate(-4deg); animation: slam 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.toast.big::before { display: none; }
.toast.big.out { transform: rotate(-4deg) translateY(-16px) scale(1.06); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes slam { from { opacity: 0; transform: rotate(-14deg) scale(2.3); } 50% { opacity: 1; } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

.overlay .menu-list { gap: 12px; }
.overlay .menu-list h2 { margin-bottom: 6px; }
.end-panel { width: min(940px, 100%); }
#end-board .tab-title { display: none; }
#end-title { font-family: var(--display); font-style: italic; font-size: 64px; font-weight: 900; font-stretch: 112%; text-transform: uppercase; line-height: 1; text-shadow: 4px 4px 0 var(--lip); }
.end-score { font-family: var(--display); font-style: italic; font-size: 84px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 5px 5px 0 var(--lip); }
#modal-note {
  position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 70; isolation: isolate; padding: 11px 24px;
  font-weight: 600; animation: toastIn 0.25s ease-out;
}

@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .help-cols { grid-template-columns: 1fr; }
  .teams, .lobby-settings { grid-template-columns: 1fr; }
  .map-cards { grid-template-columns: repeat(2, 1fr); }
  #editor-canvas { width: 260px; height: 260px; }
  #outfit-canvas { width: 280px; height: 340px; }
  .screen-menu { --mw: 100vw; --ms: 0px; flex-wrap: wrap; align-content: center; }
  .screen-menu::after { display: none; }
  .player-corner { position: relative; right: auto; bottom: auto; margin: 28px 0 0 clamp(24px, 6.5vw, 116px); width: min(460px, calc(100% - 48px)); }
}

/* ---------- first-person HUD ---------- */
#swing-dial { position: absolute; right: 18px; bottom: 64px; width: 220px; height: 330px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35)); }
#dial-keys { position: absolute; right: 12px; bottom: 10px; width: 232px; text-align: center; font-size: 11px; font-weight: 600; line-height: 2.2; color: var(--ink); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
#dial-keys kbd { font-size: 10.5px; padding: 0 5px; }
/* Your inventory (see inventory.js): a row of slots at the bottom in the middle, what's in your hand lit up in
   pastis yellow, and what to do with it just above. It slips away while the number keys are the throw's (in the
   circle) or the paint's, and the hint for the mouse moves up over it while it's there. */
#inventory {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity 0.18s, transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1), visibility 0s;
}
#inventory.away { opacity: 0; transform: translate(-50%, 18px); visibility: hidden; transition: opacity 0.15s, transform 0.15s, visibility 0s 0.15s; }
#inventory:not(.away):not(.hidden) ~ #hint { bottom: 120px; }
.inv-slots { display: flex; gap: 7px; }
.inv-slot {
  position: relative; isolation: isolate; width: 62px; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 5px; color: var(--ink-3); transition: transform 0.15s, color 0.15s;
}
.inv-slot::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 8px; transform: skewX(var(--skew)); transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip); backdrop-filter: blur(10px);
}
.inv-slot b { position: absolute; top: 3px; left: 10px; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 13px; color: var(--ink-2); }
.inv-slot em { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.inv-slot span { font-family: var(--display); font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.inv-slot svg { width: 30px; height: 30px; margin-bottom: 1px; }
.inv-slot .ball-dot { width: 23px; height: 23px; margin-bottom: 5px; }
.inv-slot svg, .inv-slot .ball-dot { opacity: 0.78; transition: opacity 0.15s; }
.inv-slot.on { color: var(--ink); transform: translateY(-5px); }
.inv-slot.on::before { border-color: var(--pastis); box-shadow: 0 4px 0 var(--pastis-lip), 0 0 22px rgba(255, 210, 63, 0.28); }
.inv-slot.on b { color: var(--pastis); }
.inv-slot.on svg, .inv-slot.on .ball-dot { opacity: 1; }
/* The icons, outlined in ink like stickers. */
.inv-slot svg * { stroke: var(--lip); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.inv-slot .case { fill: var(--tomato); }
.inv-slot .reel { fill: #1b2142; }
.inv-slot .hub { fill: var(--ink-2); }
.inv-slot .blade { fill: var(--pastis); }
.inv-slot .ticks { stroke-width: 1.1; }
.inv-slot .hook { stroke: #c9cdd3; stroke-width: 2.4; }
.inv-slot .glass { fill: rgba(255, 244, 222, 0.14); stroke: var(--ink); stroke-width: 1.8; }
.inv-slot .liquid { fill: #f2d16b; stroke: none; }
.inv-slot .shine { stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.4; }
.inv-slot .body { fill: var(--blue); }
.inv-slot .pod { fill: #2a2f45; }
.inv-slot .tip { fill: #15171c; }
.inv-slot .led { fill: #5fe3ff; stroke: none; }
.inv-slot .puff { fill: rgba(255, 244, 222, 0.85); stroke: none; }
.inv-slot .paper { fill: #f4efe4; }
.inv-slot .filter { fill: #d9b98a; }
.inv-slot .ember { fill: #ff7a2e; stroke: var(--tomato-lip); }
.inv-slot .wisp { fill: none; stroke: rgba(255, 244, 222, 0.65); stroke-width: 1.4; }
.inv-slot .idcard { fill: #fbf7ec; }
.inv-slot .idband { fill: #1c2f7a; }
.inv-slot .idphoto { fill: #c9b18a; stroke-width: 1.2; }
.inv-slot .idline { stroke: #1c2f7a; stroke-width: 1.5; }
.inv-slot .pad { fill: #f6f1e2; }
.inv-slot .padline { stroke: #6e8ed0; stroke-width: 1.3; }
.inv-slot .padmargin { stroke: #d64045; stroke-width: 1.2; }
.inv-slot .spiral { stroke: #c9cdd3; stroke-width: 1.8; }
.inv-hint { position: relative; isolation: isolate; padding: 6px 18px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.inv-hint::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 6px; transform: skewX(var(--skew));
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--lip); backdrop-filter: blur(10px);
}
.inv-hint b { margin-right: 10px; font-family: var(--display); font-style: italic; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pastis); }
.inv-hint kbd { font-size: 11px; padding: 0 5px; }
#dial-keys.manual .dk-auto, #dial-keys:not(.manual) .dk-manual, #dial-keys.no-view .dk-view { display: none; }
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
#crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--pastis); }
#hover-tip {
  position: absolute; left: 50%; top: calc(50% + 24px); transform: translateX(-50%); isolation: isolate; white-space: nowrap;
  padding: 6px 18px; font-size: 14.5px; font-weight: 600;
}
#hover-tip::before { border-color: color-mix(in srgb, var(--team) 60%, transparent); }
#hover-tip b { color: var(--team); }
/* Over the cochonnet just thrown, for a few seconds: how far it went (see game.js showJackTip). Like
   the tip over what you look at, but standing on the cochonnet itself: it pops up and bobs. */
#jack-tip { position: absolute; left: 0; top: 0; pointer-events: none; --team: #ff9f1c; transition: opacity 0.3s; will-change: transform; }
#jack-tip.gone { opacity: 0; }
#jack-tip .jt-in {
  position: relative; isolation: isolate; white-space: nowrap; padding: 6px 18px; font-size: 14.5px; font-weight: 600;
  animation: jtPop 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) both, jtBob 1.2s ease-in-out 0.55s infinite alternate;
}
#jack-tip .jt-in::before { border-color: color-mix(in srgb, var(--team) 70%, transparent); }
#jack-tip .jt-in::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--team); border-bottom-width: 0;
}
#jack-tip b { color: var(--team); }
/* Whoever is in the circle: their licence card, top right (see hud.js setThrower), in their team's
   colour. It slides in for each new thrower. */
#thrower-card { position: absolute; top: 74px; right: 16px; width: 240px; pointer-events: none; --team: #fff; transition: opacity 0.25s, transform 0.25s; }
#thrower-card.in { animation: tcIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
#thrower-card.gone { opacity: 0; transform: translateX(40px); }
#thrower-card .tc-card canvas {
  display: block; width: 100%; border-radius: 9px;
  box-shadow: 0 0 0 3px var(--team), 0 5px 0 3px color-mix(in srgb, var(--team) 55%, #000), 0 12px 28px rgba(0, 0, 0, 0.45);
}
#thrower-card .tc-tag {
  position: relative; isolation: isolate; display: inline-block; margin: 0 0 9px 4px; padding: 3px 12px;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--night);
}
#thrower-card .tc-tag::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--skew)); background: var(--team); }
@keyframes tcIn { from { opacity: 0; transform: translateX(70px) rotate(5deg); } to { opacity: 1; transform: none; } }
/* XPetanX: the cards on a team (under its players), and the winner's draw after a mène. */
.tb-fx { display: flex; gap: 4px; margin-top: 2px; }
.fx-chip {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-size: 15px; pointer-events: auto;
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--lip);
}
.fx-chip.buff { border-color: var(--good); }
.fx-chip.penalty { border-color: var(--tomato); }
#draft {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; text-align: center; pointer-events: auto;
  background: var(--navy); border: 2px solid var(--team); border-radius: 16px; padding: 18px 22px 14px; box-shadow: 0 6px 0 var(--lip), var(--shadow);
  animation: coachIn 0.35s cubic-bezier(0.2, 1.2, 0.3, 1);
}
#draft h3 { margin: 0 0 14px; font-family: var(--display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--team); }
#draft small { display: block; margin-top: 12px; color: var(--ink-3); font-size: 12px; }
.dr-cards { display: flex; gap: 14px; }
.dr-card {
  width: 168px; min-height: 210px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 12px 14px; cursor: pointer;
  font: inherit; color: var(--ink); background: var(--navy-2); border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 4px 0 var(--lip);
  transition: transform 0.12s, border-color 0.12s;
}
.dr-card.buff { border-color: color-mix(in srgb, var(--good) 70%, transparent); }
.dr-card.penalty { border-color: color-mix(in srgb, var(--tomato) 70%, transparent); }
.dr-card:not(:disabled):hover { transform: translateY(-6px) rotate(-1deg); }
.dr-card:disabled { cursor: default; opacity: 0.85; }
.dr-kind { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.dr-card.buff .dr-kind { color: var(--good); }
.dr-card.penalty .dr-kind { color: var(--tomato); }
.dr-icon { font-size: 46px; line-height: 1.1; }
.dr-card b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 16px; }
.dr-desc { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
@keyframes jtPop { from { opacity: 0; transform: translateY(18px) scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes jtBob { from { transform: translateY(0); } to { transform: translateY(-7px); } }

/* Tutorial coach card. */
#coach {
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%); width: 350px; z-index: 18; pointer-events: none;
  background: var(--navy); border: 2px solid var(--pastis); border-radius: 14px; padding: 16px 20px 18px;
  box-shadow: 0 6px 0 var(--pastis-lip), var(--shadow); animation: coachIn 0.35s cubic-bezier(0.2, 1.2, 0.3, 1);
}
#coach.at-dial { left: auto; top: auto; right: 260px; bottom: 70px; transform: none; }
#coach.at-dial::after {
  content: ''; position: absolute; right: -10px; bottom: 120px; width: 16px; height: 16px; transform: rotate(45deg);
  background: var(--navy); border-top: 2px solid var(--pastis); border-right: 2px solid var(--pastis);
}
.coach-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#coach-progress {
  display: inline-block; padding: 3px 12px 2px; border-radius: 4px; transform: skewX(var(--skew));
  font-family: var(--display); font-weight: 900; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--night); background: var(--pastis);
}
#coach-skip { pointer-events: auto; font-size: 11.5px; color: var(--ink-3); }
#coach h3 { font-family: var(--display); font-style: italic; font-size: 22px; font-weight: 900; line-height: 1.1; text-transform: uppercase; margin-bottom: 8px; }
#coach p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
#coach p b { color: var(--ink); }
#coach-enter { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
@keyframes coachIn { from { opacity: 0; margin-top: 12px; } to { opacity: 1; margin-top: 0; } }
body.coach-dial #swing-dial { animation: dialPulse 1.4s ease-in-out infinite; }
@keyframes dialPulse {
  0%, 100% { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 210, 63, 0.95)); }
}
body.tutorial #btn-rematch, body.tutorial #btn-end-lobby, body.tutorial #btn-pause-lobby { display: none !important; }

/* Close-up on a hit: cinematic bars, HUD tucked away. */
.letterbox { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 15; pointer-events: none; transition: height 0.25s ease; }
#letterbox-top { top: 0; }
#letterbox-bottom { bottom: 0; }
body.closeup .letterbox { height: 9vh; }
body.closeup #swing-dial, body.closeup #dial-keys, body.closeup #hint { opacity: 0; }

/* The replay of the boule that won the mène (see replay.js), like a TV replay: in the black bars, a
   red REPLAY tag and the angle at the top, who threw it and what it did at the bottom; a white flash
   at each cut. */
#ui > #replay { position: fixed; inset: 0; z-index: 16; pointer-events: none; }
#replay .rp-top, #replay .rp-bottom { position: absolute; left: 0; right: 0; height: 9vh; display: flex; align-items: center; gap: 18px; padding: 0 30px; }
#replay .rp-top { top: 0; }
#replay .rp-bottom { bottom: 0; justify-content: space-between; }
.rp-live {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 11px; color: #fff;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase;
}
.rp-live::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--skew)); background: var(--tomato); box-shadow: 0 3px 0 var(--tomato-lip); }
.rp-live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rpBlink 1.1s steps(2, start) infinite; }
@keyframes rpBlink { to { visibility: hidden; } }
#rp-angle { font-family: var(--display); font-size: 13px; font-weight: 800; font-stretch: 90%; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
#rp-caption { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
#rp-caption > b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 21px; letter-spacing: 0.02em; text-transform: uppercase; }
#rp-caption .rp-score { position: relative; isolation: isolate; padding: 2px 14px; margin-left: 4px; color: #fff; animation: rpScore 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
#rp-caption .rp-score::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 4px; transform: skewX(var(--skew)); background: var(--team); box-shadow: 0 3px 0 var(--lip); }
@keyframes rpScore { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rp-skip { font-size: 13px; color: var(--ink-3); }
#rp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#rp-flash.go { animation: rpFlash 0.38s ease-out; }
@keyframes rpFlash { from { opacity: 0.5; } to { opacity: 0; } }
body.replay :is(#turn-banner, #hint, #hover-tip, #jack-tip, #thrower-card, #draft, #crosshair, #swing-dial, #dial-keys, #emote-wheel, #mene-banner, #topbar) { display: none !important; }
body.replay #inventory { opacity: 0; visibility: hidden; }

/* Between two mènes, top right: how it went, who's ready for the next one (see hud.js setBreak), and
   the countdown. Like the seats, above the game menu so that its button can be clicked once Esc has
   freed the mouse. */
#break {
  position: absolute; top: 74px; right: 16px; z-index: 21; width: 272px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 10px; border-radius: 12px;
  background: var(--plate); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--lip), var(--shadow); backdrop-filter: blur(10px);
  animation: brkIn 0.4s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes brkIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
#hud > #break { pointer-events: auto; }
#break .seats-head small { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#break:not(.locked) .seats-hint { display: none; }
#break:not(.hidden) ~ #seats { top: auto; bottom: 24px; transform: none; }
.brk-row {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 9px; border-radius: 9px; background: var(--well);
  border: 2px solid var(--line); border-left: 4px solid var(--team); transition: background 0.2s, border-color 0.2s;
}
.brk-row .ball-dot { width: 16px; height: 16px; }
.brk-row b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brk-row.me b { color: var(--pastis); }
.brk-state { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.brk-row.ready { background: rgba(63, 224, 160, 0.09); border-color: rgba(63, 224, 160, 0.42); border-left-color: var(--team); }
.brk-row.ready .brk-state { color: var(--good); }
.brk-row.ready .brk-state::before { content: '✓ '; }
.brk-clock { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.brk-clock small { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.brk-clock b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 36px; line-height: 1; color: var(--pastis); font-variant-numeric: tabular-nums; text-shadow: 3px 3px 0 var(--lip); }
.brk-clock b i { font-size: 18px; margin-left: 2px; }
.brk-clock.go b, .brk-clock.go small { color: var(--good); }
.brk-clock.wait small { font-size: 12px; font-weight: 500; color: var(--ink-3); line-height: 1.4; }
.brk-key {
  display: flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 12px; border: none; border-radius: 9px; cursor: pointer;
  font: 800 14px var(--ui); color: var(--night); background: var(--pastis); box-shadow: 0 4px 0 var(--pastis-lip);
}
.brk-key:hover { background: var(--pastis-2); }
.brk-key kbd { background: var(--night); color: var(--pastis); box-shadow: none; }
.brk-key.on { color: var(--good); background: rgba(63, 224, 160, 0.12); box-shadow: inset 0 0 0 2px var(--good), 0 4px 0 var(--lip); }
.brk-key.on kbd { background: var(--good); color: var(--night); }
.brk-key.off { cursor: default; padding: 2px; font-size: 13px; font-weight: 600; color: var(--ink-3); background: none; box-shadow: none; }

/* Training: drill cards with a little map of each exercise. */
.training { width: min(1120px, 100%); }
.training-total { margin-left: auto; font-family: var(--display); font-style: italic; font-size: 16px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.training-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.training-drills { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.training-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }

.drills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.drills.free { grid-template-columns: 1fr; gap: 10px; }
.drills.free .drill { padding: 8px 12px 8px 8px; }
.drills.free .dr-map { width: 30px; height: 54px; }
.drill {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; gap: 12px; align-items: stretch;
  padding: 10px 12px 10px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--navy-2); box-shadow: 0 4px 0 var(--lip);
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1), border-color 0.12s, background 0.12s;
}
.drill:hover { transform: translateY(-3px); border-color: var(--pastis); background: var(--navy-3); }
.drill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.drill:hover .dr-map .lane { fill: rgba(255, 244, 222, 0.1); }
.dr-map { width: 46px; height: 84px; flex: none; }
.dr-map .lane { fill: rgba(255, 244, 222, 0.05); stroke: rgba(255, 244, 222, 0.2); stroke-width: 1; transition: fill 0.15s; }
.dr-map .ring-throw { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; }
.dr-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dr-text b { font-family: var(--display); font-style: italic; font-size: 14.5px; font-weight: 900; text-transform: uppercase; line-height: 1.15; }
.dr-text small { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.dr-best { margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stars { display: inline-flex; gap: 1px; }
.stars i { font-style: normal; color: rgba(255, 244, 222, 0.18); }
.stars i.on { color: var(--pastis); text-shadow: 0 0 10px rgba(255, 210, 63, 0.45); }
.stars.big { font-size: 34px; gap: 4px; }
.zone-key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; vertical-align: -1px; margin: 0 2px 0 6px; }
.zone-key.land { border-color: #ffb020; }

/* Points per boule: in the drill panel and at the end of a drill. */
.pip {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 11.5px; font-weight: 800;
  border: 2px solid rgba(255, 244, 222, 0.22); color: var(--ink-3);
}
.pip.next { border-color: rgba(255, 244, 222, 0.65); }
.pip.p0 { background: rgba(255, 91, 58, 0.18); border-color: rgba(255, 91, 58, 0.6); color: #ffb3a3; }
.pip.p1, .pip.p2 { background: rgba(63, 224, 160, 0.16); border-color: rgba(63, 224, 160, 0.6); color: #a9f5d6; }
.pip.p3 { background: var(--pastis); border-color: var(--pastis); color: var(--night); }
#practice-panel .pips { display: flex; gap: 5px; }
.zone-legend { display: flex; gap: 10px; font-size: 12.5px; }
.zone-legend .zone-key { margin-left: 0; }
.drill-results { list-style: none; margin: 4px auto 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; width: min(460px, 100%); }
.drill-results li { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 8px; background: rgba(255, 244, 222, 0.05); font-size: 14px; }
.end-score small { font-size: 0.42em; color: var(--ink-3); margin-left: 4px; text-shadow: none; }
#end-sub .stars.big { margin-right: 12px; vertical-align: -6px; }
body:not(.drill-end) #btn-next-drill, body:not(.drill-end) #btn-end-training { display: none; }
body.drill-end #btn-end-lobby { display: none !important; }

@media (max-width: 1000px) {
  .training-body { grid-template-columns: 1fr; }
  .training-side { position: static; }
  #practice-map-cards { grid-template-columns: repeat(4, 1fr); }
  .drills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- licence card ---------- */
/* A club player's licence in the style of the FFPJP's: a cream card printed with a fine guilloche, a
   navy band with the federation's crest, the tricolour, an ID photo with the club's stamp over its
   corner, a QR code. Sized in em: --lw, the card's width, sets everything. */
.licence {
  --lw: 440px; --ln: #1c2f7a; --lr: #d42a35;
  --paper: repeating-radial-gradient(circle at 82% 140%, rgba(28, 47, 122, 0.06) 0 0.07em, transparent 0.07em 0.5em),
    repeating-radial-gradient(circle at 6% -60%, rgba(212, 42, 53, 0.05) 0 0.07em, transparent 0.07em 0.65em);
  position: relative; flex: none; width: var(--lw); aspect-ratio: 85.6 / 54; font-size: calc(var(--lw) / 44);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 1.3em; color: #1b2340; text-align: left; user-select: none;
  background: repeating-radial-gradient(circle at 82% 140%, rgba(28, 47, 122, 0.06) 0 0.07em, transparent 0.07em 0.5em),
    repeating-radial-gradient(circle at 6% -60%, rgba(212, 42, 53, 0.05) 0 0.07em, transparent 0.07em 0.65em), #fbf7ec;
  box-shadow: 0 0.25em 0 #b9ae95, 0 1.6em 3.6em rgba(2, 5, 20, 0.55);
}
/* The holographic sheen, crossing the card as you hover it. */
.licence::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: soft-light;
  background: linear-gradient(112deg, transparent 32%, rgba(255, 255, 255, 0.85) 44%, rgba(140, 220, 255, 0.6) 50%, rgba(255, 170, 230, 0.55) 56%, transparent 68%) 130% 0 / 260% 100% no-repeat;
  transition: background-position 1.1s ease;
}
.licence:hover::after { background-position: -30% 0; }
.lc-head { flex: none; display: flex; align-items: center; gap: 1em; height: 6.2em; padding: 0 1.6em 0 1.1em; background: var(--ln); color: #fff; }
.lc-crest { flex: none; width: 4.5em; height: 4.5em; }
.lc-fed { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.12; font-family: 'Fraunces', Georgia, serif; }
.lc-fed b { font-size: 1.6em; font-weight: 800; }
.lc-fed small { font-size: 1.1em; font-style: italic; font-weight: 500; opacity: 0.82; }
.lc-season { display: flex; flex-direction: column; align-items: flex-end; line-height: 0.95; font-family: var(--display); }
.lc-season small { font-size: 0.95em; font-weight: 800; letter-spacing: 0.32em; margin-right: -0.32em; text-transform: uppercase; opacity: 0.78; }
.lc-season b { font-size: 2.8em; font-style: italic; font-weight: 900; color: var(--pastis); }
.lc-flag { flex: none; height: 0.55em; background: linear-gradient(90deg, #2a4fd8 0 33.4%, #fff 33.4% 66.6%, var(--lr) 66.6%); }
.lc-body {
  position: relative; flex: 1; min-height: 0; display: grid; column-gap: 1.5em; row-gap: 0.4em; padding: 1.3em 1.6em 0.8em;
  grid-template-columns: 11.4em minmax(0, 1fr) 5.8em; grid-template-rows: auto auto auto 1fr auto;
  grid-template-areas: 'photo name name' 'photo num num' 'photo club club' 'photo dept qr' 'photo pair qr';
}
.lc-photo { grid-area: photo; position: relative; align-self: start; width: 11.4em; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 0.5em; background: #e6e0d0; box-shadow: inset 0 0 0 0.12em rgba(28, 47, 122, 0.22); }
.lc-photo img, .lc-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-sil { position: absolute; left: 12%; bottom: 0; width: 76%; fill: rgba(28, 47, 122, 0.2); }
.lc-stamp {
  position: absolute; left: 7.7em; top: 10.5em; width: 6.6em; height: 6.6em; transform: rotate(-17deg); pointer-events: none;
  fill: none; stroke: var(--lr); stroke-width: 1.4; opacity: 0.8; mix-blend-mode: multiply;
}
.lc-stamp text { fill: var(--lr); stroke: none; font: 800 6.4px var(--ui); letter-spacing: 0.06em; }
.lc-stamp text.mid { font-size: 6.6px; text-anchor: middle; letter-spacing: 0.14em; }
.lc-stamp .fill { fill: var(--lr); stroke: none; }
.lc-f { display: flex; flex-direction: column; min-width: 0; }
.lc-k { font-size: 0.78em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(28, 47, 122, 0.58); }
.lc-v { font-size: 1.3em; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-v.small { font-size: 1.12em; }
.lc-v.num { font-family: var(--display); font-weight: 800; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; color: var(--lr); }
.lc-namebox { grid-area: name; }
.lc-name { font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 82%; font-size: 2.45em; line-height: 1.05; text-transform: uppercase; color: var(--ln); }
.lc-num { grid-area: num; }
.lc-club { grid-area: club; }
.lc-dept { grid-area: dept; }
.lc-pair { grid-area: pair; display: flex; gap: 1.4em; min-width: 0; }
.lc-qr { grid-area: qr; align-self: end; width: 5.8em; height: 5.8em; padding: 0.3em; background: #fff; border-radius: 0.35em; box-shadow: inset 0 0 0 0.1em rgba(28, 47, 122, 0.18); }
.lc-qr svg { display: block; width: 100%; height: 100%; }
.lc-foot {
  flex: none; display: flex; justify-content: space-between; align-items: center; height: 2.6em; padding: 0 1.95em; font-size: 0.82em;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(28, 47, 122, 0.7); background: rgba(28, 47, 122, 0.08);
}
.lc-foot span:last-child { font-family: var(--display); font-style: italic; font-weight: 900; letter-spacing: 0.06em; color: var(--lr); }

/* A club's card: its art under everything (see card-art.js); of the federation, only its plate in the
   corner (crest and season); the fields in the club's ink. */
.licence.designed { background-image: var(--art), var(--paper); background-size: 100% 100%, auto, auto; background-repeat: no-repeat, repeat, repeat; }
.licence.designed .lc-head {
  position: absolute; top: 0.9em; right: 1.2em; z-index: 1; height: 4.3em; gap: 0.35em; padding: 0 0.7em 0 0.35em; border-radius: 0.7em;
  box-shadow: 0 0.1em 0.4em rgba(0, 0, 0, 0.25);
}
.licence.designed .lc-crest { width: 3.6em; height: 3.6em; }
.licence.designed .lc-fed { display: none; }
.licence.designed .lc-season small { font-size: 0.75em; letter-spacing: 0.14em; margin-right: 0; }
.licence.designed .lc-season b { font-size: 2.2em; }
.licence.designed .lc-flag { visibility: hidden; margin-top: 6.2em; }
.licence.designed .lc-foot { background: none; }
.licence.ink-light .lc-k { color: rgba(255, 255, 255, 0.75); }
.licence.ink-light .lc-v, .licence.ink-light .lc-name { color: #fff; }
.licence.ink-light .lc-v.num, .licence.ink-light .lc-foot span:last-child { color: var(--pastis); }
.licence.ink-light .lc-foot { color: rgba(255, 255, 255, 0.8); }
.licence.ink-light .lc-k, .licence.ink-light .lc-v, .licence.ink-light .lc-foot { text-shadow: 0 0.05em 0.3em rgba(0, 0, 0, 0.55); }

/* Someone's card, pulled out over the lobby. */
.licence-pop { z-index: 30; flex-direction: column; gap: 16px; cursor: pointer; }
.licence-pop .licence { --lw: min(520px, calc(100vw - 56px)); cursor: default; animation: lc-out 0.5s cubic-bezier(0.2, 1.3, 0.35, 1); }
@keyframes lc-out { from { opacity: 0; transform: translateY(46px) rotate(-9deg) scale(0.86); } to { opacity: 1; transform: none; } }
.lc-pop-hint { color: var(--ink-3); font-size: 13px; }
/* In the lobby, a name opens its card. */
.lc-link { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lc-link:hover { color: var(--pastis); text-decoration: underline; text-underline-offset: 3px; }

/* The editor: the card, its photo framed by dragging, and the form. */
.licence-panel { width: min(1000px, 100%); }
.licence-body { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.licence-stage { display: flex; flex-direction: column; gap: 14px; }
.licence-stage .licence { --lw: min(480px, calc(100vw - 120px)); }
.licence.editing .lc-photo { cursor: grab; touch-action: none; }
.licence.editing .lc-photo:active { cursor: grabbing; }
.licence.dropping { outline: 0.3em dashed var(--pastis); outline-offset: 0.5em; }
.lc-add {
  position: absolute; inset: 0; display: none; place-items: center; align-content: end; gap: 0.6em; width: 100%; padding: 0; overflow: hidden;
  border: 0.15em dashed rgba(28, 47, 122, 0.4); border-radius: inherit; background: #e6e0d0; color: var(--ln); font: 700 1.2em var(--ui); cursor: pointer;
}
.lc-add .lc-sil { position: static; width: 76%; }
.lc-add b { order: -1; }
.lc-add:hover { background: #ece6d6; border-color: var(--ln); }
.licence.no-photo .lc-add { display: grid; }
.lc-photo-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lc-zoom { display: flex; align-items: center; gap: 10px; margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lc-zoom input { width: 150px; }
.lc-hint { color: var(--ink-3); font-size: 12.5px; }
.licence-form { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
.lc-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lc-privacy { font-size: 12.5px; color: var(--ink-3); border-top: 2px dashed var(--line); padding-top: 12px; }

/* ---------- concours du village ---------- */
/* In a concours, its matches have no rematch, no lobby, no places to take: the bracket instead. */
body:not(.in-concours) .concours-only { display: none !important; }
body.in-concours :is(#btn-rematch, #btn-end-lobby, #btn-end-quit, #btn-pause-lobby, #btn-quit, #seats) { display: none !important; }
.concours .lobby-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.concours .lobby-settings select { width: 100%; min-width: 0; }
/* With the bracket: as wide as its rounds need (about 224px a round, 380px for the chat and the
   edges), up to the whole screen; the chat goes under it when both don't fit (ConcoursView.fit). */
.panel.concours.has-bracket { width: min(100%, max(1060px, calc(var(--rounds) * 224px + 380px))); }
.panel.concours.chat-below { grid-template-columns: minmax(0, 1fr); }
.panel.concours.chat-below .lobby-side { min-height: 220px; }
/* The start (and the score so far) stays in sight below however many teams there are (down to the
   panel's edge, past its padding). */
.concours .lobby-foot {
  position: sticky; bottom: -30px; z-index: 2; margin: 0 -32px -30px; padding: 12px 32px 14px;
  background: var(--navy); border-top: 2px dashed var(--line);
}
#cc-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#cc-setup { display: flex; flex-direction: column; gap: 12px; }
.lobby-foot #cc-status { flex: 1; font-size: 14px; }
/* Sign-up: a card per team, then those without one. */
.cc-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cc-team {
  --team-c: var(--navy-3); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px;
  border: 2px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--team-c) 40%, var(--navy)), var(--navy) 70%); box-shadow: 0 5px 0 var(--lip);
}
.cc-team.mine { --team-c: #8a6a10; border-color: var(--pastis); }
.cc-team.bots { --team-c: #3a4256; }
.cc-team .team-title { max-width: 100%; }
.cc-team .team-list { min-height: 0; }
.cc-team .team-list li { padding: 5px 9px; font-size: 14px; }
.cc-team .team-list li.bot { color: var(--ink-2); font-weight: 500; }
.cc-team .team-list li.bot .ball-dot { opacity: 0.45; }
.cc-new {
  font: inherit; color: var(--ink-2); cursor: pointer; align-items: center; justify-content: center; text-align: center; min-height: 120px;
  background: rgba(255, 244, 222, 0.03); border: 2px dashed var(--line-2); box-shadow: none; transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.cc-new b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 17px; text-transform: uppercase; color: var(--pastis); }
.cc-new:hover { border-color: var(--pastis); color: var(--ink); transform: translateY(-2px); }
.cc-loose .spec-icon svg { fill: none; stroke: currentColor; stroke-width: 2; }
.cc-loose .spec-icon circle { fill: currentColor; stroke: none; }
/* Where you are, in a line; then the podium; then the bracket. */
.cc-now { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--well); border: 2px solid var(--line); }
.cc-now p { flex: 1; font-size: 15px; line-height: 1.4; }
.cc-now p:empty { display: none; }
.cc-now.go { border-color: var(--pastis); }
.cc-now.gold { border-color: var(--pastis); background: linear-gradient(100deg, rgba(255, 210, 63, 0.18), var(--well) 70%); }
.cc-now .btn { flex: none; }
.cc-podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-top: 6px; }
.pod {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; width: 190px; padding: 12px 10px 14px; border-radius: 12px 12px 4px 4px;
  background: var(--navy-2); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--lip);
}
.pod.p1 { min-height: 168px; border-color: var(--pastis); background: linear-gradient(180deg, rgba(255, 210, 63, 0.24), var(--navy-2) 75%); }
.pod.p2 { min-height: 134px; }
.pod-text { display: flex; flex-direction: column; align-items: inherit; gap: 2px; }
.pod.p3 { flex-direction: row; text-align: left; gap: 10px; width: 230px; padding: 8px 12px; border-radius: 10px; }
.pod.me { outline: 3px solid var(--pastis); outline-offset: 2px; }
.pod-3 { display: flex; flex-direction: column; gap: 8px; }
.pod-icon { font-size: 34px; line-height: 1.1; }
.pod.p1 .pod-icon { font-size: 46px; }
.pod.p3 .pod-icon { font-size: 22px; }
.pod small { font-family: var(--display); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pastis); }
.pod b { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 16px; text-transform: uppercase; line-height: 1.1; }
.pod-who { color: var(--ink-3); font-size: 12px; line-height: 1.3; }
/* The bracket: a column per round, each match level with the middle of the two it comes from;
   a bracket joins each pair of matches to the one their winners go on to. */
.bracket { display: flex; gap: 28px; overflow-x: auto; padding: 2px 2px 10px; }
.br-round { flex: 1 0 196px; display: flex; flex-direction: column; gap: 8px; }
.br-round h5 {
  font-family: var(--display); font-size: 12px; font-weight: 800; font-stretch: 88%; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); text-align: center;
}
.br-col, .br-pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.br-pair { position: relative; }
.br-pair::after {
  content: ''; position: absolute; right: -15px; top: 25%; bottom: 25%; width: 13px;
  border: 2px solid var(--line-2); border-left: none; border-radius: 0 7px 7px 0;
}
.br-round + .br-round .br-match::before { content: ''; position: absolute; left: -15px; top: 50%; width: 13px; border-top: 2px solid var(--line-2); }
.br-match { position: relative; margin: 4px 0; border-radius: 9px; background: var(--well); border: 2px solid var(--line); }
.br-match.mine { border-color: var(--pastis); }
.br-match.st-live:not(.mine) { border-color: rgba(63, 224, 160, 0.55); }
.br-team { display: flex; align-items: center; gap: 8px; padding: 4px 9px; font-size: 13.5px; font-weight: 600; }
.br-team + .br-team { border-top: 1px solid var(--line); }
.br-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-name i { color: var(--ink-3); font-weight: 500; }
.br-score { font-family: var(--display); font-style: italic; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.br-team.win { color: var(--pastis); }
.br-team.lost { color: var(--ink-3); }
.br-team.me .br-name::before { content: '★ '; color: var(--pastis); }
.br-foot { display: flex; align-items: center; gap: 8px; min-height: 22px; padding: 2px 9px 3px; font-size: 11.5px; color: var(--ink-3); border-top: 1px dashed var(--line); }
.br-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.br-foot .live { color: var(--good); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.br-foot .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.br-watch {
  margin-left: auto; font: inherit; font-weight: 800; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  color: var(--night); background: var(--pastis); border: none; border-radius: 5px; padding: 3px 8px 2px; box-shadow: 0 2px 0 var(--pastis-lip);
}
.br-watch:hover { background: var(--pastis-2); }
.chat-box .chat-line.news { color: var(--pastis); }
@media (max-width: 900px) {
  .concours .lobby-settings { grid-template-columns: 1fr 1fr; }
  .cc-podium { flex-wrap: wrap; }
}
/* A hat still to win (La Coupe: a Concours du village). */
.chip.locked { opacity: 0.45; cursor: default; transform: none; }
.chip.locked::before { content: '🔒 '; }

/* ---------- your club (see clubs.js) ---------- */
.club-panel { width: min(1000px, 100%); }
.club-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.club-cols h3 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 22px; text-transform: uppercase; margin-bottom: 10px; }
.club-cols h4 { font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pastis); margin: 16px 0 8px; }
.club-find, .club-new, .club-info, .club-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.club-new { padding: 16px 18px; border-radius: 12px; background: var(--well); border: 2px solid var(--line); }
.club-search { width: 100%; }
.club-asked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 2px dashed var(--pastis); font-size: 14px; }
.club-asked span { flex: 1; }
.club-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.club-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: var(--well); border: 2px solid var(--line); font-size: 14px; }
.club-list li.empty { justify-content: center; color: var(--ink-3); border-style: dashed; background: none; }
.club-list li .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.club-list li .grow b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-list li .grow small { color: var(--ink-3); font-size: 12px; }
.club-list .tag {
  font-family: var(--display); font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--night); background: var(--pastis); border-radius: 4px; padding: 2px 7px 1px;
}
.club-thumb { flex: none; width: 64px; aspect-ratio: 85.6 / 54; border-radius: 5px; background: #fbf7ec center / 100% 100% no-repeat; display: grid; place-items: center; box-shadow: 0 2px 0 var(--lip); }
.club-thumb svg { width: 26px; height: 26px; }
.club-card .licence { --lw: min(460px, calc(100vw - 120px)); }
.club-card > .btn { align-self: flex-start; }
.club-info select { width: 100%; }
@media (max-width: 900px) { .club-cols { grid-template-columns: 1fr; } }

/* ---------- the club's card designer (see card-designer.js) ---------- */
.designer-panel { width: min(1180px, 100%); }
.ds-club { margin-left: auto; font-family: var(--display); font-style: italic; font-weight: 900; color: var(--pastis); text-transform: uppercase; }
.ds-body { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.ds-stage { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ds-frame {
  position: relative; width: 100%; aspect-ratio: 1024 / 646; border-radius: calc(1.3 / 44 * 100%) / calc(1.3 / 27.75 * 100%); overflow: hidden;
  background: repeating-radial-gradient(circle at 82% 140%, rgba(28, 47, 122, 0.06) 0 1.6px, transparent 1.6px 11.6px),
    repeating-radial-gradient(circle at 6% -60%, rgba(212, 42, 53, 0.05) 0 1.6px, transparent 1.6px 15px), #fbf7ec;
  box-shadow: 0 0.25em 0 #b9ae95, 0 20px 50px rgba(2, 5, 20, 0.5);
}
.ds-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ds-art { touch-action: none; cursor: crosshair; }
#ds-art[data-tool='bucket'] { cursor: cell; }
#ds-art[data-tool='text'] { cursor: text; }
#ds-over { pointer-events: none; opacity: 0.85; }
#ds-text {
  position: absolute; z-index: 2; transform: translateY(-50%); min-width: 160px; padding: 2px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.85); border: 2px dashed var(--navy-3); box-shadow: none;
}
.ds-checks { display: flex; gap: 22px; flex-wrap: wrap; }
.ds-check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ds-check .check { width: 22px; height: 22px; }
.ds-check .check::before { left: 5px; top: 1px; width: 6px; height: 11px; border-width: 0 3px 3px 0; }
.ds-tools { flex: 0 1 300px; display: flex; flex-direction: column; gap: 14px; }
.ds-group { display: flex; gap: 6px; flex-wrap: wrap; }
.ds-tool {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 7px; border-radius: 10px; cursor: pointer;
  font: 800 11px var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
  background: var(--well); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--lip);
}
.ds-tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ds-tool:hover { color: var(--ink); border-color: var(--line-2); }
.ds-tool.on { color: var(--night); background: var(--pastis); border-color: var(--pastis); box-shadow: 0 3px 0 var(--pastis-lip); }
.ds-colors { display: flex; align-items: center; gap: 10px; }
.ds-colors input[type='color'] { flex: none; }
.ds-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; flex: 1; }
.ds-swatch { aspect-ratio: 1; border-radius: 6px; cursor: pointer; background: var(--c); border: 2px solid rgba(255, 244, 222, 0.25); }
.ds-swatch.on { outline: 3px solid var(--pastis); outline-offset: 1px; }

/* Your signature (see signature.js): drawn on a strip like the one on the back of the card. */
.sig-pad {
  display: block; width: 100%; max-width: 460px; aspect-ratio: 5 / 1; border-radius: 8px; cursor: crosshair; touch-action: none;
  background: #f4efe2; border: 2px dashed rgba(28, 47, 122, 0.35);
}
.sig-clear { align-self: flex-start; }
.club-sig { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--well); border: 2px solid var(--line); }
.club-sig.unsigned { border-color: var(--pastis); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.18); }
.club-sig b { font-family: var(--display); font-style: italic; font-weight: 900; text-transform: uppercase; }
.club-sig small { color: var(--ink-3); font-size: 12.5px; }
.club-sig .row { justify-content: flex-end; }
.club-sig .row > .btn { flex: 0 0 auto; }
