/* ziltch.css: dice table. Wine felt, cream dice, gold accents. */
:root {
  --felt: #4a1420;
  --felt-2: #62202e;
  --felt-3: #7d2c3c;
  --line: rgba(255, 225, 225, .2);
  --cream: #fbf7ee;
  --ink: #1d1a17;
  --gold: #f2c14e;
  --good: #7be0a0;
  --bad: #ffb3b0;
  --head: 'Fredoka', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);
  --die: clamp(64px, 9vw, 104px);
}
* { box-sizing: border-box; }
html { font-size: 118%; }
html, body { margin: 0; }
body {
  min-height: 100vh; font-family: var(--body); color: var(--cream);
  background:
    radial-gradient(1400px 700px at 40% -10%, var(--felt-3), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, var(--felt-2), transparent 70%),
    var(--felt);
}
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.z-top { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.z-top h1 { margin: 0; font-family: var(--head); font-size: clamp(1.5rem, 2.6vw, 2.1rem); color: var(--gold); }
.z-scores { display: flex; gap: 10px; flex-wrap: wrap; margin-right: auto; }
.z-score { display: grid; justify-items: center; min-width: 7.5em; padding: 6px 14px; border-radius: 16px; background: rgba(0,0,0,.22); border: 2px solid transparent; }
.z-score.is-turn { border-color: var(--gold); background: rgba(242,193,78,.14); }
.z-score-name { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.z-score strong { font-family: var(--head); font-size: 1.7rem; line-height: 1.1; color: var(--gold); }
.z-score-note { font-size: .72rem; opacity: .75; }
.z-target strong { color: var(--cream); }

/* ---------- layout: wide, side panel stacks on small screens ---------- */
.z-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(16px, 2vw, 32px); padding: clamp(14px, 2vw, 32px) clamp(16px, 3vw, 40px); }
.z-table { padding: clamp(16px, 2.4vw, 32px); border-radius: 32px; background: rgba(0,0,0,.18); border: 1px solid var(--line); text-align: center; }
.z-status { margin: 0 0 12px; font-family: var(--head); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }
.z-status.is-mine { color: var(--gold); }

.z-turn { display: flex; gap: 16px; align-items: stretch; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.z-turn-box, .z-aside-wrap { padding: 8px 16px; border-radius: 18px; background: rgba(0,0,0,.2); display: grid; gap: 4px; justify-items: center; align-content: center; }
.z-turn-label { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.z-turn-box strong { font-family: var(--head); font-size: 2.2rem; line-height: 1; color: var(--gold); }
.z-aside { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 34px; align-items: center; }
.z-aside-none { opacity: .6; font-style: italic; font-size: .9rem; }

/* ---------- dice ---------- */
.z-dice { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(10px, 2vw, 22px); min-height: calc(var(--die) + 30px); padding: 12px 0; }
.z-dice-empty { align-self: center; margin: 0; font-size: 1.2rem; color: var(--gold); }
.z-die {
  position: relative; width: var(--die); height: var(--die); padding: 0; border: 0; border-radius: 18%;
  background: linear-gradient(145deg, #fffdf6, #e6dcc6); box-shadow: 0 6px 0 #a89b7d, 0 10px 18px rgba(0,0,0,.45);
  transition: transform .12s ease, box-shadow .12s ease;
}
button.z-die { cursor: pointer; }
.z-face { position: absolute; inset: 14%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.z-pip { width: 72%; aspect-ratio: 1; border-radius: 50%; }
.z-pip.is-on { background: radial-gradient(circle at 35% 35%, #4a4640, #111); }
.z-die.is-held { transform: translateY(-14px); outline: 4px solid var(--gold); outline-offset: 3px; box-shadow: 0 10px 0 #a89b7d, 0 16px 22px rgba(0,0,0,.45); }
.z-die.is-rolling { animation: z-shake .16s linear infinite; }
.z-die.is-small { width: 34px; height: 34px; border-radius: 7px; box-shadow: 0 2px 0 #a89b7d; }
.z-die.is-small .z-face { inset: 12%; }
@keyframes z-shake { 0% { transform: rotate(-12deg) translateY(-4px); } 50% { transform: rotate(10deg) translateY(2px); } 100% { transform: rotate(-12deg) translateY(-4px); } }

.z-pick { min-height: 1.6em; margin: 10px 0 14px; font-family: var(--head); font-size: 1.4rem; font-weight: 600; }
.z-pick.is-ok { color: var(--good); }
.z-pick.is-bad { color: var(--bad); }
.z-hint { min-height: 1.3em; margin: 16px 0 0; color: var(--gold); font-size: 1.05rem; }

/* ---------- command buttons: one size, raised ---------- */
.z-controls { display: grid; grid-template-columns: repeat(auto-fit, 10em); justify-content: center; gap: 16px; }
.z-btn {
  position: relative; padding: 14px 12px; border: 0; border-radius: 16px; text-align: center; cursor: pointer;
  background: linear-gradient(#fffdf6, #e4d9c2); color: var(--ink); font-family: var(--head); font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 6px 0 #978a6c, 0 10px 16px rgba(0,0,0,.4); transition: transform .06s ease, box-shadow .06s ease;
}
.z-btn:hover:not(:disabled) { background: linear-gradient(#ffffff, #ece3cf); }
.z-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #978a6c, 0 3px 6px rgba(0,0,0,.4); }
.z-btn-gold { background: linear-gradient(#ffdd80, #f0b52e); box-shadow: 0 6px 0 #a3760f, 0 10px 16px rgba(0,0,0,.4); }
.z-btn-gold:hover:not(:disabled) { background: linear-gradient(#ffe599, #f4bf45); }
.z-btn-gold:active:not(:disabled) { box-shadow: 0 1px 0 #a3760f, 0 3px 6px rgba(0,0,0,.4); }
.z-btn:disabled { opacity: .4; cursor: default; box-shadow: 0 3px 0 #6f6650; }
.z-btn-sm { padding: 8px 16px; font-size: .95rem; box-shadow: 0 4px 0 #978a6c, 0 6px 10px rgba(0,0,0,.35); }

/* ---------- side panels ---------- */
.z-side { display: grid; gap: 16px; align-content: start; }
.z-panel { padding: 16px 20px; border-radius: 22px; background: rgba(0,0,0,.2); border: 1px solid var(--line); }
.z-panel h2 { margin: 0 0 10px; font-family: var(--head); font-size: 1.25rem; color: var(--gold); }
.z-score-tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.z-score-tbl th { text-align: left; font-weight: 500; padding: 5px 8px 5px 0; }
.z-score-tbl td { text-align: right; font-weight: 700; padding: 5px 0; white-space: nowrap; }
.z-score-tbl tr + tr { border-top: 1px solid var(--line); }
.z-score-tbl small { display: block; font-size: .78rem; opacity: .7; }
.z-rules { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .95rem; line-height: 1.4; }
.z-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 12px; }
.z-stats dd { margin: 0; font-weight: 700; text-align: right; }
.z-link { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; cursor: pointer; }

/* ---------- how-to dialog ---------- */
.z-dialog { max-width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 24px; padding: 24px clamp(18px, 4vw, 32px); background: var(--cream); color: var(--ink); }
.z-dialog::backdrop { background: rgba(0,0,0,.55); }
.z-dialog h2 { margin-top: 0; font-family: var(--head); color: var(--felt-2); }
.z-dialog ol { padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.45; }

/* ---------- pop-up ---------- */
.z-pop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); overflow: hidden; animation: z-pop-fade .2s ease-out; }
@keyframes z-pop-fade { from { opacity: 0; } }
.z-pop-card { position: relative; z-index: 2; width: min(520px, 100%); padding: 26px clamp(18px, 4vw, 34px) 24px; border-radius: 28px; text-align: center; background: var(--cream); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: z-pop-in .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes z-pop-in { from { transform: scale(.6); opacity: 0; } }
.z-pop-big { font-size: clamp(4rem, 14vw, 6rem); line-height: 1; }
.z-pop-card h2 { margin: 8px 0 6px; font-family: var(--head); font-size: clamp(2rem, 6vw, 2.6rem); color: var(--felt-2); }
.z-pop-card.is-party h2 { color: #1f7a45; }
.z-pop-card.is-sad h2 { color: #a3242c; }
.z-pop-card.is-warn h2 { color: #9a6400; }
.z-pop-text { margin: 0 0 18px; font-size: 1.2rem; line-height: 1.45; }
.z-pop-btns { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.z-pop-btns .z-btn { min-width: 9em; }
.z-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.z-confetti span { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; opacity: .9; animation: z-confetti-fall linear forwards; }
@keyframes z-confetti-fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .z-pop, .z-pop-card, .z-die.is-rolling { animation: none; } .z-confetti { display: none; } }

@media (max-width: 980px) {
  .z-main { grid-template-columns: 1fr; }
  .z-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 560px) {
  html { font-size: 106%; }
  :root { --die: 26vw; }
  .z-dice { gap: 12px 4vw; }
  .z-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .z-top { padding: 10px 16px; }
  .z-score { min-width: 0; padding: 4px 10px; }
  .z-score strong { font-size: 1.35rem; }
  .z-main { padding: 12px 16px; }
  .z-table { padding: 14px 10px; border-radius: 24px; }
}

/* ---------- with friends: home, lobby, log, chat (2026-11-16) ---------- */
:root { --seat-1: #e8615a; --seat-2: #3d8bd9; --seat-3: #e0a21a; --seat-4: #8a5cd1; --seat-5: #20a58a; --seat-6: #d9579a; }
.z-home, .z-home:visited { color: inherit; text-decoration: none; }
.z-top-link { margin-left: auto; color: var(--cream); font-weight: 600; }
.z-home-main { padding: clamp(16px, 3vw, 40px); }
.z-lead { margin: 0 0 22px; font-size: 1.2rem; text-align: center; }
.z-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.z-menu-btn {
  display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 120px; padding: 18px 22px; border: 0; border-radius: 26px;
  background: linear-gradient(#fffdf6, #e4d9c2); color: var(--ink); font-family: var(--head); font-size: 1.45rem; font-weight: 700;
  text-decoration: none; cursor: pointer; box-shadow: 0 7px 0 #978a6c, 0 12px 20px rgba(0,0,0,.4);
}
.z-menu-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #978a6c, 0 4px 8px rgba(0,0,0,.4); }
.z-menu-ico { font-size: 2.4rem; }
.z-menu-badge { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #e8505b; color: #fff; font-size: .85rem; vertical-align: middle; }
.z-view { max-width: 720px; margin: 0 auto; }
.z-view[data-view="menu"] { max-width: none; }
.z-view h2 { font-family: var(--head); font-size: 1.8rem; color: var(--gold); margin: 8px 0 16px; }
.z-back-link { background: none; border: 0; padding: 6px 0; color: var(--cream); font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.z-form { display: grid; gap: 10px; margin-bottom: 14px; }
.z-form label { font-weight: 600; }
.z-form input { padding: 14px 16px; border-radius: 14px; border: 0; font: inherit; font-size: 1.3rem; }
#joinCode { text-transform: uppercase; letter-spacing: 4px; font-family: var(--head); }
.z-err { margin: 0; color: var(--bad); font-weight: 600; min-height: 1.2em; }
.z-note { opacity: .85; }
.z-found { font-size: 1.15rem; font-weight: 600; margin: 0; }
.z-names { display: flex; flex-wrap: wrap; gap: 10px; }
.z-names p { flex-basis: 100%; margin: 0; }
#newSeat { display: grid; gap: 10px; }
#newSeat[hidden] { display: none; }
.z-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.z-mine a { display: grid; gap: 4px; padding: 16px 20px; border-radius: 18px; background: rgba(0,0,0,.22); color: var(--cream); text-decoration: none; }
.z-mine strong { font-size: 1.2rem; }

.z-score { position: relative; }
.z-score.z-seat-1 .z-score-name { color: #ffb0ab; } .z-score.z-seat-2 .z-score-name { color: #a9d0f7; } .z-score.z-seat-3 .z-score-name { color: #f6d27c; }
.z-score.z-seat-4 .z-score-name { color: #cdb4f2; } .z-score.z-seat-5 .z-score-name { color: #8fe3cf; } .z-score.z-seat-6 .z-score-name { color: #f4b3d4; }
.z-lobby-list { list-style: none; margin: 0 auto 20px; padding: 0; display: grid; gap: 10px; max-width: 520px; text-align: left; }
.z-lobby-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: rgba(0,0,0,.2); }
.z-lobby-name { flex: 1; font-size: 1.1rem; font-weight: 600; }
.z-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--head); font-weight: 700; color: #fff; background: #777; }
.z-seat-1 .z-av { background: var(--seat-1); } .z-seat-2 .z-av { background: var(--seat-2); } .z-seat-3 .z-av { background: var(--seat-3); }
.z-seat-4 .z-av { background: var(--seat-4); } .z-seat-5 .z-av { background: var(--seat-5); } .z-seat-6 .z-av { background: var(--seat-6); }
.z-invite { display: grid; justify-items: center; gap: 8px; margin: 0 auto 22px; padding: 16px; border-radius: 20px; background: rgba(242,193,78,.14); max-width: 520px; }
.z-invite p { margin: 0; }
.z-invite-code { font-family: var(--head); font-size: 2.4rem; letter-spacing: 6px; color: var(--gold); }
.z-hint.is-bad { color: var(--bad); }
.z-log { list-style: none; margin: 18px auto 0; padding: 0; max-width: 520px; display: grid; gap: 4px; font-size: .95rem; opacity: .85; }
.z-log li:first-child { font-weight: 700; opacity: 1; }
.z-pop-dice { display: flex; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.z-pop-dice .z-die.is-small { width: 42px; height: 42px; }
.z-pop-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 1.15rem; font-weight: 600; }
.z-pop-list li { padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.06); }
.z-pop-list li.is-party { background: rgba(31,138,76,.15); }

/* chat (same as /HAF/, renamed) */
.z-chat-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 48px; height: 48px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.12); color: var(--cream); cursor: pointer; }
.z-chat-btn:hover, .z-chat-btn[aria-expanded="true"] { background: rgba(255,255,255,.24); }
.z-chat-ico svg { width: 28px; height: 28px; display: block; }
.z-chat-btn-label { display: none; }
.z-chat-dot { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: #e8505b; color: #fff; font-size: .8rem; font-weight: 700; }
.z-chat { position: fixed; right: 16px; bottom: 16px; z-index: 150; width: min(420px, calc(100vw - 32px)); height: auto; max-height: min(560px, calc(100% - 90px));
  display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--cream); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.z-chat[hidden] { display: none; }
.z-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; background: var(--felt); color: var(--cream); }
.z-chat-head h2 { margin: 0; font-family: var(--head); font-size: 1.3rem; color: var(--gold); }
.z-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: var(--cream); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.z-chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.z-chat-list > :first-child { margin-top: auto; }
.z-chat-empty { margin: auto; color: #777; font-style: italic; }
.z-chat-msg { align-self: flex-start; max-width: 85%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-size: 1.05rem; line-height: 1.35; overflow-wrap: anywhere; }
.z-chat-msg.is-mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: #f6dfe2; }
.z-chat-name { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 2px; }
.z-seat-1-text { color: #c0392b; } .z-seat-2-text { color: #2c6fb3; } .z-seat-3-text { color: #a8740a; }
.z-seat-4-text { color: #6f45b3; } .z-seat-5-text { color: #158068; } .z-seat-6-text { color: #b33a7a; }
.z-chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; border-top: 1px solid #e3dccb; }
.z-chat-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid #cfc6b1; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; }
.z-chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.z-chat-input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #cfc6b1; font-size: 1.05rem; }
.z-chat-send { flex: none; padding: 10px 16px; }
.z-chat-err { margin: 0; padding: 0 12px 10px; color: #b3262e; font-weight: 600; }
.z-chat-err:empty { display: none; }
.z-chat-toast { position: fixed; top: 76px; right: 16px; z-index: 140; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border: 0; border-radius: 16px;
  background: var(--cream); color: var(--ink); text-align: left; font: inherit; font-size: 1.05rem; box-shadow: 0 10px 30px rgba(0,0,0,.45); cursor: pointer; }
@media (max-width: 560px) {
  .z-chat { right: 0; bottom: 0; width: 100vw; max-height: calc(100% - 70px); border-radius: 22px 22px 0 0; }
  .z-chat-toast { left: 16px; right: 16px; }
  .z-menu-btn { min-height: 96px; font-size: 1.3rem; }
  .z-game-page .z-top h1 { font-size: 1.3rem; }
}
/* the notification bell (js/notify.js) */
.z-bell { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.12); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.z-bell:hover { background: rgba(255,255,255,.24); }
.z-bell.is-on { background: rgba(242,193,78,.3); border-color: var(--gold); }
#bellSlot:empty, #chatSlot:empty { display: none; }
