:root {
  --night: #111128;
  --paper: #f4f0df;
  --lime: #d8ff43;
  --blue: #4255ff;
  --pink: #ff5c9a;
  --orange: #ff774d;
  --line: rgba(17,17,40,.18);
  --muted: #777386;
  --shadow: 7px 7px 0 var(--night);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--night);
  background: var(--blue);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    var(--blue);
  background-size: 28px 28px;
}
.noise { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

#app { width: min(760px, 100%); min-height: 100dvh; margin: 0 auto; padding: 18px clamp(14px, 4vw, 28px) calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--paper); }
.back { justify-self: start; font-family: "DM Mono", monospace; font-size: .68rem; letter-spacing: .08em; opacity: .8; }
.wordmark { position: relative; display: flex; align-items: center; font-family: "Archivo Black", sans-serif; font-size: clamp(1.65rem, 6vw, 2.6rem); line-height: .8; letter-spacing: -.08em; transform: rotate(-1deg); }
.wordmark .one { color: var(--lime); margin-left: .1em; }
.wordmark small { position: absolute; width: 100%; top: 110%; left: 0; font-family: "DM Mono", monospace; font-size: .38em; font-weight: 500; letter-spacing: .15em; text-align: center; }
.icon-btn { justify-self: end; width: 38px; height: 38px; border: 2px solid var(--night); border-radius: 50%; background: var(--lime); box-shadow: 3px 3px 0 var(--night); font-family: "Archivo Black", sans-serif; cursor: pointer; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.lang-btn { height: 34px; padding: 0 9px; color: var(--paper); border: 1.5px solid var(--paper); background: var(--night); font: 500 .66rem "DM Mono", monospace; letter-spacing: .08em; cursor: pointer; }
main { flex: 1; width: 100%; }
footer { margin-top: 25px; display: flex; align-items: center; gap: 10px; color: var(--paper); font: 500 .6rem "DM Mono", monospace; letter-spacing: .08em; opacity: .7; }
footer i { flex: 1; height: 1px; background: currentColor; }

.hero { margin: clamp(28px, 8vh, 72px) 0 26px; color: var(--paper); }
.hero .counter { display: inline-block; padding: 4px 8px; margin-bottom: 10px; color: var(--night); background: var(--lime); font: 500 .67rem "DM Mono", monospace; transform: rotate(-2deg); }
.hero h1 { max-width: 620px; margin: 0; font: 400 clamp(3.25rem, 12vw, 7.5rem)/.78 "Archivo Black", sans-serif; letter-spacing: -.075em; text-transform: uppercase; }
.hero h1 em { display: block; color: var(--lime); font-style: normal; }
.hero p { max-width: 42ch; margin: 24px 0 0; font-size: clamp(.87rem, 2.6vw, 1rem); line-height: 1.5; font-weight: 600; }

.panel, .receipt { position: relative; margin-bottom: 18px; padding: clamp(18px, 4vw, 28px); background: var(--paper); border: 2px solid var(--night); box-shadow: var(--shadow); }
.panel::after, .receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: linear-gradient(135deg, var(--paper) 5px, transparent 0) 0 0/10px 10px repeat-x; }
.panel-title, .eyebrow { margin: 0 0 15px; font: 500 .68rem "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.panel-title { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 11px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.mode { min-height: 214px; padding: 18px; display: flex; flex-direction: column; text-align: left; border: 2px solid var(--night); background: var(--paper); box-shadow: 5px 5px 0 var(--night); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.mode:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--night); }
.mode.primary { background: var(--lime); }
.mode-no { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: auto; border: 2px solid var(--night); border-radius: 50%; font: 500 .72rem "DM Mono", monospace; background: var(--paper); }
.mode b { margin-top: 26px; font: 400 clamp(1.4rem, 5vw, 2rem) "Archivo Black", sans-serif; text-transform: uppercase; }
.mode small { margin-top: 7px; line-height: 1.35; font-weight: 600; opacity: .72; }
.tag { width: max-content; margin-top: 14px; padding: 4px 7px; border: 1px solid var(--night); font: 500 .58rem "DM Mono", monospace; text-transform: uppercase; }

.btn { width: 100%; min-height: 54px; padding: 13px 18px; border: 2px solid var(--night); background: var(--paper); box-shadow: 4px 4px 0 var(--night); font-weight: 800; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.btn:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--night); }
.btn:active:not(:disabled) { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--night); }
.btn.primary { background: var(--lime); }
.btn.pink { background: var(--pink); }
.btn.blue { color: #fff; background: var(--blue); }
.btn.ghost { color: var(--paper); border-color: var(--paper); background: transparent; box-shadow: 4px 4px 0 rgba(17,17,40,.7); }
.btn:disabled { cursor: not-allowed; opacity: .42; }
.btn-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.text-btn { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--paper); font: 500 .7rem "DM Mono", monospace; text-decoration: underline; cursor: pointer; }

.field { width: 100%; height: 56px; padding: 0 15px; margin-bottom: 12px; color: var(--night); border: 2px solid var(--night); border-radius: 0; outline: none; background: #fffdf5; font-weight: 700; }
.field:focus { box-shadow: inset 0 -4px var(--lime); }
.field.code { height: 74px; font: 500 2rem "DM Mono", monospace; letter-spacing: .22em; text-align: center; text-transform: uppercase; }
.input-row { display: grid; grid-template-columns: 1fr 56px; gap: 10px; }
.input-row .field { margin: 0; }
.add { border: 2px solid var(--night); background: var(--lime); box-shadow: 3px 3px 0 var(--night); font: 400 1.6rem "Archivo Black", sans-serif; cursor: pointer; }
.player-list { display: grid; gap: 8px; margin-top: 16px; }
.player { min-height: 46px; padding: 9px 11px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--night); background: #fffdf5; font-weight: 700; }
.player .no { font: 500 .68rem "DM Mono", monospace; opacity: .55; }
.player .status { font: 500 .58rem "DM Mono", monospace; text-transform: uppercase; }
.player .online { color: #398100; }
.player button { border: 0; background: none; font-size: 1.2rem; cursor: pointer; }
.empty { padding: 20px; border: 1px dashed var(--muted); color: var(--muted); text-align: center; font-size: .82rem; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { padding: 8px 10px; border: 1.5px solid var(--night); background: transparent; font: 600 .7rem "DM Mono", monospace; cursor: pointer; }
.cat.on { background: var(--lime); box-shadow: 2px 2px 0 var(--night); }

.room-code { padding: 8px 0 14px; text-align: center; }
.room-code small { display: block; font: 500 .65rem "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.room-code b { display: block; margin-top: 6px; font: 400 clamp(2.8rem, 13vw, 5rem) "Archivo Black", sans-serif; letter-spacing: .08em; }
.share { display: grid; grid-template-columns: 1fr auto; border: 1px dashed var(--night); }
.share span { padding: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 .64rem "DM Mono", monospace; }
.share button { border: 0; border-left: 1px dashed var(--night); background: var(--lime); font-weight: 800; cursor: pointer; }
.waiting { margin: 18px 0; color: var(--paper); text-align: center; font: 500 .72rem "DM Mono", monospace; }
.waiting i { width: 9px; height: 9px; display: inline-block; margin-right: 8px; border-radius: 50%; background: var(--lime); animation: blink 1s steps(2) infinite; }
.error { min-height: 18px; margin: 10px 0; color: #fff; font-size: .78rem; font-weight: 700; text-align: center; }

.question-stage { margin: clamp(26px, 6vh, 58px) 0 22px; text-align: center; }
.question-ticket { position: relative; padding: clamp(26px, 6vw, 44px) clamp(18px, 5vw, 38px); background: var(--paper); border: 2px solid var(--night); box-shadow: 9px 10px 0 var(--night); transform: rotate(-.7deg); }
.question-ticket::before, .question-ticket::after { content: ""; position: absolute; left: -2px; right: -2px; height: 10px; background: linear-gradient(135deg, var(--blue) 6px, transparent 0) 0 0/12px 12px repeat-x; }
.question-ticket::before { top: -2px; transform: rotate(180deg); }
.question-ticket::after { bottom: -10px; }
.question-ticket .eyebrow { color: var(--muted); }
.question-ticket h2 { margin: 18px auto 24px; max-width: 18ch; font: 400 clamp(1.8rem, 7vw, 3.6rem)/1.04 "Archivo Black", sans-serif; letter-spacing: -.04em; }
.question-ticket .unit { display: inline-block; padding: 5px 9px; border: 1px solid var(--night); background: var(--lime); font: 500 .65rem "DM Mono", monospace; text-transform: uppercase; }
.shared-question { margin-bottom: 18px; padding: clamp(16px,4vw,23px); color: var(--night); border: 2px solid var(--night); background: var(--pink); box-shadow: 5px 5px 0 var(--night); }
.shared-question small { display: block; margin-bottom: 8px; font: 500 .64rem "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.shared-question b { display: block; font: 400 clamp(1.25rem,4.5vw,2rem)/1.12 "Archivo Black", sans-serif; letter-spacing: -.035em; }
.answer-wrap { position: relative; width: min(340px, 100%); margin: 20px auto 12px; }
.answer-input { width: 100%; height: 92px; padding: 0 55px 0 18px; border: 3px solid var(--night); outline: none; background: #fff; font: 400 clamp(2.4rem, 12vw, 4.3rem) "Archivo Black", sans-serif; text-align: center; }
.answer-input:focus { box-shadow: inset 0 -8px var(--lime); }
.answer-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 500 .7rem "DM Mono", monospace; }
.privacy { max-width: 44ch; margin: 18px auto; color: var(--paper); font-size: .78rem; line-height: 1.5; text-align: center; }

.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.answer-card { position: relative; min-height: 126px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; border: 2px solid var(--night); background: var(--paper); box-shadow: 4px 4px 0 var(--night); animation: pop .3s both; }
.answer-card:nth-child(3n+2) { background: var(--lime); transform: rotate(.5deg); }
.answer-card:nth-child(3n) { background: #fff; transform: rotate(-.6deg); }
.answer-card small { font: 500 .64rem "DM Mono", monospace; text-transform: uppercase; }
.answer-card b { overflow-wrap: anywhere; font: 400 clamp(2rem, 9vw, 4rem)/.9 "Archivo Black", sans-serif; letter-spacing: -.06em; }
.answer-card b span { margin-left: 5px; font: 500 .65rem "DM Mono", monospace; letter-spacing: 0; }
.answer-card.hidden-answer b { filter: blur(9px); user-select: none; }
.answer-card.odd-answer { color: #fff; border-color: var(--night); background: var(--night); box-shadow: 5px 5px 0 var(--pink); transform: rotate(-1deg) scale(1.015); }
.answer-card.odd-answer small { color: var(--lime); }
.odd-flag { position: absolute; right: 8px; top: 8px; padding: 3px 5px; color: var(--night); background: var(--pink); font: 500 .53rem "DM Mono", monospace; font-style: normal; letter-spacing: .06em; }
.vote-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.vote-card { min-height: 58px; padding: 10px; border: 2px solid var(--night); background: #fff; font-weight: 800; cursor: pointer; }
.vote-card.sel { background: var(--pink); box-shadow: 3px 3px 0 var(--night); transform: translate(-2px,-2px); }
.vote-card:disabled { cursor: default; opacity: .55; }
.scoreline { display: flex; justify-content: space-between; gap: 14px; margin: 12px 0; font: 500 .68rem "DM Mono", monospace; }

.result { margin: 30px 0 20px; text-align: center; color: var(--paper); }
.result .burst { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; color: var(--night); background: var(--lime); clip-path: polygon(50% 0,61% 27%,85% 15%,73% 39%,100% 50%,73% 61%,85% 85%,61% 73%,50% 100%,39% 73%,15% 85%,27% 61%,0 50%,27% 39%,15% 15%,39% 27%); font: 400 1.7rem "Archivo Black", sans-serif; animation: spinin .55s cubic-bezier(.2,.8,.2,1); }
.result h1 { margin: 0; font: 400 clamp(2.8rem, 11vw, 6rem)/.86 "Archivo Black", sans-serif; letter-spacing: -.06em; text-transform: uppercase; }
.result h1 span { display: block; color: var(--lime); }
.result p { margin: 18px auto; max-width: 46ch; font-weight: 700; line-height: 1.45; }
.odd-identity { margin: 0 0 22px; padding: clamp(18px,5vw,30px); color: var(--night); border: 3px solid var(--night); background: var(--lime); box-shadow: 8px 8px 0 var(--night); text-align: center; transform: rotate(-.5deg); }
.odd-identity small { display: block; margin-bottom: 7px; font: 500 .68rem "DM Mono", monospace; letter-spacing: .13em; }
.odd-identity > b { display: block; font: 400 clamp(2.6rem,11vw,6rem)/.9 "Archivo Black", sans-serif; letter-spacing: -.06em; text-transform: uppercase; }
.odd-identity > div { display: inline-block; margin-top: 13px; padding: 8px 13px; color: #fff; background: var(--night); transform: rotate(1deg); }
.odd-identity > div b { font-size: clamp(1.8rem,7vw,3.4rem); }
.reveal-questions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.reveal-q { position: relative; min-height: 210px; padding: 17px; border: 2px solid var(--night); background: #fff; }
.reveal-q.common { background: #e7e9ff; }
.reveal-q.odd { background: var(--pink); box-shadow: 4px 4px 0 var(--night); }
.reveal-q small { display: block; margin-bottom: 5px; font: 500 .62rem "DM Mono", monospace; text-transform: uppercase; }
.reveal-q > b { display: block; margin-top: 18px; font-size: clamp(1rem,3.5vw,1.35rem); line-height: 1.25; }
.q-number { display: grid; width: 29px; height: 29px; margin-bottom: 13px; place-items: center; border: 1.5px solid var(--night); border-radius: 50%; font: 500 .58rem "DM Mono", monospace; }
.question-answer { display: inline-block; margin-top: 16px; padding: 5px 9px; color: #fff; background: var(--night); }
.question-answer b { font-size: 1.5rem; }
.vote-count { font: 500 .62rem "DM Mono", monospace; }
.result-data .answer-card { animation: none; }

.overlay { position: fixed; inset: 0; z-index: 100; padding: 18px; display: none; place-items: center; background: rgba(17,17,40,.82); backdrop-filter: blur(6px); }
.overlay.show { display: grid; }
.modal { width: min(520px, 100%); max-height: min(720px, 88dvh); overflow: auto; }
.modal h2 { margin: 0 0 18px; font: 400 clamp(2rem, 8vw, 3.4rem)/.95 "Archivo Black", sans-serif; letter-spacing: -.05em; }
.modal ol { padding-left: 21px; }
.modal li { margin: 0 0 12px; line-height: 1.5; }
.modal-x { float: right; width: 34px; height: 34px; border: 2px solid var(--night); background: var(--pink); font-size: 1.2rem; cursor: pointer; }
.rule-note { padding: 11px; border: 1px dashed var(--night); background: var(--lime); font-weight: 800; }

html[lang="fr"] .wordmark small { width: auto; left: 50%; font-size: .31em; white-space: nowrap; transform: translateX(-50%); }
html[lang="fr"] .hero h1 { font-size: clamp(2.85rem, 9.4vw, 6.35rem) !important; line-height: .82; }

@keyframes blink { 50% { opacity: .2; } }
@keyframes pop { from { opacity: 0; transform: scale(.8) rotate(3deg); } }
@keyframes spinin { from { opacity: 0; transform: rotate(-70deg) scale(.3); } }
@media (max-width: 560px) {
  #app { padding-top: 14px; }
  .masthead { margin-bottom: 18px; }
  .back { font-size: .58rem; }
  .icon-btn { width: 34px; height: 34px; }
  .header-actions { gap: 5px; }
  .lang-btn { height: 31px; padding: 0 7px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode { min-height: 164px; }
  .mode b { margin-top: 16px; }
  .answer-grid { gap: 9px; }
  .answer-card { min-height: 108px; padding: 12px; }
  .reveal-questions { grid-template-columns: 1fr; }
  .reveal-q { min-height: 180px; }
  .panel { box-shadow: 5px 5px 0 var(--night); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
