:root {
  --bg1: #0b1026;
  --bg2: #04060f;
  --ink: #f4efe6;
  --muted: #a9a8c3;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --blue: #1f6fd1;      /* Sidi Bou Said blue */
  --blue2: #3d8ef0;
  --red: #e70013;       /* flag red */
  --gold: #f5c04a;
  --green: #2fb36d;
  --wolf: #ff4d5e;
  --radius: 18px;
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', 'Geeza Pro', 'Noto Naskh Arabic', sans-serif;
  --display: 'Lalezar', 'Cairo', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 80% at 50% 0%, var(--bg1), var(--bg2));
  background-attachment: fixed;
  min-height: 100dvh;
  overscroll-behavior: none;
  transition: background 1.2s ease;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }

/* ---------- moods ---------- */
body[data-mode="dusk"] { --bg1: #3a1f4d; --bg2: #0d0b1f; }
body[data-mode="night"] { --bg1: #0b1026; --bg2: #02030a; }
body[data-mode="dawn"] { --bg1: #c9653a; --bg2: #2a1a3a; }
body[data-mode="day"] { --bg1: #2c7fc9; --bg2: #123a63; }
body[data-mode="vote"] { --bg1: #7a1c2a; --bg2: #1d0b14; }
body[data-mode="win"] { --bg1: #c78a1c; --bg2: #3a1f0b; }
body[data-mode="deal"] { --bg1: #1b1240; --bg2: #05040d; }

.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, #ffeccc, transparent),
    radial-gradient(1px 1px at 280px 40px, #fff, transparent),
    radial-gradient(1px 1px at 60px 200px, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 330px 230px, #fff, transparent);
  background-size: 360px 260px;
  opacity: 0.7;
  transition: opacity 1.2s;
  animation: twinkle 6s ease-in-out infinite alternate;
}
body[data-mode="day"] .stars, body[data-mode="dawn"] .stars, body[data-mode="win"] .stars { opacity: 0; }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 0.8; } }

#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 20px);
}

/* ---------- generic ---------- */
.screen { display: flex; flex-direction: column; gap: 14px; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 0.88rem; }
.center { text-align: center; justify-content: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.err { color: var(--wolf); min-height: 1.2em; margin: 0; text-align: center; font-weight: 600; }
.warn { background: rgba(245, 192, 74, 0.12); border: 1px solid rgba(245, 192, 74, 0.4); color: #ffe2a0; padding: 10px 12px; border-radius: 12px; margin: 0; font-size: 0.9rem; }
.okmsg { background: rgba(47, 179, 109, 0.14); border: 1px solid rgba(47, 179, 109, 0.45); padding: 10px 12px; border-radius: 12px; margin: 0; font-size: 0.9rem; }
.pill { background: var(--card-strong); padding: 6px 14px; border-radius: 999px; font-weight: 700; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.02rem;
  transition: transform 0.08s, background 0.2s, opacity 0.2s;
  backdrop-filter: blur(6px);
}
.btn:active { transform: scale(0.97); }
.btn.big { padding: 16px 20px; font-size: 1.15rem; width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 0.9rem; }
.btn.primary { background: linear-gradient(135deg, var(--blue2), var(--blue)); border-color: transparent; box-shadow: 0 6px 20px rgba(31, 111, 209, 0.35); }
.btn.good { background: linear-gradient(135deg, #3ccf82, var(--green)); border-color: transparent; }
.btn.danger { background: linear-gradient(135deg, #ff4b5c, var(--red)); border-color: transparent; box-shadow: 0 6px 20px rgba(231, 0, 19, 0.3); }
.btn.ghost { background: var(--card); }
.btn:disabled { opacity: 0.45; box-shadow: none; }
label.btn { display: inline-flex; align-items: center; }

.icon {
  border: none; background: var(--card); width: 44px; height: 44px; border-radius: 12px;
  font-size: 1.3rem; display: inline-grid; place-items: center; flex: none;
}
.icon.sm { width: 36px; height: 36px; font-size: 1rem; }

.sticky { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 8px); padding-top: 6px; }

/* ---------- home ---------- */
.home { text-align: center; padding-top: 4vh; gap: 18px; }
.sky { position: relative; height: 0; }
.moon {
  position: absolute; top: -10px; inset-inline-end: 6px; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe8, #f3d98a 60%, #c9a54e);
  box-shadow: 0 0 40px 10px rgba(255, 230, 150, 0.35);
}
.logo { margin-top: 30px; }
.logo .wolf { font-size: 76px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.logo h1 { font-family: var(--display); font-weight: 400; font-size: 3.1rem; letter-spacing: 1px; color: var(--gold); text-shadow: 0 3px 0 #7a2a12, 0 8px 24px rgba(0, 0, 0, 0.5); }
.logo .sub { font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 0.85rem; color: var(--muted); }
.tagline { font-size: 1.05rem; margin: 0; }
.foot { margin-top: 6px; }

/* ---------- menu bars ---------- */
.mbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mbar h2 { font-size: 1.25rem; text-align: center; flex: 1; }
.mbar span { width: 44px; }

/* ---------- players ---------- */
.addrow { display: flex; gap: 8px; }
.addrow input {
  flex: 1; min-width: 0; padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3); font-size: 1.1rem; outline: none;
}
.addrow input:focus { border-color: var(--blue2); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: p; }
.plist li {
  counter-increment: p; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); padding: 8px 10px; border-radius: 14px; font-weight: 700;
}
.plist li::before { content: counter(p); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); font-size: 0.85rem; flex: none; }
.plist li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- roles ---------- */
.rlist { display: grid; gap: 8px; }
.rrow {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.rrow.wolves { border-color: rgba(255, 77, 94, 0.45); background: rgba(255, 77, 94, 0.08); }
.rrow .re { font-size: 2rem; flex: none; }
.rrow .rt { flex: 1; min-width: 0; }
.rrow .rt small { color: var(--muted); font-size: 0.75rem; }
.rrow .rt p { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.vcount { font-size: 1.3rem; min-width: 44px; text-align: center; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: none; background: var(--card-strong); font-size: 1.2rem; font-weight: 800; }
.stepper b { min-width: 24px; text-align: center; font-size: 1.15rem; }

.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 30px; background: rgba(255, 255, 255, 0.18); transition: 0.2s; }
.switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { inset-inline-start: 25px; }

.opts { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.orow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.orow > span { font-weight: 600; }
.orow select { max-width: 60%; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.orow input[type=range] { width: 50%; accent-color: var(--blue2); }
.seg { display: flex; background: rgba(0, 0, 0, 0.3); border-radius: 12px; padding: 3px; }
.seg button { border: none; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 700; }
.seg button.on { background: var(--blue); }
@media (max-width: 380px) { .col-on-small { flex-direction: column; align-items: stretch; } .orow select { max-width: 100%; } }

/* ---------- deal ---------- */
.deal { text-align: center; align-items: center; padding-top: 6vh; gap: 18px; }
.dealstep { background: var(--card); padding: 4px 14px; border-radius: 999px; font-weight: 700; }
.bigname { font-family: var(--display); font-weight: 400; font-size: 3rem; color: var(--gold); word-break: break-word; }
.center-screen { text-align: center; align-items: center; padding-top: 12vh; gap: 22px; }
.bigemoji { font-size: 80px; }

.hold {
  perspective: 1200px;
  position: relative; width: 100%; max-width: 340px; aspect-ratio: 3 / 4; margin: 0 auto;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.hold .back, .hold .front {
  position: absolute; inset: 0; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden; transition: transform 0.35s ease, opacity 0.2s;
}
.hold .back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #233a8a, #11173a);
  border: 2px solid rgba(245, 192, 74, 0.6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  gap: 10px; padding: 20px;
}
.hold .back .fp { font-size: 64px; animation: bob 1.6s ease-in-out infinite; }
.hold .back p { margin: 0; font-weight: 700; }
.hold .front { transform: rotateY(180deg); opacity: 0; }
.hold.open .back { transform: rotateY(180deg); opacity: 0; }
.hold.open .front { transform: none; opacity: 1; }
.hold .front .rolecard { width: 100%; height: 100%; }
.lovernote { position: absolute; bottom: 10px; margin: 0; font-weight: 800; background: rgba(255, 105, 180, 0.25); padding: 4px 12px; border-radius: 999px; }

.rolecard {
  border-radius: 24px; padding: 22px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, #1f6fd1, #0e2f63); border: 2px solid rgba(255, 255, 255, 0.3);
}
.rolecard.wolves { background: linear-gradient(160deg, #b3122a, #3a0710); border-color: rgba(255, 140, 140, 0.5); }
.rolecard .remoji { font-size: 84px; line-height: 1.1; }
.rolecard .rname { font-family: var(--display); font-size: 2.4rem; color: #fff; }
.rolecard .rfr { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; font-weight: 700; }
.rolecard .rteam { background: rgba(0, 0, 0, 0.25); padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }
.rolecard .rdesc { margin: 8px 0 0; line-height: 1.6; font-size: 0.98rem; }
.rolecard.compact { padding: 14px; gap: 2px; margin: 8px auto; max-width: 280px; }
.rolecard.compact .remoji { font-size: 56px; }
.rolecard.compact .rname { font-size: 1.9rem; }

/* ---------- game ---------- */
.game { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - 40px); }
.gbar { display: flex; align-items: center; gap: 10px; }
.gtitle { flex: 1; text-align: center; font-weight: 800; font-size: 1.1rem; }
#stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.orb {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 62px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.04) 70%);
  border: 1px solid var(--line);
  box-shadow: 0 0 50px rgba(160, 180, 255, 0.25), inset 0 0 30px rgba(255, 255, 255, 0.06);
}
body[data-mode="night"] .orb { box-shadow: 0 0 60px rgba(120, 140, 255, 0.35), inset 0 0 30px rgba(255, 255, 255, 0.06); }
body[data-mode="dawn"] .orb, body[data-mode="win"] .orb { box-shadow: 0 0 70px rgba(255, 190, 90, 0.55); }
body[data-mode="vote"] .orb { box-shadow: 0 0 60px rgba(255, 70, 90, 0.45); }
.orb.pop, .ntext.pop { animation: pop 0.45s ease; }
@keyframes pop { 0% { transform: scale(0.85); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
/* make room for choices: smaller orb when the action area is in use */
.game:has(#act:not(:empty)) .orb { width: 76px; height: 76px; font-size: 40px; }
.game:has(#act:not(:empty)) .ntext .ar { font-size: 1.08rem; }
body.speaking .orb { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }

.narr { width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 8px; }
.ntext p { margin: 0 0 8px; line-height: 1.75; }
.ntext .ar { font-size: 1.22rem; font-weight: 600; }
.ntext .lat { font-size: 0.95rem; color: var(--muted); font-style: italic; }
.ntext .ar + .lat { border-top: 1px dashed var(--line); padding-top: 6px; }
.ntext .nm { color: var(--gold); font-style: normal; }
.nctl { display: flex; align-items: center; justify-content: space-between; }
.wave { display: inline-flex; gap: 4px; align-items: center; height: 20px; opacity: 0.25; transition: opacity 0.3s; }
.wave i { width: 4px; height: 6px; background: var(--gold); border-radius: 2px; }
body.speaking .wave { opacity: 1; }
body.speaking .wave i { animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.15s !important; }
.wave i:nth-child(3) { animation-delay: 0.3s !important; }
.wave i:nth-child(4) { animation-delay: 0.45s !important; }
@keyframes wave { 50% { height: 18px; } }

#act { display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }
#act:empty { display: none; }
.prompt { font-size: 1.15rem; font-weight: 800; text-align: center; margin: 4px 0 0; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.pbtn {
  border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 8px; font-weight: 800; font-size: 1.05rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: 0.15s;
}
.pbtn.on { border-color: var(--gold); background: rgba(245, 192, 74, 0.2); transform: scale(1.03); }
.modal .pgrid { margin-bottom: 12px; }

.countdown { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ring {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 800;
  border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--gold); animation: spin 1.2s linear infinite;
}
.ring span { animation: spin 1.2s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.victim { text-align: center; font-family: var(--display); font-size: 2.4rem; color: var(--wolf); }
.deathcard { text-align: center; }
.deathcard .dname { font-family: var(--display); font-size: 2.6rem; color: var(--gold); text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }

.timer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.clock { font-size: 4.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 2px; direction: ltr; }
.clock.urgent { color: var(--gold); animation: pulse 1s infinite; }

.village { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.vchip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.vchip.dead { opacity: 0.55; }
.vchip.dead > span:not(.tag) { text-decoration: line-through; }
.vchip .tag { font-size: 0.78rem; background: rgba(0, 0, 0, 0.3); padding: 1px 8px; border-radius: 999px; font-weight: 600; }

.tally { display: grid; gap: 6px; }
.trow { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px; transition: 0.15s; }
.trow.top { border-color: var(--wolf); background: rgba(255, 77, 94, 0.15); }
.tname { flex: 1; font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb { width: 42px; height: 42px; border-radius: 12px; border: none; background: var(--card-strong); font-size: 1.4rem; font-weight: 800; }
.tc { min-width: 30px; text-align: center; font-size: 1.3rem; }

.wintitle { text-align: center; font-family: var(--display); font-weight: 400; font-size: 2.2rem; color: var(--gold); }
.endlist { display: grid; gap: 6px; }
.erow { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.erow.winner { border-color: var(--gold); background: rgba(245, 192, 74, 0.14); }
.erow.dead .en { text-decoration: line-through; opacity: 0.7; }
.erow .ee { font-size: 1.5rem; }
.erow .en { flex: 1; font-weight: 800; }
.erow .er { color: var(--muted); font-size: 0.9rem; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn 0.2s; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: #151a36; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 12px;
}
.sheet h3 { text-align: center; }
.sheet .hold { max-width: 280px; }

/* ---------- how to ---------- */
.howto { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.7; }

/* ---------- recorder ---------- */
.progress { height: 10px; background: var(--card); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); }
.seglist { display: grid; gap: 8px; }
.seg-item { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.seg-item.has { border-color: rgba(47, 179, 109, 0.6); }
.seg-item.rec { border-color: var(--red); background: rgba(231, 0, 19, 0.15); }
.segtext { flex: 1; min-width: 0; }
.segtext p { margin: 0; line-height: 1.6; }
.segtext .ar { font-weight: 600; }
.segtext .lat { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.segbtns { display: flex; flex-direction: column; gap: 6px; }
.seg-item.rec .rec-btn { background: var(--red); animation: pulse 1s infinite; }

/* ---------- online ---------- */
.bigin { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); font-size: 1.15rem; outline: none; width: 100%; }
.bigin:focus, .codein:focus { border-color: var(--blue2); }
.codein { flex: 1; min-width: 0; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); font-size: 1.5rem; font-weight: 800; letter-spacing: 8px; text-align: center; text-transform: uppercase; outline: none; direction: ltr; }
.codebox { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.codebox .code { font-size: 3rem; font-weight: 800; letter-spacing: 12px; color: var(--gold); line-height: 1; padding-left: 12px; }
.qr { width: 180px; max-width: 60vw; background: #fff; border-radius: 12px; overflow: hidden; }
.qr:empty { display: none; }
.qr svg { display: block; width: 100%; height: auto; }
.plist li.off { opacity: 0.5; }
.plist .tag, .vchip .tag { font-size: 0.75rem; background: rgba(0, 0, 0, 0.3); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.vchip.off { border-style: dashed; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.prompt.yourturn { color: var(--gold); font-size: 1.25rem; }
.sleep { text-align: center; padding: 20px 10px; }
.sleep .zzz { font-size: 64px; animation: bob 2.4s ease-in-out infinite; }
.sleep p { color: var(--muted); line-height: 1.7; }
.deadnote { text-align: center; color: var(--muted); background: var(--card); border-radius: 12px; padding: 8px; margin: 0; }
.hostctl { padding: 6px 0 10px; border-top: 1px dashed var(--line); }
.tby { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; }
.trow { flex-wrap: wrap; }
.wolfnote { background: rgba(255, 77, 94, 0.3); bottom: 46px; }
.soundgate { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 20; width: auto !important; animation: pulse 1.2s infinite; }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); z-index: 30; background: #222a55; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: fadeIn 0.2s; max-width: calc(100vw - 32px); }
body.offline::after { content: '📡'; position: fixed; top: calc(env(safe-area-inset-top) + 8px); inset-inline-end: 60px; z-index: 25; font-size: 1.2rem; animation: pulse 1s infinite; }
.btn.on { border-color: var(--gold); background: rgba(245, 192, 74, 0.2); }

.plist li.narr-row { border-color: var(--gold); background: rgba(245, 192, 74, 0.1); }
.plist .tag.narr { background: rgba(245, 192, 74, 0.3); }
.plist .icon.on { background: var(--gold); }
.readaloud { color: var(--gold); font-weight: 800; font-size: 0.85rem; margin-bottom: 4px; }
.readaloud:empty { display: none; }
#doneArea:not(:empty) { margin-top: 8px; }
#god:empty { display: none; }
#god { display: flex; flex-direction: column; gap: 8px; }
.waiting { text-align: center; color: var(--gold); font-weight: 700; margin: 0; }
.erow.wolfrow { border-color: rgba(255, 77, 94, 0.5); }
body[data-mode="night"] .narr .ntext .ar { font-size: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
