* { box-sizing: border-box; }
:root {
  --cream:#fff0e3; --cream2:#ffeadb; --peach:#eac8b2; --brown:#54372d;
  --cocoa:#704a39; --gold:#e6b45d; --rose:#e9a39a; --line:#8a5d49;
}
html,body { margin:0; min-height:100%; }
body {
  min-height:100svh; display:grid; place-items:center; padding:14px;
  color:var(--brown); font-family:"Mali","Itim",system-ui,sans-serif;
  background:radial-gradient(circle at 15% 10%,#fff9f1 0,transparent 35%),#ead8ca;
}
button,input { font:inherit; }
button { cursor:pointer; }
.app-shell {
  position:relative; isolation:isolate; overflow:hidden;
  width:min(100%,420px); min-height:min(850px, calc(100svh - 28px));
  padding:15px 22px 17px; display:flex; flex-direction:column; align-items:center;
  border:2px solid #a87c64; border-radius:27px;
  background:
    radial-gradient(ellipse at 50% 47%,rgba(255,255,255,.85),transparent 48%),
    linear-gradient(145deg,#fff4e9 0%,#ffecdf 56%,#f8e2d2 100%);
  box-shadow:0 18px 55px #6946312b, inset 0 0 0 4px #fff9f0;
}
.app-shell:before { content:""; position:absolute; inset:8px; border:1px solid #e6c6ae; border-radius:20px; pointer-events:none; z-index:-1; }
.ambient { position:absolute; border-radius:50%; filter:blur(2px); z-index:-1; pointer-events:none; }
.ambient-one { width:190px;height:190px;right:-85px;top:190px;background:#f6d8c4a8; }
.ambient-two { width:170px;height:170px;left:-95px;bottom:90px;background:#efd0b9a1; }
.topbar { width:100%; display:flex; align-items:center; justify-content:space-between; height:42px; }
.icon-button { width:39px;height:39px;border:0;background:transparent;color:var(--brown);font-size:30px;display:grid;place-items:center; }
.hamburger { width:25px;display:grid;gap:5px; }
.hamburger i { height:4px;border-radius:5px;background:var(--brown);display:block; }
.gear { font-size:31px;transition:transform .5s; }
.gear:hover { transform:rotate(55deg); }
.top-crown { color:#d59a3f;font-size:38px;line-height:1;text-shadow:1px 2px #5a382a;animation:crownBob 3s ease-in-out infinite; }
.brand { position:relative;text-align:center;margin-top:2px;z-index:1; }
.brand h1 { margin:0;color:#e9c2aa;font-family:"Itim","Mali",sans-serif;font-size:clamp(53px,15vw,73px);line-height:.78;letter-spacing:-4px;-webkit-text-stroke:2.7px #4a3028;text-shadow:0 4px 0 #4a3028,3px 6px 0 #d6a98c; }
.brand h1 span { display:block;font-size:.79em;letter-spacing:-2px;margin-top:7px; }
.brand p { margin:12px 0 0;font-size:17px;font-weight:600;letter-spacing:.1px; }
.brand-crown { position:absolute;color:#e5ad50;font-size:37px;text-shadow:1px 2px #54372d; }
.crown-left { left:18%;top:-19px;transform:rotate(-12deg); }
.crown-right { right:4%;top:22px;transform:rotate(15deg);font-size:30px; }
.mascot-stage { position:relative;width:100%;height:clamp(245px,37vh,320px);margin-top:1px;display:grid;place-items:center; }
.mascot { position:relative;z-index:2;width:min(100%,330px);height:100%;object-fit:contain;mix-blend-mode:multiply;filter:drop-shadow(0 9px 7px #68422b22);animation:mascotFloat 4s ease-in-out infinite; }
.mascot-glow { position:absolute;width:78%;height:67%;bottom:4%;border-radius:50%;background:radial-gradient(ellipse,#e9c6ae77,transparent 68%); }
.doodle { position:absolute;z-index:3;color:#dba65c;animation:twinkle 3s ease-in-out infinite; }
.heart { left:2%;top:12%;font-size:48px;color:#b96f64;transform:rotate(-13deg); }
.orbit { right:2%;top:17%;font-size:38px;color:#d5a477; }
.sparkle { font-size:27px; }.s1{left:8%;top:0}.s2{right:9%;top:1%;animation-delay:.8s}.s3{right:1%;bottom:17%;animation-delay:1.3s}
.welcome-pill { position:relative;z-index:3;margin-top:-2px;padding:8px 22px;width:90%;text-align:center;border:1.5px solid #d6ad91;border-radius:50px;background:#fff8f0;box-shadow:0 3px 0 #e8cbb7;font-size:17px;font-weight:600; }
.welcome-pill span { color:#a56c55;font-size:23px;vertical-align:-2px; }
.actions { width:100%;display:grid;gap:10px;margin-top:14px; }
.primary-button,.secondary-button { width:100%;border-radius:50px;display:flex;align-items:center;justify-content:center;gap:15px;font-weight:700;transition:transform .18s,box-shadow .18s; }
.primary-button { min-height:62px;border:2px solid #d5a35d;background:linear-gradient(180deg,#79523e,#56372b);color:#fff5e9;font-size:24px;box-shadow:0 4px 0 #3f2a22, inset 0 2px 2px #ffffff35; }
.primary-button:hover { transform:translateY(-3px);box-shadow:0 7px 0 #3f2a22,0 9px 18px #65432b25; }
.primary-button:active,.secondary-button:active { transform:translateY(1px); }
.play-icon { color:#ffd16f;font-size:26px;text-shadow:0 1px #6b472e; }
.secondary-button { min-height:44px;border:1.7px solid #8b5c48;background:#fff4e9;color:#684735;font-size:16px;box-shadow:0 3px 0 #e2c2ac; }
.people-icon { font-size:18px; }
.footer { margin-top:auto;padding-top:13px;display:flex;align-items:center;gap:13px;color:#815944; }
.footer small { font-size:11px;font-weight:700;letter-spacing:.4px; }
.menu-panel { position:absolute;z-index:10;top:62px;left:17px;width:185px;padding:8px;border:1.5px solid #c99e80;border-radius:17px;background:#fff8f0;box-shadow:0 12px 25px #583a2b30;display:none; }
.menu-panel.open { display:grid;animation:popIn .18s ease-out; }
.menu-panel button { border:0;background:transparent;text-align:left;padding:10px;border-radius:10px;color:var(--brown);font-weight:600; }
.menu-panel button:hover { background:#f7e4d5; }
.setup-screen { position:absolute;inset:0;z-index:8;padding:22px;display:none;place-items:center;background:#fff0e3f5;backdrop-filter:blur(7px); }
.setup-screen.open { display:grid;animation:fadeIn .25s ease; }
.setup-card { width:100%;max-height:100%;overflow:auto;padding:20px 17px 18px;border:2px solid #b8896c;border-radius:25px;background:#fff8f0;box-shadow:inset 0 0 0 4px #f7e5d7;text-align:center; }
.back-button { display:block;border:0;background:transparent;color:#865d49;font-weight:600;font-size:14px; }
.setup-crown { color:#dfa947;font-size:48px;text-shadow:1px 2px #54372d;margin-top:5px; }
.setup-card h2 { margin:0;font-size:27px; }
.setup-card p { margin:4px 0 16px;color:#8a6754;font-size:14px; }
.player-input-row { display:flex;gap:8px; }
.player-input-row input { min-width:0;flex:1;border:1.5px solid #c99d80;border-radius:15px;padding:11px 13px;background:#fffdf9;color:#54372d;outline:none; }
.player-input-row input:focus { border-color:#b47c4d;box-shadow:0 0 0 3px #e9c69c55; }
.player-input-row button { width:47px;border:0;border-radius:14px;background:#79523e;color:#fff;font-size:27px; }
.player-list { display:grid;gap:7px;margin:14px 0;max-height:230px;overflow:auto; }
.player-chip { display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-radius:13px;background:#f8e7d9;border:1px solid #e4c4ac;text-align:left; }
.player-chip button { border:0;background:transparent;color:#c66c60;font-size:19px; }
.empty-state { padding:18px 8px;color:#a17b65;font-size:13px; }
.continue-button { min-height:52px;font-size:18px; }
.continue-button:disabled { opacity:.45;cursor:not-allowed;transform:none; }
.cute-dialog { width:min(88%,360px);border:2px solid #b8896c;border-radius:24px;padding:24px;background:#fff6ec;color:var(--brown);box-shadow:0 20px 70px #3b241c55;text-align:center; }
.cute-dialog::backdrop { background:#38231d77;backdrop-filter:blur(4px); }
.cute-dialog form { position:relative; }
.dialog-close { position:absolute;right:-8px;top:-13px;border:0;background:transparent;color:#80533f;font-size:28px; }
.dialog-icon { font-size:39px;color:#d9a24c; }
.cute-dialog h2 { margin:4px 0 12px; }
.cute-dialog p { color:#866451;font-size:14px; }
.toggle-row { display:flex;align-items:center;justify-content:space-between;padding:12px 4px;border-top:1px solid #ead4c2;font-size:14px; }
.toggle-row input { position:absolute;opacity:0; }
.toggle { width:43px;height:24px;border-radius:20px;background:#d9c4b4;position:relative;transition:.2s; }
.toggle:after { content:"";position:absolute;width:18px;height:18px;top:3px;left:3px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px #0002; }
.toggle-row input:checked + .toggle { background:#b47c4d; }
.toggle-row input:checked + .toggle:after { transform:translateX(19px); }
.dialog-done { margin-top:13px;width:100%;border:0;border-radius:30px;padding:11px;background:#704a39;color:#fff4e8;font-weight:700; }
.toast { position:absolute;z-index:20;bottom:75px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;padding:9px 16px;border-radius:30px;background:#54372d;color:#fff7ed;font-size:13px;white-space:nowrap;transition:.25s; }
.toast.show { opacity:1;transform:translate(-50%,0); }
@keyframes mascotFloat { 0%,100%{transform:translateY(0) rotate(-.4deg)}50%{transform:translateY(-7px) rotate(.4deg)} }
@keyframes crownBob { 0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-4px) rotate(3deg)} }
@keyframes twinkle { 0%,100%{opacity:.65;transform:scale(.92) rotate(-5deg)}50%{opacity:1;transform:scale(1.12) rotate(7deg)} }
@keyframes popIn { from{opacity:0;transform:translateY(-6px) scale(.97)}to{opacity:1;transform:none} }
@keyframes fadeIn { from{opacity:0}to{opacity:1} }
.reduce-motion *, .reduce-motion *:before, .reduce-motion *:after { animation:none!important;transition:none!important;scroll-behavior:auto!important; }
@media (max-height:720px) {
 .app-shell { min-height:calc(100svh - 18px);padding-top:8px;padding-bottom:10px; }
 .brand h1 { font-size:56px; }.brand p{margin-top:8px;font-size:15px}
 .mascot-stage{height:clamp(185px,31vh,235px)}
 .welcome-pill{padding:6px 15px;font-size:15px}
 .primary-button{min-height:53px;font-size:21px}.secondary-button{min-height:39px}
}
@media (min-width:600px) { .app-shell { min-height:820px; } }

/* Modular screens and persistent roster */
.roster-heading { display:flex;justify-content:space-between;align-items:center;margin:13px 3px 5px;color:#79523e;font-size:13px; }
.roster-heading span { color:#a17b65; }
.player-actions { display:flex;align-items:center;gap:7px; }
.player-chip .edit-player { border:0;border-radius:12px;padding:4px 8px;background:#ead1bd;color:#704a39;font-size:11px; }
.player-chip .remove-player { border:0;background:transparent;color:#c66c60;font-size:21px;line-height:1; }
.storage-note { color:#9a765f;font-size:11px;margin:0 0 12px; }
.app-screen { position:absolute;inset:0;z-index:9;padding:18px;display:none;place-items:center;background:#fff0e3f5;backdrop-filter:blur(7px); }
.app-screen.open { display:grid;animation:fadeIn .22s ease; }
.screen-card { width:100%;max-height:100%;overflow:auto;padding:17px 15px 18px;border:2px solid #b8896c;border-radius:25px;background:#fff8f0;box-shadow:inset 0 0 0 4px #f7e5d7;text-align:center; }
.screen-mascot { font-size:39px;margin:5px 0 0;filter:drop-shadow(0 3px 1px #d9b99d); }
.screen-card h2 { margin:0;color:#57392d;font-size:24px; }
.screen-subtitle { margin:5px 0 12px;color:#92715d;font-size:12px;line-height:1.6; }
.active-roster { display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:10px 0 14px;padding:10px;border-radius:15px;background:#f8e8db; }
.roster-chip { border:1px solid #dfbea5;border-radius:30px;padding:4px 9px;background:#fff9f2;color:#79523e;font-size:11px; }
.game-grid { display:grid;grid-template-columns:1fr 1fr;gap:10px;text-align:left; }
.game-card { min-width:0;padding:12px 10px;border:1.5px solid #d5b198;border-radius:17px;background:linear-gradient(150deg,#fffaf4,#f7e5d7);box-shadow:0 3px 0 #e8cfbc; }
.game-card.gold { border-color:#d9ad65;background:linear-gradient(150deg,#fff8e8,#f3dfc4); }
.game-card.rose { border-color:#dca39d;background:linear-gradient(150deg,#fff5f1,#f4dfda); }
.game-card.peach { border-color:#d9b18f; }
.game-icon { font-size:30px;margin-bottom:3px; }
.game-card h3 { margin:0;color:#684533;font-size:13px;line-height:1.35; }
.game-card strong { display:block;color:#805a43;font-size:12px;margin-top:3px; }
.game-card p { min-height:34px;margin:6px 0;color:#947460;font-size:10px;line-height:1.5; }
.game-card small { display:block;color:#a17b65;font-size:10px;margin-bottom:9px; }
.game-open-button { width:100%;border:1px solid #9c7054;border-radius:20px;padding:7px;background:#704a39;color:#fff4e8;font-size:12px;font-weight:700; }
.eyebrow { color:#bd8b4e;font-size:10px;font-weight:700;letter-spacing:1.5px;margin:0 0 4px; }
.module-placeholder { margin:17px 0;padding:24px 16px;border:1.5px dashed #d2ad91;border-radius:18px;background:#fffaf5;color:#76513e; }
.module-placeholder span { display:block;font-size:31px;margin-bottom:6px; }
.module-placeholder strong { font-size:17px; }
.module-placeholder p { color:#997863;font-size:12px;line-height:1.7;margin:8px 0 0; }
.game-play-card > .primary-button { min-height:49px;font-size:17px; }
@media (max-height:720px) { .screen-card { padding:10px 12px; }.screen-mascot{font-size:30px}.game-card{padding:8px}.game-card p{min-height:27px}.module-placeholder{padding:14px} }

/* Modular screens and persistent roster */
.roster-heading { display:flex;justify-content:space-between;align-items:center;margin:13px 3px 5px;color:#79523e;font-size:13px; }
.roster-heading span { color:#a17b65; }
.player-actions { display:flex;align-items:center;gap:7px; }
.player-chip .edit-player { border:0;border-radius:12px;padding:4px 8px;background:#ead1bd;color:#704a39;font-size:11px; }
.player-chip .remove-player { border:0;background:transparent;color:#c66c60;font-size:21px;line-height:1; }
.storage-note { color:#9a765f;font-size:11px;margin:0 0 12px; }
.app-screen { position:absolute;inset:0;z-index:9;padding:18px;display:none;place-items:center;background:#fff0e3f5;backdrop-filter:blur(7px); }
.app-screen.open { display:grid;animation:fadeIn .22s ease; }
.screen-card { width:100%;max-height:100%;overflow:auto;padding:17px 15px 18px;border:2px solid #b8896c;border-radius:25px;background:#fff8f0;box-shadow:inset 0 0 0 4px #f7e5d7;text-align:center; }
.screen-mascot { font-size:39px;margin:5px 0 0;filter:drop-shadow(0 3px 1px #d9b99d); }
.screen-card h2 { margin:0;color:#57392d;font-size:24px; }
.screen-subtitle { margin:5px 0 12px;color:#92715d;font-size:12px;line-height:1.6; }
.active-roster { display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:10px 0 14px;padding:10px;border-radius:15px;background:#f8e8db; }
.roster-chip { border:1px solid #dfbea5;border-radius:30px;padding:4px 9px;background:#fff9f2;color:#79523e;font-size:11px; }
.game-grid { display:grid;grid-template-columns:1fr 1fr;gap:10px;text-align:left; }
.game-card { min-width:0;padding:12px 10px;border:1.5px solid #d5b198;border-radius:17px;background:linear-gradient(150deg,#fffaf4,#f7e5d7);box-shadow:0 3px 0 #e8cfbc; }
.game-card.gold { border-color:#d9ad65;background:linear-gradient(150deg,#fff8e8,#f3dfc4); }
.game-card.rose { border-color:#dca39d;background:linear-gradient(150deg,#fff5f1,#f4dfda); }
.game-card.peach { border-color:#d9b18f; }
.game-icon { font-size:30px;margin-bottom:3px; }
.game-card h3 { margin:0;color:#684533;font-size:13px;line-height:1.35; }
.game-card strong { display:block;color:#805a43;font-size:12px;margin-top:3px; }
.game-card p { min-height:34px;margin:6px 0;color:#947460;font-size:10px;line-height:1.5; }
.game-card small { display:block;color:#a17b65;font-size:10px;margin-bottom:9px; }
.game-open-button { width:100%;border:1px solid #9c7054;border-radius:20px;padding:7px;background:#704a39;color:#fff4e8;font-size:12px;font-weight:700; }
.eyebrow { color:#bd8b4e;font-size:10px;font-weight:700;letter-spacing:1.5px;margin:0 0 4px; }
.module-placeholder { margin:17px 0;padding:24px 16px;border:1.5px dashed #d2ad91;border-radius:18px;background:#fffaf5;color:#76513e; }
.module-placeholder span { display:block;font-size:31px;margin-bottom:6px; }
.module-placeholder strong { font-size:17px; }
.module-placeholder p { color:#997863;font-size:12px;line-height:1.7;margin:8px 0 0; }
.game-play-card > .primary-button { min-height:49px;font-size:17px; }
@media (max-height:720px) { .screen-card { padding:10px 12px; }.screen-mascot{font-size:30px}.game-card{padding:8px}.game-card p{min-height:27px}.module-placeholder{padding:14px} }
