@font-face {
  font-family: Fredoka;
  src: url('/apps/party-game/fonts/fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: Kalam;
  src: url('/apps/party-game/fonts/kalam.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f6efdf;
  --card: #fff9ec;
  --blue: #124779;
  --red: #cb392d;
  --yellow: #edb51e;
  --muted: #626a72;
  --line: #c7bea9;
  --shadow: 0 3px 1px #5a442c19, 0 12px 25px #5a442c12;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--blue);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: url('/apps/party-game/paper.svg') repeat; }
button, input, textarea, select { font: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; min-height: 54px; padding: 14px 20px; border: 0; border-radius: 10px; font-weight: 700; transition: transform .16s, box-shadow .16s, background .16s; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
button:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
header { max-width: 1320px; margin: auto; padding: 28px 42px 10px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; flex-direction: column; position: relative; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 36px; line-height: .82; letter-spacing: -1.5px; text-decoration: none; transform: rotate(-7deg); }
.brand > span:first-child { color: var(--red); }
.brand > span:last-child { color: var(--blue); }
.brand-rays { position: absolute; color: var(--yellow); font-size: 40px; right: -36px; top: 21px; }
.header-note { font-family: Kalam, cursive; font-size: 19px; line-height: 1.1; text-align: center; transform: rotate(-5deg); margin-right: auto; margin-left: 60px; }
.connection { font-size: 12px; font-weight: 600; color: var(--blue); border-bottom: 1px dashed #12477955; padding: 9px 0; }
.connection::before { content: '●'; color: #39734b; margin-right: 7px; font-size: 9px; }
main { max-width: 1250px; margin: 22px auto 45px; padding: 0 42px; min-height: 65vh; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); grid-template-areas: 'intro form' 'deck form'; gap: 20px 66px; align-items: start; }
.home-copy { grid-area: intro; position: relative; padding-top: 18px; }
.intro-note { display: flex; align-items: center; gap: 15px; font-family: Kalam, cursive; font-size: 17px; line-height: 1.25; transform: rotate(-7deg); position: absolute; right: -32px; top: 3px; }
.smiley { display: inline-block; position: relative; width: 53px; height: 53px; border-radius: 50%; background: var(--yellow) url('/apps/party-game/paper.svg'); transform: rotate(12deg); box-shadow: 1px 2px 1px #54391222; }
.smiley::before { content: ''; position: absolute; width: 5px; height: 11px; border-radius: 50%; background: var(--blue); left: 15px; top: 13px; box-shadow: 18px 0 var(--blue); }
.smiley::after { content: ''; position: absolute; width: 29px; height: 14px; border: 3px solid var(--blue); border-top: 0; border-radius: 0 0 28px 28px; left: 12px; top: 29px; }
h1, h2, h3 { font-family: Fredoka, sans-serif; font-weight: 600; }
h1 { font-size: clamp(66px, 7.9vw, 105px); font-weight: 700; line-height: .95; letter-spacing: -3.5px; margin: 32px 0 28px; transform: rotate(-3deg); }
h1 > span, h1 > em { display: block; }
h1 em { font-style: normal; color: var(--red); }
h1 > span:last-child { position: relative; width: fit-content; }
h1 > span:last-child::after { content: ''; position: absolute; width: 48%; height: 8px; border-radius: 60% 30% 70% 40%; right: 12px; bottom: -15px; background: var(--yellow); transform: rotate(-3deg); }
.lead { font-family: Fredoka, sans-serif; font-size: 19px; font-weight: 450; line-height: 1.5; margin: 32px 0 10px; }
.lead strong { font-weight: 600; }
h2 { font-size: 31px; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 15px; overflow-wrap: anywhere; }
h3 { margin: 0 0 14px; font-size: 23px; }
p { line-height: 1.6; }
small, .muted { color: var(--muted); }
.eyebrow { display: block; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: 1.6px; margin: 0 0 12px; }
.panel { position: relative; background: var(--card) url('/apps/party-game/paper.svg'); border: 1px solid #d8d0bc; border-radius: 17px 20px 18px 14px; padding: 30px; box-shadow: var(--shadow); }
.panel::before { content: ''; position: absolute; inset: 5px; border: 1px solid #c7bea930; border-radius: 12px; pointer-events: none; }
.panel p { color: var(--muted); margin-top: 0; }
.home-form { grid-area: form; align-self: center; margin-top: 36px; padding: 37px 30px 29px; box-shadow: -6px 6px 0 -2px #e8ddc6, -7px 7px 0 -2px #c8b99b, var(--shadow); }
.home-form h2 { font-size: 35px; }
.form-note { position: absolute; right: 5px; bottom: -49px; font-family: Kalam, cursive; font-size: 19px; color: var(--red); transform: rotate(-5deg); }
.label, label { display: block; font-family: Fredoka, sans-serif; font-size: 18px; font-weight: 550; margin: 22px 0 10px; }
input, textarea, select { width: 100%; min-height: 54px; padding: 14px 16px; background: #fffdf780; border: 1.5px solid #aca99d; border-radius: 9px; color: var(--blue); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #12477915; background: #fffdf9; }
input::placeholder, textarea::placeholder { color: #727476; opacity: 1; }
textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.primary, .secondary { background-image: url('/apps/party-game/paper.svg'); font-family: Fredoka, sans-serif; font-size: 20px; font-weight: 550; box-shadow: 0 3px 0 #8b201e; }
.primary { background-color: var(--red); color: #fffaf0; width: 100%; margin-top: 18px; }
.primary:not(:disabled):hover { background-color: #c83226; transform: translateY(-2px) rotate(-.4deg); box-shadow: 0 5px 0 #8b201e; }
.secondary { background-color: var(--blue); color: #fffaf0; box-shadow: 0 3px 0 #082e53; }
.secondary:not(:disabled):hover { background-color: #0d3b67; transform: translateY(-2px); box-shadow: 0 5px 0 #082e53; }
.home-form button { min-height: 59px; }
.home-form button > span { font-size: 27px; margin-right: 9px; line-height: .7; }
.join-row { display: grid; gap: 16px; }
.join-row input { min-width: 0; text-transform: uppercase; letter-spacing: 3px; }
.divider { display: flex; align-items: center; gap: 13px; font-family: Kalam, cursive; color: var(--muted); font-size: 16px; margin: 28px 0 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fineprint { font-size: 11px; text-align: center; margin: 26px 0 0 !important; }
.player-limits { margin: 20px 0 24px; border: 1px dashed #b68c30; border-radius: 8px; background: #f7e8b733; }
.player-limits summary { cursor: pointer; padding: 13px 15px; font-family: Fredoka, sans-serif; font-weight: 550; color: var(--blue); }
.limits-content { padding: 0 15px 15px; }
.limits-content p { font-size: 12px; margin: 0 0 12px; }
.limit-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.limit-fields label { margin: 0; font-size: 14px; }
.limit-fields input { min-height: 44px; margin-top: 6px; padding: 8px 10px; font-family: Fredoka, sans-serif; font-size: 20px; }
.limits-content small { display: block; margin-top: 10px; }
/* Decorative cards are built from text and CSS, keeping the layout sharp and available offline. */
.card-scene { grid-area: deck; position: relative; height: 270px; margin-top: 6px; }
.playing-card { position: absolute; display: flex; flex-direction: column; width: 43%; height: 220px; padding: 22px; border-radius: 12px; background-image: url('/apps/party-game/paper.svg'); box-shadow: 1px 3px 0 #69432635, 4px 8px 10px #69432618; }
.card-red { left: 0; top: 12px; transform: rotate(-15deg); background-color: var(--red); color: #fff5d9; justify-content: center; font-family: Kalam, cursive; font-size: 20px; line-height: 1.2; }
.card-smile { font-family: Fredoka, sans-serif; font-size: 58px; line-height: 1; margin-top: 12px; }
.card-blue { right: 0; top: 5px; transform: rotate(12deg); background-color: var(--blue); color: var(--paper); align-items: center; justify-content: center; }
.card-blue > span:first-child { font-family: Fredoka, sans-serif; font-size: 33px; font-weight: 700; line-height: .85; transform: rotate(-5deg); }
.card-blue small { font-family: Kalam, cursive; font-size: 16px; line-height: 1.25; margin-top: 16px; color: #fff0c9; text-align: center; }
.card-corner { position: absolute; bottom: 10px; right: 14px; color: var(--yellow); font-size: 28px; }
.card-question { left: 28%; top: -6px; z-index: 1; height: 238px; width: 46%; transform: rotate(-7deg); background-color: var(--card); border: 1px solid #e6dcc8; justify-content: center; }
.card-question small { font-family: Fredoka, sans-serif; font-size: 9px; font-weight: 600; letter-spacing: 1px; color: var(--red); }
.card-question p { font-family: Fredoka, sans-serif; font-size: 20px; line-height: 1.2; font-weight: 550; margin: 13px 0; }
.question-underline { display: block; width: 65px; height: 5px; border-radius: 50%; background: var(--yellow); transform: rotate(-4deg); }
.card-number { position: absolute; bottom: 12px; right: 15px; color: #7c817d; font-size: 9px; letter-spacing: 1px; }
.deck-note { position: absolute; right: 0; bottom: -13px; font-family: Kalam, cursive; font-size: 17px; line-height: 1.1; transform: rotate(-6deg); }
footer { text-align: center; font-family: Kalam, cursive; padding: 20px 20px 30px; color: var(--blue); font-size: 18px; }
footer > span:last-child { display: block; margin-top: 8px; color: var(--muted); font-family: 'Segoe UI', sans-serif; font-size: 11px; }
.footer-star { color: var(--red); font-size: 30px; display: inline-block; margin-right: 8px; vertical-align: middle; }
/* Game screens: paper cards, score slips, and a yellow joker for Carte Blanche. */
.game { max-width: 640px; margin: 34px auto 0; }
.game > .player-limits { margin: -8px 0 18px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: Fredoka, sans-serif; font-size: 14px; margin-bottom: 22px; }
.topline > span:first-child { transform: rotate(-2deg); border-bottom: 3px solid var(--yellow); padding: 5px 0; }
.topline > span:last-child { color: var(--red); }
.room-code { font-family: Fredoka, sans-serif; font-size: 44px; font-weight: 600; letter-spacing: 6px; color: var(--blue); margin: 16px 0; width: fit-content; padding: 8px 14px; background: #edb51e3b; border: 1px dashed #b68c30; border-radius: 4px; transform: rotate(-2deg); }
.network-url { display: block; overflow-wrap: anywhere; color: var(--blue); font-size: 13px; margin: 18px 0; text-underline-offset: 3px; }
.players { display: grid; gap: 9px; margin: 22px 0; }
.player { display: flex; align-items: center; gap: 13px; padding: 12px 14px; background: #fffcf3 url('/apps/party-game/paper.svg'); border: 1px solid #d9d0bf; border-radius: 6px; box-shadow: 0 2px 0 #d9d0bf55; }
.avatar { width: 36px; height: 43px; flex-shrink: 0; display: grid; place-items: center; border-radius: 5px; background: var(--blue); color: #fff9ec; font-family: Fredoka, sans-serif; font-size: 21px; font-weight: 600; transform: rotate(-5deg); }
.player:nth-child(even) .avatar { background: var(--red); transform: rotate(5deg); }
.player-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.player small { font-size: 11px; font-weight: 400; }
.score { flex-shrink: 0; font-family: Fredoka, sans-serif; color: var(--blue); font-size: 20px; font-weight: 550; }
.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.options button { padding: 10px 4px; font-size: 12px; background: #fffcf3; color: var(--blue); border: 1px solid var(--line); border-radius: 6px; }
.options button.active { background: var(--yellow); border-color: #b8890b; transform: rotate(-3deg); box-shadow: 1px 3px 0 #b8890b3b; }
.question { font-size: clamp(27px, 5vw, 36px); font-weight: 550; line-height: 1.22; margin: 22px 0; overflow-wrap: anywhere; }
.target-tag { color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.progress { appearance: none; display: block; width: 100%; height: 8px; border: 0; accent-color: var(--blue); background: #ded6c4; border-radius: 9px; overflow: hidden; margin: 24px 0 10px; }
.progress::-webkit-progress-bar { background: #ded6c4; border-radius: 9px; }
.progress::-webkit-progress-value { background: var(--blue); border-radius: 9px; }
.progress::-moz-progress-bar { background: var(--blue); border-radius: 9px; }
.center { text-align: center; }
.big-icon { font-size: 46px; margin: 16px 0; color: var(--red); }
.waiting { padding: 20px 0 5px; font-family: Kalam, cursive; font-size: 21px; color: var(--blue); }
.choice { display: flex; align-items: center; gap: 17px; width: 100%; text-align: left; background: #fffdf6 url('/apps/party-game/paper.svg'); color: var(--blue); border: 1.5px solid #b5bcbf; box-shadow: 0 3px 0 #dad1bf; margin: 15px 0; min-height: 85px; line-height: 1.5; overflow-wrap: anywhere; }
.choice:not(:disabled):hover { border-color: var(--blue); background-color: #fdf0cd; transform: rotate(-.6deg) translateY(-2px); }
.choice span:first-child { align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--line); padding-right: 15px; color: var(--red); font-family: Fredoka, sans-serif; font-size: 28px; }
.choice span:last-child { min-width: 0; }
.special-panel { border: 2px solid #bb8618; background-color: #fff0b8; box-shadow: 5px 6px 0 -1px #edb51e, 6px 7px 0 -1px #bb8618, var(--shadow); }
.special-panel .eyebrow { color: var(--blue); font-family: Kalam, cursive; font-size: 18px; letter-spacing: 1px; }
.result-quote { font-family: Fredoka, sans-serif; font-size: 25px; line-height: 1.35; color: var(--blue) !important; overflow-wrap: anywhere; }
.points { display: inline-block; padding: 10px 18px; border: 1px dashed #b88b21; background: #f3cb5c; color: #173f65; font-family: Fredoka, sans-serif; font-size: 20px; font-weight: 550; transform: rotate(-3deg); }
.notice { background: #fff0c1; border: 1px solid #b88b21; color: #6e4c10; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; line-height: 1.6; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #fff5e7; color: #90291d; border: 2px solid var(--red); padding: 16px 23px; border-radius: 10px; box-shadow: var(--shadow); width: max-content; max-width: 90vw; z-index: 10; }
.hint { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 30px 0; }
.podium-item { flex: 1; min-width: 0; border: 1px solid #b5bcbf; background: #e8eef0 url('/apps/party-game/paper.svg'); border-radius: 10px; padding: 20px 8px; text-align: center; overflow-wrap: anywhere; transform: rotate(-3deg); box-shadow: 0 3px 0 #b5bcbf; }
.podium-item:last-child { transform: rotate(4deg); }
.podium-item.first { padding-top: 44px; border-color: #b58c24; background-color: #f6d269; transform: rotate(2deg); box-shadow: 0 3px 0 #b58c24; }
.podium-item b { display: block; margin: 10px 0; font-family: Fredoka, sans-serif; font-size: 18px; }
.podium-item span { font-size: 27px; }
.podium-item small { color: var(--blue); font-weight: 600; }
.stack { display: grid; gap: 13px; margin-top: 18px; }
.stack .primary { margin: 0; }
.reveal { animation: deal-card .45s ease-out; }
@keyframes deal-card { from { opacity: 0; transform: translateY(14px) rotate(-3deg); } to { opacity: 1; transform: none; } }
@media (max-width: 1050px) and (min-width: 761px) {
  .home-grid { gap: 18px 38px; grid-template-columns: minmax(0, 1.15fr) minmax(310px, 1fr); }
  h1 { font-size: clamp(64px, 8.3vw, 85px); }
  .intro-note { right: -5px; top: -4px; font-size: 14px; }
  .intro-note .smiley { display: none; }
  .home-copy { padding-top: 30px; }
  .card-scene { height: 235px; }
  .playing-card { padding: 16px; height: 195px; }
  .card-question { height: 219px; width: 51%; left: 25%; }
  .card-question p { font-size: 18px; }
  .card-red { font-size: 16px; }
  .card-blue > span:first-child { font-size: 27px; }
  .deck-note { font-size: 14px; right: -12px; bottom: -22px; }
}
@media (max-width: 760px) {
  header { padding: 25px 24px 12px; gap: 12px; }
  .brand { font-size: 29px; }
  .brand-rays { font-size: 29px; right: -26px; top: 19px; }
  .header-note { display: none; }
  .connection { font-size: 11px; }
  main { margin: 17px auto 28px; padding: 0 24px; max-width: 510px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'form' 'deck'; gap: 25px; }
  .home-copy { padding-top: 4px; }
  .intro-note { position: relative; top: auto; right: auto; justify-content: flex-end; font-size: 13px; gap: 10px; margin: 0 0 -18px; }
  .intro-note .smiley { width: 40px; height: 40px; }
  .smiley::before { left: 11px; top: 9px; width: 4px; height: 8px; box-shadow: 14px 0 var(--blue); }
  .smiley::after { left: 9px; top: 23px; width: 23px; height: 10px; border-width: 2px; }
  h1 { font-size: clamp(52px, 15.8vw, 76px); letter-spacing: -2px; margin: 29px 0 22px; }
  h1 > span:last-child::after { height: 6px; bottom: -10px; }
  .lead { font-size: 17px; margin-top: 25px; margin-bottom: 0; }
  .home-form { margin: 0 0 25px; padding: 25px 23px; }
  .home-form h2 { font-size: 29px; }
  .home-form .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .form-note { bottom: -39px; font-size: 16px; }
  .home-form button { min-height: 55px; }
  .divider { margin-top: 25px; }
  .fineprint { font-size: 10px; }
  .player-limits { margin-block: 18px; }
  .card-scene { height: 248px; margin-top: 10px; }
  .playing-card { padding: 15px; height: 191px; }
  .card-red { font-size: 15px; }
  .card-smile { font-size: 43px; }
  .card-blue > span:first-child { font-size: 27px; }
  .card-blue small { font-size: 14px; }
  .card-question { width: 51%; height: 216px; left: 24%; }
  .card-question p { font-size: 18px; }
  .card-question small { font-size: 8px; letter-spacing: .4px; }
  .deck-note { font-size: 14px; bottom: -5px; right: -3px; }
  .game { margin-top: 24px; }
  .panel { padding: 24px 21px; }
  h2 { font-size: 28px; }
  .question { font-size: 29px; }
  .room-code { font-size: 34px; letter-spacing: 4px; }
  .options { gap: 6px; }
  .options button { min-height: 56px; font-size: 11px; }
  .player { padding: 10px; gap: 10px; }
  .score { font-size: 18px; }
  .topline { font-size: 12px; }
  footer { padding-top: 15px; font-size: 16px; }
  .podium { gap: 8px; }
  .podium-item b { font-size: 16px; }
}
@media (max-width: 360px) {
  main { padding: 0 18px; }
  .card-scene { margin-inline: 8px; }
  .intro-note { font-size: 12px; }
  .card-question p { font-size: 16px; }
  .card-red { font-size: 13px; }
  .card-blue > span:first-child { font-size: 24px; }
  .panel { padding: 23px 17px; }
  .options { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.home-form #room-visibility{width:100%;font:inherit;font-size:14px;min-height:48px;padding:10px 14px;border:1px solid #d9cfc0;border-radius:12px;background:#fffaf0;color:#242e31;margin-bottom:12px}
