:root {
  --bg: #10141f;
  --panel: #182032;
  --panel-2: #202a42;
  --text: #f3f6fb;
  --muted: #aab5ca;
  --accent: #ffd166;
  --accent-2: #06d6a0;
  --danger: #ef476f;
  --line: rgba(255,255,255,.12);
  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,209,102,.18), transparent 35%),
    radial-gradient(circle at top right, rgba(6,214,160,.12), transparent 30%),
    var(--bg);
  min-height: 100vh;
}
.app { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
h1 { font-size: clamp(42px, 7vw, 84px); line-height: .9; margin: 0; letter-spacing: -0.06em; }
h2 { margin: 0 0 12px; }
.subtitle { color: var(--muted); margin: 12px 0 0; font-size: 18px; }
.eyebrow, .label { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin: 0 0 6px; font-weight: 700; }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.setup-panel { padding: 24px; max-width: 840px; }
.setup-grid, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; margin-bottom: 16px; }
input, select { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: var(--text); font: inherit; }
.name-fields { display: grid; gap: 12px; margin: 16px 0; }
.player-setup { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); }
.settings { margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(0,0,0,.10); }
summary { cursor: pointer; font-weight: 950; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; margin-top: 12px; }
.toggle { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--text); }
.toggle input { width: auto; }
.hint { color: var(--muted); margin: 14px 0 0; }
button { border: 0; border-radius: 14px; padding: 13px 18px; color: var(--text); background: var(--panel-2); font: inherit; font-weight: 800; cursor: pointer; transition: transform .12s ease, opacity .12s ease, background .12s ease; white-space: pre-line; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary { background: var(--accent); color: #251c00; }
.secondary { background: var(--accent-2); color: #05251d; }
.danger { background: var(--danger); color: white; }
.ghost { background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.small { padding: 9px 12px; font-size: 14px; }
.wide { width: 100%; margin-top: 8px; }
.hidden { display: none !important; }
.game { display: grid; grid-template-columns: 315px 1fr; gap: 20px; align-items: start; }
.scoreboard, .table { padding: 20px; }
.scoreboard-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.players-list { display: grid; gap: 10px; }
.player-row { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); position: relative; overflow: hidden; }
.player-row.active { outline: 2px solid var(--accent); }
.player-row.out { opacity: .5; }
.player-row.bot::after { content: "BOT"; position: absolute; top: 10px; right: 10px; font-size: 10px; color: var(--accent); letter-spacing: .12em; font-weight: 950; }
.player-name { display: flex; justify-content: space-between; gap: 8px; font-weight: 900; padding-right: 32px; }
.player-meta { color: var(--muted); margin-top: 6px; font-size: 14px; }
.mini-panel { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.14); }
.achievement-list { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.badge { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 7px 10px; background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.25); color: var(--text); font-weight: 800; }
.status-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.status-bar > div { background: rgba(0,0,0,.16); padding: 14px; border-radius: 16px; border: 1px solid var(--line); }
.penalty { outline: 2px solid var(--danger); }
.message { min-height: 44px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.07); color: var(--text); margin-bottom: 20px; }
.center-table { display: flex; justify-content: center; align-items: stretch; gap: 24px; margin: 20px 0 28px; flex-wrap: wrap; }
.pile-wrap { display: grid; place-items: center; gap: 8px; }
.card { width: 92px; height: 132px; display: grid; place-items: center; border-radius: 14px; background: #f7f7f2; color: #111; border: 2px solid rgba(0,0,0,.25); font-weight: 950; font-size: 24px; box-shadow: 0 12px 28px rgba(0,0,0,.22); position: relative; text-align: center; }
.card.red { color: #c1121f; }
.card.black { color: #101820; }
.card.back { background: repeating-linear-gradient(45deg, #22304f, #22304f 8px, #1a2440 8px, #1a2440 16px); color: var(--accent); border-color: rgba(255,255,255,.18); font-size: 18px; }
.card.empty { background: rgba(255,255,255,.05); color: var(--muted); border-color: var(--line); }
.card.valid { outline: 3px solid var(--accent-2); }
.card.invalid { opacity: .45; }
.card.played { animation: pop .22s ease; }
.card .corner { position: absolute; top: 8px; left: 10px; font-size: 17px; text-align: left; line-height: 1; }
.card .corner.bottom { top: auto; left: auto; right: 10px; bottom: 8px; transform: rotate(180deg); }
.card .center { font-size: 34px; }
.chosen-suit { min-width: 112px; min-height: 48px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 900; }
.suit-chooser, .callout-window { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 0 0 20px; padding: 14px; border-radius: 16px; background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.35); }
.suit-chooser p { flex-basis: 100%; text-align: center; margin: 0 0 4px; font-weight: 900; }
.callout-window { background: rgba(239,71,111,.14); border-color: rgba(239,71,111,.45); justify-content: space-between; }
.hand-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.hand-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hand { display: flex; gap: 12px; flex-wrap: wrap; min-height: 150px; padding: 14px; border: 1px dashed var(--line); border-radius: 18px; background: rgba(0,0,0,.12); }
.hand .card { cursor: pointer; }
.pass-screen { position: absolute; inset: 20px; z-index: 3; border-radius: var(--radius); background: rgba(16,20,31,.96); border: 1px solid var(--line); display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 24px; }
.table { position: relative; }
#rulesDialog, #statsDialog { max-width: 760px; width: min(760px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--panel); padding: 24px; box-shadow: var(--shadow); }
#rulesDialog::backdrop, #statsDialog::backdrop { background: rgba(0,0,0,.65); }
#rulesDialog li { margin: 8px 0; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.stat-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); }
.toast { animation: glow .6s ease; }
@keyframes pop { from { transform: scale(.92); opacity: .65; } to { transform: scale(1); opacity: 1; } }
@keyframes glow { 0%,100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px rgba(255,209,102,.22); } }
@media (max-width: 900px) {
  .game { grid-template-columns: 1fr; }
  .status-bar { grid-template-columns: repeat(2, 1fr); }
  .hero { align-items: flex-start; }
  .setup-grid, .settings-grid, .toggle-grid, .stat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .status-bar { grid-template-columns: 1fr; }
  .card { width: 78px; height: 112px; font-size: 20px; }
  .card .center { font-size: 28px; }
  .player-setup { grid-template-columns: 1fr; }
  .hero { display: grid; }
}

/* v3 polish */
.table-stage {
  min-height: 118px;
  margin: 10px 0 18px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.1);
  background: radial-gradient(circle at center, rgba(6,214,160,.12), rgba(0,0,0,.16));
  position: relative;
  overflow: hidden;
}
.opponent-ring {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}
.seat {
  min-width: 132px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  display: grid;
  gap: 3px;
  text-align: center;
  animation: pop .25s ease;
}
.seat span { color: var(--muted); font-size: 12px; }
.seat.bot::before { content: "🤖"; }
.seat.human::before { content: "👤"; }
.direction-arrow {
  position: absolute;
  right: 16px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,209,102,.14);
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
}
.turn-log-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(0,0,0,.12);
}
.turn-log-wrap summary { cursor: pointer; font-weight: 900; color: var(--accent); }
.turn-log {
  margin: 10px 0 0;
  padding-left: 24px;
  max-height: 220px;
  overflow: auto;
  color: var(--muted);
}
.turn-log li { margin: 7px 0; }
.turn-log time { color: var(--accent-2); font-size: 12px; margin-right: 6px; }
#tutorialDialog, #scoreDialog {
  max-width: 860px;
  width: min(860px, calc(100% - 30px));
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}
#tutorialDialog::backdrop, #scoreDialog::backdrop { background: rgba(0,0,0,.65); }
.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.tutorial-steps section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.tutorial-steps h3 { margin: 0 0 6px; }
.tutorial-steps p { margin: 0; color: var(--muted); }
.score-table-wrap { overflow: auto; margin: 12px 0 18px; }
.score-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.score-table th, .score-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.score-table th { color: var(--accent); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.card.played { animation: cardSlam .28s ease; }
.card.valid:hover { transform: translateY(-8px) rotate(-1deg); }
@keyframes cardSlam { 0% { transform: translateY(-22px) scale(.92); opacity: .5; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@media (max-width: 620px) {
  .tutorial-steps { grid-template-columns: 1fr; }
  .table-stage { min-height: 96px; }
  .seat { min-width: 110px; padding: 8px; }
}


/* v3.2 Maxwell celebration */
.max-win-dialog {
  max-width: 560px;
  width: min(560px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--text);
  background: linear-gradient(180deg, #263252, #151b2b);
  padding: 26px;
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}
.max-win-dialog::backdrop { background: rgba(0,0,0,.72); }
.max-character {
  width: 112px;
  margin: 0 auto 18px;
  animation: maxPop 1.1s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
.max-head {
  height: 88px;
  border-radius: 46px 46px 38px 38px;
  background: #ffd6b0;
  border: 3px solid rgba(0,0,0,.25);
  position: relative;
  box-shadow: inset 0 -8px rgba(0,0,0,.08);
}
.max-head::before {
  content: "";
  position: absolute;
  inset: -16px 10px auto;
  height: 30px;
  border-radius: 999px 999px 18px 18px;
  background: #3b2a1a;
}
.max-eye {
  position: absolute;
  top: 36px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  animation: maxBlink 4s infinite;
}
.max-eye.left { left: 34px; }
.max-eye.right { right: 34px; }
.max-smile {
  position: absolute;
  left: 38px;
  bottom: 22px;
  width: 36px;
  height: 18px;
  border-bottom: 4px solid #111;
  border-radius: 0 0 999px 999px;
}
.max-body {
  width: 86px;
  height: 74px;
  margin: -4px auto 0;
  display: grid;
  place-items: center;
  border-radius: 24px 24px 18px 18px;
  background: var(--accent-2);
  color: #05251d;
  font-size: 32px;
  border: 3px solid rgba(0,0,0,.18);
}
.speech-bubble {
  padding: 18px;
  margin: 0 0 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.09);
  border: 1px solid var(--line);
}
.speech-bubble p {
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.18;
  margin: 8px 0 0;
  color: var(--accent);
  font-weight: 950;
}
@keyframes maxPop {
  from { transform: translateY(8px) rotate(-2deg) scale(.98); }
  to { transform: translateY(-8px) rotate(2deg) scale(1.03); }
}
@keyframes maxBlink {
  0%, 93%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.08); }
}


/* v3.4 Bakery Theme: The Pie Man table */
:root {
  --bg: #5b321d;
  --panel: #8b4f24;
  --panel-2: #a8632d;
  --text: #fff8e8;
  --muted: #f5d9ae;
  --accent: #ffd27a;
  --accent-2: #9be58d;
  --danger: #d9482f;
  --line: rgba(255, 246, 219, .22);
  --shadow: 0 24px 70px rgba(59, 30, 12, .42);
}
body {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 230, 160, .45), transparent 22%),
    radial-gradient(circle at 86% 10%, rgba(255, 173, 91, .26), transparent 25%),
    radial-gradient(circle at 50% 110%, rgba(108, 55, 23, .92), transparent 45%),
    linear-gradient(135deg, #f8e3bc 0%, #c97a32 44%, #6b3d20 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    radial-gradient(circle at 10px 10px, #fff6d8 2px, transparent 2px),
    radial-gradient(circle at 38px 34px, #8b4f24 1.5px, transparent 1.5px);
  background-size: 56px 56px;
  mix-blend-mode: soft-light;
}
.hero,
.panel,
#rulesDialog,
#statsDialog,
#tutorialDialog,
#scoreDialog {
  background: linear-gradient(180deg, rgba(139, 79, 36, .96), rgba(92, 49, 26, .96));
  border-color: rgba(255, 227, 172, .28);
}
.hero::after {
  content: "🥧 🥐 🍞";
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 24px;
  letter-spacing: .25em;
}
.eyebrow { color: #ffe7aa; }
.subtitle, .hint, .player-meta, .turn-log, #rulesDialog li, .tutorial-steps p { color: #f7ddb5; }
.primary { background: linear-gradient(180deg, #ffe19a, #f2ac43); color: #4a250b; }
.secondary { background: linear-gradient(180deg, #c4f49e, #80c963); color: #1f3514; }
.ghost { background: rgba(255, 246, 219, .12); border-color: rgba(255, 246, 219, .24); }
.card {
  background: #fff8e8;
  border-color: #8b4f24;
  box-shadow: 0 13px 26px rgba(68, 32, 10, .28);
}
.card.back {
  background:
    radial-gradient(circle at 50% 42%, #f7c56d 0 32%, transparent 33%),
    linear-gradient(45deg, #8b4f24 0 20%, #a8632d 20% 40%, #8b4f24 40% 60%, #a8632d 60% 80%, #8b4f24 80%);
  color: #fff0bf;
  border-color: #f8d188;
  text-shadow: 0 2px 0 rgba(0,0,0,.22);
}
.card.back::after {
  content: "🥧";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 20px;
}
.table-stage {
  background:
    radial-gradient(ellipse at center, rgba(255, 214, 137, .25), rgba(91, 50, 29, .25)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 16px, rgba(0,0,0,.04) 16px 32px);
  border-color: rgba(255, 227, 172, .3);
}
.center-table {
  padding: 18px;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, rgba(255, 224, 160, .18), rgba(64, 31, 14, .16));
  border: 1px dashed rgba(255, 231, 170, .32);
}
.seat.bot::before { content: "🥧"; }
.seat.human::before { content: "🧑‍🍳"; }
.player-row.bot::after { content: "BAKER"; color: #ffe19a; }
.direction-arrow { background: rgba(255, 210, 122, .2); color: #ffe19a; }
.message { background: rgba(255, 236, 196, .13); }
.suit-chooser, .callout-window { background: rgba(255, 206, 111, .16); border-color: rgba(255, 219, 147, .42); }
.hand { background: rgba(75, 36, 13, .18); border-color: rgba(255, 231, 170, .28); }
.pass-screen {
  background: rgba(94, 50, 25, .97);
  background-image: radial-gradient(circle at top, rgba(255, 222, 151, .18), transparent 34%);
}
.max-win-dialog {
  background: linear-gradient(180deg, #9e5d2c, #5a301b);
  border-color: rgba(255, 228, 170, .35);
}
.max-head::before {
  background: #fff2d7;
  height: 28px;
  border-radius: 999px 999px 12px 12px;
  box-shadow: -16px 6px 0 #fff2d7, 16px 6px 0 #fff2d7;
}
.max-body {
  background: linear-gradient(180deg, #fff0bd, #e8a84a);
  color: #6a3413;
}
.speech-bubble { background: rgba(255, 246, 219, .13); }
.speech-bubble p { color: #ffe19a; }
.badge { background: rgba(255, 210, 122, .18); border-color: rgba(255, 210, 122, .35); }


.gramps-reminder {
  position: fixed;
  right: clamp(12px, 4vw, 34px);
  bottom: clamp(12px, 4vw, 28px);
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(180px, 280px) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 2px solid rgba(255, 225, 154, .55);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(124, 69, 31, .98), rgba(72, 36, 15, .98));
  box-shadow: 0 22px 60px rgba(36, 14, 4, .45);
}
.gramps-reminder.hidden { display: none; }
.gramps-reminder.pop { animation: grampsSlideIn .42s cubic-bezier(.2,1.2,.4,1), grampsBob 1.1s ease-in-out .42s infinite alternate; }
.pie-man { position: relative; width: 86px; height: 112px; }
.pie-hat { position: absolute; top: -6px; left: 18px; font-size: 40px; transform: rotate(-8deg); filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); animation: pieHatWobble 1.3s ease-in-out infinite; }
.pie-face {
  position: absolute;
  top: 31px;
  left: 11px;
  width: 64px;
  height: 58px;
  border-radius: 45% 45% 50% 50%;
  background: #ffe2ad;
  border: 2px solid #7b421e;
}
.pie-eye { position: absolute; top: 21px; width: 7px; height: 7px; border-radius: 50%; background: #4a250b; }
.pie-eye.left { left: 18px; }
.pie-eye.right { right: 18px; }
.pie-moustache {
  position: absolute;
  left: 18px;
  top: 34px;
  width: 28px;
  height: 9px;
  border-radius: 50%;
  background: #6b3a18;
  box-shadow: -10px 0 0 #6b3a18, 10px 0 0 #6b3a18;
}
.pie-body {
  position: absolute;
  bottom: 0;
  left: 15px;
  width: 56px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px 18px 12px 12px;
  background: linear-gradient(180deg, #fff0bd, #d68635);
  border: 2px solid #7b421e;
  font-size: 25px;
}
.pie-speech { padding: 12px 14px; border-radius: 18px; background: rgba(255, 246, 219, .16); color: #fff3d3; }
.pie-speech strong { color: #ffe19a; }
.pie-speech p { margin: 4px 0 0; font-size: 1.05rem; color: #fff0bf; }
#grampsReminderClose { width: 34px; height: 34px; border-radius: 999px; padding: 0; font-size: 22px; line-height: 1; }
@keyframes grampsSlideIn { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes grampsBob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes pieHatWobble { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-2px); } }
@media (max-width: 640px) {
  .gramps-reminder {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: auto 1fr auto;
  }
  .pie-man { width: 70px; transform: scale(.85); transform-origin: center; }
  .pie-speech p { font-size: .98rem; }
}

/* Star Baker v4 additions */
.setup-actions { display: grid; gap: 10px; margin-top: 14px; }
.player-setup { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.seat.bot::before, .seat.human::before { content: ""; }
.bake-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}
.bake-results span {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 236, 190, .12);
  border: 1px solid rgba(139, 79, 36, .28);
}
.share-dialog { max-width: 440px; }
.share-card {
  margin: 12px 0;
  padding: 22px;
  border-radius: 24px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(255,209,102,.32), transparent 45%), linear-gradient(135deg, #fff0bd, #d68635);
  color: #4a250b;
  border: 3px solid #7b421e;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.share-card h3 { margin: 0 0 8px; font-size: 1.35rem; }
.share-hero { font-size: 1.4rem; font-weight: 900; }
.max-win-dialog::backdrop, .share-dialog::backdrop { background: rgba(56, 29, 10, .65); }
.max-win-dialog .max-character { animation: maxBounce .8s cubic-bezier(.2,1.5,.35,1) both; }
.max-win-dialog .speech-bubble { position: relative; }
.max-win-dialog .speech-bubble::after {
  content: "🥧 💛 🥐";
  display: block;
  font-size: 1.3rem;
  margin-top: 8px;
  animation: confettiFloat 1.1s ease-in-out infinite alternate;
}
@keyframes maxBounce { 0% { transform: translateY(30px) scale(.7); opacity: 0; } 65% { transform: translateY(-8px) scale(1.04); opacity: 1; } 100% { transform: translateY(0) scale(1); } }
@keyframes confettiFloat { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@media (max-width: 760px) { .player-setup { grid-template-columns: 1fr 1fr; } }


/* v4.2 Star Baker extras */
.quote-settings textarea {
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(139,79,36,.25);
  padding: 12px;
  background: #fff8ec;
  color: #4b2d16;
  resize: vertical;
}
.event-burst {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(.7);
  z-index: 50;
  font-size: clamp(3rem, 11vw, 7rem);
  filter: drop-shadow(0 14px 18px rgba(58, 31, 12, .24));
  pointer-events: none;
  opacity: 0;
}
.event-burst.show {
  opacity: 1;
  animation: bakeryBurst .9s ease both;
}
.event-burst.twoStack.show { animation-name: pieSplat; }
.event-burst.handWin.show, .event-burst.star.show { animation-name: ovenDing; }
.event-burst.skip.show { animation-name: flourPuff; }
@keyframes bakeryBurst {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.5) rotate(-8deg); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(6deg); }
  100% { opacity: 0; transform: translate(-50%, -76%) scale(.92) rotate(0deg); }
}
@keyframes pieSplat {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.28); }
  70% { opacity: 1; transform: translate(-50%, -48%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -45%) scale(1.38); }
}
@keyframes ovenDing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  20%, 55% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(8deg); }
  38% { transform: translate(-50%, -50%) scale(1.12) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -72%) scale(.8); }
}
@keyframes flourPuff {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); filter: blur(3px); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); filter: blur(8px); }
}
