/* Figaro's Game Room - shared look (red, cream, green) */
:root{--badge-safe:calc(76px + env(safe-area-inset-bottom, 0px));--red:#b3202a;--red-d:#8a141d;--cream:#fdf3e1;--cream-d:#f3e2c3;--green:#2e7d32;--green-d:#1f5a23;--ink:#3b2314;--gold:#f2b705}
*{box-sizing:border-box;margin:0;padding:0}
html,body{min-height:100%;background:var(--cream);color:var(--ink);
  font-family:"Trebuchet MS","Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-tap-highlight-color:transparent}
body.game{height:100%;overflow:hidden;-webkit-user-select:none;user-select:none;overscroll-behavior:none}
.wrap{max-width:640px;margin:0 auto}
.topbar{display:flex;align-items:center;gap:8px;padding:8px 10px;padding-top:max(8px,env(safe-area-inset-top));
  background:var(--red);color:#fff;border-bottom:4px solid var(--green);position:relative;z-index:6}
.topbar h1{flex:1;min-width:0;font-family:Georgia,"Times New Roman",serif;font-style:italic;font-size:18px;line-height:1.1;
  text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.back{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 10px;border-radius:999px;
  background:var(--red-d);color:#fff;border:2px solid #fff;font-weight:700;font-size:13px;line-height:1;font-family:inherit;text-decoration:none;white-space:nowrap;font-family:inherit;cursor:pointer}
.back:active{transform:scale(.97)}
.tb-right{flex:0 0 auto;min-width:50px;text-align:right;font-weight:800;font-size:15px}
.tb-right small{display:block;font-size:10px;font-weight:400;opacity:.85;text-transform:uppercase;letter-spacing:.06em}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:0 18px;border:0;border-radius:999px;
  background:var(--green);color:#fff;font-weight:800;font-size:17px;line-height:1;font-family:inherit;cursor:pointer;box-shadow:0 4px 0 var(--green-d);text-decoration:none}
.btn:active{transform:translateY(2px);box-shadow:0 2px 0 var(--green-d)}
.btn.red{background:var(--red);box-shadow:0 4px 0 var(--red-d)}
.btn.ghost{background:#fff;color:var(--ink);border:2px solid var(--cream-d);box-shadow:0 3px 0 var(--cream-d)}
.btn.small{min-height:40px;padding:0 12px;font-size:15px}
.btn[aria-pressed="true"]{background:var(--gold);color:var(--ink);box-shadow:0 4px 0 #b88a00}
.btn:disabled{opacity:.45}
button:focus-visible,a:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.toolbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;padding:8px}
.status{text-align:center;font-weight:700;padding:6px 10px;min-height:30px}
/* modal */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:18px;padding-bottom:calc(18px + var(--badge-safe));overflow-y:auto;background:rgba(59,35,20,.5);z-index:20}
.modal.show{display:flex}
.modal .card{width:100%;max-width:380px;background:var(--cream);border:4px solid var(--red);border-radius:18px;padding:0 18px 18px;text-align:center;
  box-shadow:0 10px 30px rgba(0,0,0,.3);overflow:hidden}
.stripe{display:flex;height:10px;margin:0 -18px 14px}.stripe i{flex:1}
.stripe i:nth-child(1){background:var(--green)}.stripe i:nth-child(2){background:#fff}.stripe i:nth-child(3){background:var(--red)}
.modal h2{color:var(--red);font-family:Georgia,serif;font-style:italic;font-size:30px;margin-bottom:6px}
.modal p{margin:6px 0}
.modal .actions{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.modal .ready{color:var(--green-d);font-weight:700;font-style:italic}
/* on-screen keyboard */
.kb{display:flex;flex-direction:column;gap:6px;padding:6px 4px 4px;touch-action:manipulation}
.kb-row{display:flex;gap:4px;justify-content:center}
.key{flex:1 1 0;max-width:46px;min-width:0;height:50px;border:0;border-radius:7px;background:#e9d6b4;color:var(--ink);
  font-weight:800;font-size:17px;line-height:1;font-family:inherit;text-transform:uppercase;cursor:pointer;padding:0}
.key.wide{flex:1.6 1 0;max-width:72px;font-size:13px}
.key:active{filter:brightness(.9)}
.toast{position:fixed;left:50%;top:76px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;
  font-weight:700;z-index:30;opacity:0;transition:opacity .2s;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1}

/* ---------------------------------------------------------------------------
   NETLIFY BADGE SAFE ZONE
   The free Netlify plan injects a fixed "Powered by Netlify" badge (an iframe,
   192x64px, pinned bottom-right). We must not hide it, so every game screen ends
   76px (badge 64px + 12px gap) plus the phone's safe-area inset above the bottom
   edge. The strip below .app is intentionally left empty.
   --------------------------------------------------------------------------- */
.app{height:calc(100vh - 76px);height:calc(100vh - 76px - env(safe-area-inset-bottom, 0px))}
@supports (height:100dvh){.app{height:calc(100dvh - 76px - env(safe-area-inset-bottom, 0px))}}
@media (max-height:700px){
  .key{height:42px;font-size:16px}
  .kb{gap:5px;padding-top:4px}
  .topbar{padding-top:max(6px,env(safe-area-inset-top));padding-bottom:6px}
  .status{min-height:24px;padding:3px 10px;font-size:14px}
}
