@font-face {
  font-family: 'Vazirmatn';
  src: local('Vazirmatn'), url('fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #12142B;
  --surface: #1E2142;
  --raised: #2B2F5C;
  --card: #1A1D3A;
  --text: #F3EEE3;
  --muted: #A9A6C4;
  --line: rgba(243, 238, 227, .1);
  --gold: #E8B04A;
  --gold-ink: #12142B;
  --red: #E06A5F;
  --red-deep: #C2453B;
  --green: #4FB98A;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #0B0C1C;
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
}
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#app {
  position: relative;
  max-width: 480px;
  min-height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color .9s ease, color .9s ease;
}

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.pad { padding: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
h1, h2, h3, p { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  border: none;
  border-radius: 14px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--raised);
  color: var(--text);
  transition: transform .12s ease, background-color .2s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.red { background: var(--red-deep); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.big { min-height: 60px; font-size: 19px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; font-size: 13px; padding: 0 12px; border-radius: 11px; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 13px; border: none;
  background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.iconbtn:active { transform: scale(.94); }
.badge-dot {
  position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--red-deep); color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

.card { background: var(--surface); border-radius: 20px; padding: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  background: var(--surface); padding: 6px 12px; font-size: 13px; color: var(--muted);
}
.field {
  width: 100%; height: 48px; border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--card); padding: 0 14px; color: var(--text); outline: none;
}
.field:focus { border-color: var(--gold); }
label.lbl { font-size: 13px; color: var(--muted); }

/* ---------- top bar & bottom nav ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.me-chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: none;
  border-radius: 999px; padding: 4px 14px 4px 4px; color: var(--text); min-height: 48px;
}
.me-chip .nm { font-weight: 800; font-size: 14px; }
.me-chip .pts { font-size: 12px; color: var(--gold); }
.bottomnav {
  display: flex; justify-content: space-around; border-top: 1px solid var(--line);
  background: var(--surface); padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav button {
  background: none; border: none; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-size: 12px; min-width: 76px; min-height: 52px; justify-content: center; border-radius: 12px;
}
.bottomnav button.on { color: var(--gold); }

/* ---------- home ---------- */
.hero { position: relative; height: 250px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 14px; }
.hero .moon { position: absolute; top: 14px; left: 34px; color: var(--gold); animation: floaty 6s ease-in-out infinite; }
.hero .stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .5; animation: twinkle 3s ease-in-out infinite; }
.hero .crowd { display: flex; align-items: flex-end; gap: 0; margin-bottom: 6px; }
.hero .crowd .av { margin: 0 -8px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.hero .crowd > div:nth-child(1) { animation: bob 3.2s ease-in-out infinite; }
.hero .crowd > div:nth-child(2) { animation: bob 3.2s ease-in-out .4s infinite; position: relative; z-index: 2; }
.hero .crowd > div:nth-child(3) { animation: bob 3.2s ease-in-out .8s infinite; }
.logo { font-size: 48px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
.logo span { color: var(--red); }
.tagline { color: var(--muted); font-size: 14px; }

.room-item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px 12px; }
.section-title { font-size: 15px; font-weight: 800; margin: 6px 2px 2px; }

/* ---------- emblem ---------- */
.emb {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 30%;
  background: color-mix(in srgb, var(--tc) 22%, transparent); color: var(--tc); flex-shrink: 0;
  border: 1.5px solid color-mix(in srgb, var(--tc) 55%, transparent);
}
.tag { font-size: 10px; font-weight: 800; border-radius: 6px; padding: 1px 5px; line-height: 1.5; color: #12142B; }

/* ---------- team ---------- */
.team-banner { border-radius: 22px; padding: 18px; background: var(--surface); position: relative; overflow: hidden; }
.team-banner::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--tc); border-radius: 22px; opacity: .5; pointer-events: none; }
.team-name { font-size: 22px; font-weight: 900; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; background: var(--card); border-radius: 14px; padding: 10px 4px; }
.stat b { font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); }
.codebox {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card);
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 8px 8px 8px 14px;
}
.codebox b { font-size: 22px; letter-spacing: 4px; direction: ltr; color: var(--gold); }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: none; }
.rank { width: 24px; text-align: center; font-weight: 800; color: var(--muted); }
.rank.r1 { color: var(--gold); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw {
  width: 44px; height: 44px; border-radius: 13px; border: 2px solid transparent; display: inline-flex;
  align-items: center; justify-content: center; background: var(--card); color: var(--muted);
}
.sw.on { border-color: var(--gold); color: var(--gold); }
.sw .dot { width: 26px; height: 26px; border-radius: 9px; }
.chatbox { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; padding: 4px 0; }
.msg { font-size: 14px; line-height: 1.7; }
.msg b { color: var(--gold); font-weight: 800; }
.msg.sys { color: var(--muted); font-size: 12px; text-align: center; }
.msg.mafia b { color: var(--red); }
.msg.ghost { opacity: .75; font-style: italic; }
.chat-input { display: flex; gap: 8px; }
.chat-input .field { height: 46px; }
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: none; background: none; color: var(--muted); border-radius: 11px; min-height: 40px; font-weight: 800; }
.seg button.on { background: var(--raised); color: var(--text); }

/* ---------- lobby ---------- */
.room-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.room-head h2 { font-size: 18px; font-weight: 900; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slot {
  position: relative; border-radius: 16px; background: var(--card); min-height: 104px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; animation: pop .4s cubic-bezier(.3,1.6,.5,1) both;
}
.slot.empty { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-size: 11px; animation: none; }
.slot .nm { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .host { position: absolute; top: 6px; right: 6px; color: var(--gold); }
.slot .botb { position: absolute; top: 6px; left: 6px; color: var(--muted); }
.slot .kick {
  position: absolute; bottom: 4px; left: 4px; width: 28px; height: 28px; border-radius: 9px; border: none;
  background: rgba(194, 69, 59, .2); color: var(--red); display: flex; align-items: center; justify-content: center;
}
.slot.off { opacity: .45; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 38px; height: 38px; border-radius: 11px; border: none; background: var(--raised); font-weight: 900; font-size: 18px; }
.stepper b { min-width: 56px; text-align: center; font-size: 14px; }

/* ---------- game ---------- */
.game { position: relative; display: flex; flex-direction: column; height: 100%; }
#app[data-time="day"] {
  --bg: #EDE0C6; --surface: #FBF3E2; --raised: #E2D0AE; --card: #F7EDD9; --text: #2A2238; --muted: #6A5D52;
  --line: rgba(42, 34, 56, .14); --gold-ink: #2A2238; --shadow: 0 10px 30px rgba(80, 50, 20, .18);
}
#app[data-time="day"] .msg b { color: #9A6A12; }
#app[data-time="day"] .msg.mafia b { color: #B23A30; }
.sky { position: absolute; inset: 0 0 auto 0; height: 200px; pointer-events: none; overflow: hidden; }
.sky .orb { position: absolute; top: 18px; left: 26px; transition: transform 1.2s cubic-bezier(.3,.9,.3,1), opacity 1s; }
#app[data-time="day"] .sky .moon-orb { transform: translateY(120px); opacity: 0; }
#app[data-time="night"] .sky .sun-orb { transform: translateY(120px); opacity: 0; }
.sky .sun-orb { color: #E39B2D; }
.sky .moon-orb { color: var(--gold); }
#app[data-time="day"] .sky .stars { opacity: 0; }
.sky .stars { transition: opacity 1s; }
.sky .stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .45; animation: twinkle 3s ease-in-out infinite; }

.ghead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; position: relative; gap: 8px; }
.ghead h1 { font-size: 21px; font-weight: 900; }
.timer { font-variant-numeric: tabular-nums; min-width: 64px; justify-content: center; }
.timer.low { color: var(--red); animation: pulse 1s ease-in-out infinite; }
.tbar { height: 3px; margin: 0 16px; border-radius: 2px; background: var(--line); overflow: hidden; position: relative; }
.tbar i { position: absolute; inset: 0; background: var(--gold); transform-origin: right; }
.narrator {
  margin: 10px 16px 12px; background: var(--surface); border-radius: 16px; padding: 11px 14px; display: flex; gap: 10px;
  align-items: flex-start; position: relative; font-size: 14px; line-height: 1.75; box-shadow: var(--shadow);
}
.narrator .ic { color: var(--gold); flex-shrink: 0; margin-top: 3px; }
.narrator strong { color: var(--gold); }
#app[data-time="day"] .narrator strong { color: #9A6A12; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 0 16px; position: relative; }
.pcard {
  position: relative; border: 2px solid transparent; border-radius: 16px; background: var(--card); color: var(--text);
  padding: 8px 3px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 100px;
  transition: transform .2s ease, border-color .2s, background-color .9s, box-shadow .2s, filter .6s, opacity .6s;
}
.pcard .nm { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sub { font-size: 10px; color: var(--muted); display: flex; gap: 3px; align-items: center; min-height: 15px; }
.pcard.me { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.pcard.pickable { cursor: pointer; }
.pcard.pickable:hover { transform: translateY(-2px); }
.pcard.sel { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); transform: translateY(-3px); }
.pcard.dead { filter: grayscale(1); opacity: .45; }
.pcard.dying { animation: die 1.1s ease both; }
.pcard .stamp {
  position: absolute; top: 36px; font-size: 10px; font-weight: 900; background: var(--red-deep); color: #fff;
  border-radius: 6px; padding: 1px 7px; transform: rotate(-8deg); animation: stamp .5s cubic-bezier(.3,1.6,.5,1) both;
}
.pcard .votes {
  position: absolute; top: -7px; right: -5px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--red-deep);
  color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; padding: 0 6px;
  animation: pop .35s cubic-bezier(.3,1.8,.5,1) both; box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.pcard .susp {
  position: absolute; top: 4px; left: 4px; display: flex; align-items: center; gap: 1px; font-size: 10px; font-weight: 800;
  color: #fff; background: rgba(0,0,0,.45); border-radius: 8px; padding: 1px 4px;
}
.pcard .ready { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 9px; background: var(--green); color: #12142B; display: flex; align-items: center; justify-content: center; }
.rolechip { font-size: 9.5px; font-weight: 800; border-radius: 6px; padding: 0 5px; line-height: 1.6; white-space: nowrap; font-style: normal; }
.rolechip.mafia { background: rgba(224, 106, 95, .2); color: var(--red); }
.rolechip.town { background: rgba(79, 185, 138, .18); color: var(--green); }
#app[data-time="day"] .rolechip.town { color: #1F7A52; }
#app[data-time="day"] .rolechip.mafia { color: #B23A30; }
.pcard .knife { position: absolute; bottom: 30px; left: 2px; color: var(--red); animation: pop .3s both; }
.pcard .offline { position: absolute; bottom: 4px; left: 4px; width: 8px; height: 8px; border-radius: 4px; background: var(--muted); }
.bubble {
  position: absolute; bottom: calc(100% - 6px); left: 50%; z-index: 20; max-width: 150px; width: max-content;
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.5; border-radius: 12px; padding: 5px 9px;
  transform: translateX(-50%); animation: bubble 3.6s ease both; pointer-events: none; box-shadow: var(--shadow);
}
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--text); }
.bubble.edge-r { left: auto; right: -4px; transform: none; animation-name: bubble-edge; }
.bubble.edge-r::after { left: auto; right: 30px; }
.bubble.edge-l { left: -4px; transform: none; animation-name: bubble-edge; }
.bubble.edge-l::after { left: 30px; }
.bubble.mafia { background: var(--red-deep); color: #fff; }
.bubble.mafia::after { border-top-color: var(--red-deep); }

.feed {
  margin: 12px 16px 0; display: flex; flex-direction: column; gap: 4px; border: none; background: none; text-align: right;
  padding: 0; color: inherit; min-height: 0; overflow: hidden; flex: 1; justify-content: flex-end;
}
.feed .msg { font-size: 13px; line-height: 1.6; animation: rise .4s ease both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .msg.sys { text-align: right; }
.dock { margin-top: auto; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.action { background: var(--surface); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.role-line { display: flex; align-items: center; gap: 12px; }
.role-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--raised); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-ic.mafia { color: var(--red); }
.role-ic.town { color: var(--gold); }
#app[data-time="day"] .role-ic.town { color: #9A6A12; }
.role-name { font-size: 17px; font-weight: 900; }
.results { display: flex; flex-wrap: wrap; gap: 6px; }
.results span { font-size: 12px; border-radius: 8px; padding: 2px 8px; background: var(--card); }
.results span.bad { color: var(--red); }
.results span.good { color: var(--green); }
.zz { color: var(--muted); animation: floaty 2.4s ease-in-out infinite; }
.dock-row { display: flex; gap: 10px; }

/* ---------- sheets & overlays ---------- */
.sheet-back { position: absolute; inset: 0; background: rgba(5, 6, 16, .6); z-index: 50; animation: fade .2s both; display: flex; align-items: flex-end; }
.sheet {
  width: 100%; max-height: 88%; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; animation: slideup .32s cubic-bezier(.2,.9,.3,1) both; overflow-y: auto;
}
.sheet h3 { font-size: 18px; font-weight: 900; }
.sheet > *:not(.chatbox) { flex-shrink: 0; }
.sheet .chatbox { max-height: none; flex: 1; min-height: 240px; }
.sheet.chat-sheet { height: 70%; }

.overlay {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center; animation: fade .35s both;
}
.overlay.night-ov { background: rgba(8, 9, 24, .92); }
.overlay.day-ov { background: rgba(250, 230, 190, .92); color: #2A2238; }
.overlay.dark-ov { background: rgba(8, 9, 24, .9); }
.overlay .big { font-size: 34px; font-weight: 900; animation: rise .8s cubic-bezier(.2,.9,.3,1) .15s both; }
.overlay .sub { font-size: 15px; opacity: .8; animation: rise .8s cubic-bezier(.2,.9,.3,1) .3s both; }
.overlay .orb-big { animation: orbrise 1.4s cubic-bezier(.2,.9,.3,1) both; }
.overlay.out { animation: fadeout .5s both; }

.flip { width: 270px; height: 380px; perspective: 1200px; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flip 1.1s cubic-bezier(.3,.8,.3,1) .7s both; }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.face.back {
  background: repeating-linear-gradient(45deg, #2B2F5C 0 10px, #23264D 10px 20px); border: 3px solid var(--gold);
  justify-content: center; color: var(--gold);
}
.face.front { transform: rotateY(180deg); background: #1E2142; border: 3px solid var(--gold); }
.face.front.mafia { border-color: var(--red-deep); }
.face .art { width: 100%; height: 190px; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.face.front.mafia .art { background: #3A1E2A; }
.face.front.town .art { background: #22305A; }
.face .art .role-badge {
  position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; border-radius: 14px; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.face .side { position: absolute; top: 14px; left: 14px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 11px; }
.face .side.mafia { background: var(--red-deep); color: #fff; }
.face .side.town { background: var(--green); color: #12142B; }
.face .info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: center; color: #F3EEE3; }
.face .info h2 { font-size: 28px; font-weight: 900; color: var(--gold); }
.face .info p { font-size: 13px; line-height: 1.75; }

.ann-list { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.ann-p { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: fallin .8s cubic-bezier(.3,1.4,.5,1) both; }
.ann-p .av { filter: grayscale(.6); }
.ann-p b { font-size: 15px; }
.tally { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px; }
.tally .tr { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tally .tr .bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.tally .tr .bar i { display: block; height: 100%; background: var(--red-deep); border-radius: 6px; transform-origin: right; animation: grow .9s cubic-bezier(.2,.9,.3,1) .4s both; }
.heart { color: #E58FB5; animation: heartbeat 1s ease-in-out infinite; }

.end-ov { justify-content: flex-start; padding-top: 48px; overflow-y: auto; background: rgba(8, 9, 24, .95); }
.end-ov .big.win { color: var(--gold); }
.end-ov .big.lose { color: var(--red); }
.award { font-size: 18px; font-weight: 900; color: var(--gold); animation: pop .6s cubic-bezier(.3,1.8,.5,1) 1s both; }
.reveal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 400px; }
.reveal-grid > div { background: #1E2142; border-radius: 14px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #F3EEE3; animation: pop .4s both; }
.reveal-grid > div.dead .av { filter: grayscale(.85); opacity: .7; }
.reveal-grid .nm { font-size: 11px; font-weight: 700; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 70; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: confetti linear both; }

#toasts { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; background: #2B2F5C; color: #F3EEE3; border-radius: 14px; padding: 11px 14px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: slidedown .35s cubic-bezier(.2,.9,.3,1) both; display: flex; align-items: center; gap: 10px;
}
.toast.error { background: #6E2A25; }
.toast.success { background: #1F5A40; }
.toast.out { animation: fadeout .4s both; }

.conn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--raised); border-top-color: var(--gold); animation: spin 1s linear infinite; }

/* blinking eyes */
.av-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }

/* ---------- keyframes ---------- */
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .8; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes die { 0% { transform: translateX(0); } 15% { transform: translateX(-6px) rotate(-3deg); } 30% { transform: translateX(6px) rotate(3deg); } 45% { transform: translateX(-4px); } 60% { transform: translateX(3px) translateY(0); } 100% { transform: translateY(4px); filter: grayscale(1); opacity: .45; } }
@keyframes stamp { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.8); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes bubble-edge { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slidedown { from { transform: translateY(-120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes rise { from { transform: translateY(26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes orbrise { from { transform: translateY(160px) scale(.7); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes fallin { from { transform: translateY(-40px) rotate(-10deg); opacity: 0; } to { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.18); } 60% { transform: scale(.96); } }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.shake { animation: shake .5s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 520px) {
  body { padding: 0; }
  #app { box-shadow: 0 0 60px rgba(0,0,0,.6); }
}

/* ---------- voice & speaking turns ---------- */
.pcard.talking, .slot.talking { box-shadow: 0 0 0 3px var(--green), 0 0 22px rgba(79, 185, 138, .55); }
.pcard.turn { border-color: var(--gold); animation: turnglow 1.6s ease-in-out infinite; }
.pcard.turn.talking { box-shadow: 0 0 0 3px var(--green), 0 0 26px rgba(79, 185, 138, .7); animation: none; }
.micmark {
  position: absolute; bottom: 4px; right: 4px; width: 20px; height: 20px; border-radius: 10px; background: var(--raised);
  color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.micmark.on { background: var(--green); color: #12142B; }
.slot .micmark { bottom: 6px; right: 6px; }
.turnbadge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 3px;
  background: var(--gold); color: #12142B; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 900;
  box-shadow: 0 3px 10px rgba(0,0,0,.3); animation: pop .35s cubic-bezier(.3,1.8,.5,1) both; white-space: nowrap;
}
.myturn {
  display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--gold) 18%, transparent);
  border-radius: 12px; padding: 8px 12px; color: var(--text);
}
.myturn .ic { color: var(--gold); animation: pulse 1s ease-in-out infinite; }
#app[data-time="day"] .myturn .ic { color: #9A6A12; }
.myturn b { flex: 1; }
.turnleft-big { font-weight: 900; font-variant-numeric: tabular-nums; }
.turnleft-big.low { color: var(--red); }
.micline { display: flex; align-items: center; gap: 6px; }
.micbtn.mic-live { background: var(--green); color: #12142B; }
.micbtn.mic-blocked { background: var(--raised); color: var(--gold); }
.micbtn.mic-off, .micbtn.mic-none { background: var(--raised); color: var(--muted); }
.switch {
  width: 52px; height: 32px; border-radius: 16px; border: none; background: var(--raised); position: relative; flex-shrink: 0;
  transition: background-color .2s;
}
.switch i { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 12px; background: var(--muted); transition: transform .2s, background-color .2s; }
.switch.on { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.switch.on i { transform: translateX(-20px); background: var(--gold); }
@keyframes turnglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 176, 74, .0); } 50% { box-shadow: 0 0 0 5px rgba(232, 176, 74, .28); } }
.pcard .micmark { right: auto; left: 4px; width: 18px; height: 18px; }

/* =========================================================
   Shop, cosmetics, rewards, ranked
   ========================================================= */
.cur { flex-shrink: 0; vertical-align: middle; }
.wallet { display: flex; gap: 6px; }
.wallet.bump { animation: bump .5s cubic-bezier(.3,1.8,.5,1); }
.wchip {
  display: flex; align-items: center; gap: 5px; border: none; background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 0 10px 0 6px; min-height: 40px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
}
.wchip .plus { width: 18px; height: 18px; border-radius: 9px; background: var(--green); color: #12142B; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.me-chip { padding-left: 10px; }
.navdot { position: absolute; top: 6px; margin-right: 22px; width: 9px; height: 9px; border-radius: 5px; background: var(--red); }
.bottomnav button { position: relative; min-width: 64px; }

/* ranks */
.tier {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, transparent); border-radius: 999px; padding: 2px 8px 2px 6px; white-space: nowrap;
}
.tier.sm { font-size: 10.5px; padding: 1px 6px 1px 5px; }
.vipmark { font-size: 9px; font-weight: 900; background: linear-gradient(90deg, #F2C14E, #E8873A); color: #2A1A08; border-radius: 5px; padding: 0 4px; margin-right: 4px; vertical-align: middle; }

/* ranked button + queue */
.rankedbtn {
  display: flex; align-items: center; gap: 12px; border: none; border-radius: 20px; padding: 14px; text-align: right; color: #F3EEE3;
  background: radial-gradient(120% 140% at 100% 0%, #5A2C46 0%, #2B2F5C 60%); box-shadow: inset 0 0 0 1.5px rgba(232,176,74,.45);
  min-height: 76px;
}
.rankedbtn b { font-size: 18px; }
.rankedbtn .small { color: #CFC9E6; }
.rb-ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(232,176,74,.18); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rb-ic.sm { width: 44px; height: 44px; border-radius: 13px; }
.queuecard { display: flex; align-items: center; gap: 12px; box-shadow: inset 0 0 0 1.5px rgba(232,176,74,.45); }
.radar { position: relative; width: 52px; height: 52px; border-radius: 26px; background: rgba(232,176,74,.12); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); animation: radar 2s ease-out infinite; }
.radar i + i { animation-delay: 1s; }
.countdown { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; }
.countdown b { font-size: 46px; font-weight: 900; color: var(--gold); line-height: 1; animation: pulse 1s ease-in-out infinite; }
.countdown span { color: var(--muted); font-size: 13px; }

/* daily + promo + missions */
.dailycard, .promo {
  display: flex; align-items: center; gap: 12px; border: none; border-radius: 20px; padding: 12px 14px; text-align: right; color: #2A1A08; min-height: 72px;
}
.dailycard { background: linear-gradient(100deg, #F2C14E, #E8973A); }
.dailycard .chest { width: 52px; height: 52px; border-radius: 15px; background: rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; animation: wobble 2.2s ease-in-out infinite; flex-shrink: 0; }
.dailycard .btn.sm { background: #2A1A08; color: #F2C14E; }
.dailycard .small { color: #4A3010; }
.dstrip { display: inline-flex; gap: 3px; margin-top: 3px; }
.dstrip i { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; opacity: .55; }
.dstrip i.done { opacity: 1; background: rgba(42,26,8,.18); }
.dstrip i.now { opacity: 1; background: #fff; box-shadow: 0 0 0 2px #2A1A08; }
.promo { background: linear-gradient(100deg, #3B2A6E, #6A2E5E); color: #F3EEE3; box-shadow: inset 0 0 0 1.5px rgba(232,176,74,.5); position: relative; overflow: hidden; }
.promo::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40px; left: -60px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent); transform: skewX(-20deg); animation: sweep 3.2s ease-in-out infinite; }
.promo .small { color: #E6DDF5; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.ptag { font-size: 10px; font-weight: 900; background: var(--red-deep); color: #fff; border-radius: 6px; padding: 1px 7px; }
.pprice { display: flex; flex-direction: column; align-items: center; gap: 0; }
.pprice s { font-size: 11px; opacity: .6; }
.pprice b { background: var(--gold); color: #12142B; border-radius: 11px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.mission { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.mission .small { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.mbar { display: block; height: 6px; border-radius: 3px; background: var(--card); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .6s ease; }

/* shop */
.shoptabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.shoptabs::-webkit-scrollbar { display: none; }
.shoptabs button { flex-shrink: 0; border: none; border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 800; min-height: 40px; padding: 0 14px; font-size: 13px; }
.shoptabs button.on { background: var(--gold); color: #12142B; }
.testnote { display: flex; align-items: center; gap: 6px; font-size: 12px; background: rgba(232,176,74,.12); color: var(--gold); border-radius: 10px; padding: 7px 10px; }
.igrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.igrid.one { grid-template-columns: 1fr; }
.icard {
  position: relative; background: var(--surface); border-radius: 18px; padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px solid transparent; overflow: hidden;
}
.icard.r-rare { border-color: rgba(91,155,230,.5); }
.icard.r-epic { border-color: rgba(181,123,224,.55); }
.icard.r-legend { border-color: rgba(232,176,74,.7); background: radial-gradient(120% 90% at 50% 0%, rgba(232,176,74,.16), var(--surface) 60%); }
.icard.deal { padding-top: 26px; }
.rar { position: absolute; top: 7px; right: 9px; font-size: 10px; font-weight: 800; color: var(--muted); }
.r-rare .rar { color: #7FB2EE; } .r-epic .rar { color: #C79BEA; } .r-legend .rar { color: var(--gold); }
.dealtag { position: absolute; top: 0; left: 0; right: 0; background: var(--red-deep); color: #fff; font-size: 11px; font-weight: 900; text-align: center; padding: 3px; }
.iprev { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; }
.icard.deal .iprev { height: 124px; }
.iname { font-size: 13.5px; text-align: center; }
.ibtn {
  border: none; border-radius: 12px; min-height: 40px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--raised); color: var(--text); font-weight: 800; font-size: 13px; padding: 0 8px;
}
.ibtn.buy { background: var(--gold); color: #12142B; }
.ibtn.buy s { font-size: 11px; opacity: .55; margin-right: 4px; }
.ibtn.on { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.ibtn.vip { background: linear-gradient(90deg, #F2C14E, #E8873A); color: #2A1A08; }
.playfx { position: absolute; bottom: 2px; left: 2px; width: 32px; height: 32px; border-radius: 16px; border: none; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; }
.fxprev { position: relative; display: inline-flex; }
.rxrow { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.rxrow .rx { animation: floaty 2.6s ease-in-out infinite; }
.rxrow .rx:nth-child(2) { animation-delay: .4s; } .rxrow .rx:nth-child(3) { animation-delay: .8s; }
.namedemo { font-size: 22px; font-weight: 900; }
.pcardbuy {
  position: relative; border: none; border-radius: 18px; background: var(--surface); color: var(--text); padding: 22px 8px 12px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; overflow: hidden; text-align: center;
}
.pcardbuy.best { box-shadow: inset 0 0 0 2px var(--gold); background: radial-gradient(120% 90% at 50% 0%, rgba(91,200,232,.18), var(--surface) 65%); }
.pcardbuy .ptag { position: absolute; top: 8px; }
.pcardbuy:has(.ptag) { padding-top: 36px; }
.pcardbuy .gempile { animation: floaty 3s ease-in-out infinite; margin-bottom: 4px; }
.pcardbuy .pp { margin-top: 6px; background: var(--gold); color: #12142B; border-radius: 11px; padding: 6px 12px; font-weight: 900; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.pcardbuy .small { display: inline-flex; align-items: center; gap: 3px; }
.vipcard { border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; color: #F3EEE3;
  background: linear-gradient(135deg, #3A2A12 0%, #5A3A14 45%, #2B1E3A 100%); box-shadow: inset 0 0 0 1.5px rgba(242,193,78,.6); }
.vipcard .small { color: #E8D7B0; }
.vipbig { font-size: 22px; font-weight: 900; color: #2A1A08; background: linear-gradient(135deg, #FFE08A, #E8973A); border-radius: 12px; padding: 8px 12px; letter-spacing: 1px; }
.vipbig.huge { font-size: 54px; padding: 18px 28px; border-radius: 26px; }
.perks { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 13px; }
.perks li { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.2); border-radius: 10px; padding: 7px 8px; }
.buylines { display: flex; flex-direction: column; gap: 8px; }
.buylines span { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.phonecta { display: flex; align-items: center; gap: 10px; border: none; border-radius: 14px; padding: 10px 12px; min-height: 48px; background: rgba(79,185,138,.14); color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(79,185,138,.5); text-align: right; font-weight: 700; }
.statrow { display: flex; gap: 8px; }
.statrow .stat { gap: 4px; }
.sw { position: relative; }
.sw.locked > svg, .sw.locked > .dot { opacity: .45; }
.lk { position: absolute; bottom: 2px; left: 2px; width: 16px; height: 16px; border-radius: 8px; background: var(--gold); color: #12142B; display: flex; align-items: center; justify-content: center; }

/* ---------- card frames (animated) ---------- */
.avwrap { position: relative; display: inline-flex; border-radius: 50%; flex-shrink: 0; }
.avwrap.big { padding: 4px; }
.fr { --f1: #E8B04A; --f2: #FFF1C2; }
.fr-gold { --f1: #C9962E; --f2: #FFE59A; }
.fr-rose { --f1: #D6406A; --f2: #FFB3C6; }
.fr-neon { --f1: #2FE0E8; --f2: #E040FB; }
.fr-fire { --f1: #FF5A1F; --f2: #FFD25A; }
.fr-vip { --f1: #F2C14E; --f2: #B57BE0; }
.avwrap.fr::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
  background: conic-gradient(var(--f1), var(--f2), var(--f1), var(--f2), var(--f1)); animation: spin 4s linear infinite;
}
.avwrap.fr > svg { position: relative; z-index: 1; }
.avwrap.fr-fire::after, .avwrap.fr-neon::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 14px var(--f1); animation: pulse 1.6s ease-in-out infinite; pointer-events: none; }
.pcard.fr, .slot .avwrap.fr { --bw: 2px; }
.pcard.fr { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, conic-gradient(from var(--fa, 0deg), var(--f1), var(--f2), var(--f1)) border-box; animation: frameturn 4s linear infinite; }
.pcard.fr.sel { background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(var(--gold), var(--gold)) border-box; animation: none; }
.pcard.fr-fire, .pcard.fr-neon { box-shadow: 0 0 12px color-mix(in srgb, var(--f1) 55%, transparent); }
.pcard.dead.fr { animation: none; }
@property --fa { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

/* ---------- name colors ---------- */
.nc-red { color: #FF6B5E !important; }
.nc-gold { color: #F2C14E !important; text-shadow: 0 0 8px rgba(242,193,78,.45); }
#app[data-time="day"] .nc-gold { color: #A9700F !important; text-shadow: none; }
.nc-rainbow { background: linear-gradient(90deg, #FF5E5E, #F2C14E, #4FB98A, #5B9BE6, #B57BE0, #FF5E5E); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: rainbow 3s linear infinite; }

/* ---------- reactions in game ---------- */
.rxbar { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; background: var(--card); border-radius: 14px; padding: 4px; animation: rise .25s ease both; }
.rxbtn { position: relative; border: none; background: none; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.rxbtn:active { transform: scale(.9); }
.rxbtn.locked .rx { filter: grayscale(1); opacity: .45; }
.rxfloat { position: absolute; top: -6px; left: 50%; z-index: 30; pointer-events: none; animation: rxup 2.2s cubic-bezier(.2,.8,.3,1) both; }
.mutedmark { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 9px; background: var(--red-deep); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------- elimination effects ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 25; display: flex; align-items: center; justify-content: center; overflow: visible; }
.fx-smoke i { position: absolute; bottom: 30%; left: 50%; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, rgba(200,200,210,.9), rgba(200,200,210,0) 70%);
  animation: smoke 1.8s ease-out var(--d) both; }
.fx-roses i { position: absolute; top: -20px; left: 50%; width: 12px; height: 10px; border-radius: 10px 0 10px 0; background: #E2456A; animation: petal 2.2s ease-in var(--d) both; }
.fx-ghost svg { animation: ghost 2.4s ease-out both; filter: drop-shadow(0 0 8px rgba(255,255,255,.7)); }
.fx-lightning svg { position: absolute; top: -60px; animation: bolt .9s ease-out both; filter: drop-shadow(0 0 10px #FFE45C); }
.fx-lightning .flash { position: absolute; inset: -20px; border-radius: 20px; background: rgba(255,248,200,.85); animation: flash .6s ease-out both; }

/* ---------- prizes & rewards ---------- */
.prize-ov { gap: 14px; }
.prize, .chestbox { position: relative; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.prize-art { position: relative; z-index: 2; animation: prizein .9s cubic-bezier(.3,1.6,.5,1) both; }
.rays { position: absolute; inset: 0; animation: spin 12s linear infinite; }
.rays i { position: absolute; left: 50%; top: 50%; width: 14px; height: 120px; margin: -120px 0 0 -7px; transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(242,193,78,.5), transparent); border-radius: 7px; }
.chest-lid { position: relative; z-index: 2; color: var(--gold); animation: chest 1.1s cubic-bezier(.3,1.6,.5,1) both; }
.rwlist { display: flex; gap: 12px; justify-content: center; }
.rw { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 8px 14px; font-size: 20px; animation: pop .5s cubic-bezier(.3,1.8,.5,1) .7s both; }
.awards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.aw { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); color: #F3EEE3; border-radius: 12px; padding: 6px 12px; font-weight: 900; animation: pop .5s cubic-bezier(.3,1.8,.5,1) .9s both; }
.aw.coinfly .cur { animation: coinspin 1s ease .9s 2; }
.aw.up { color: #6FE0A8; } .aw.down { color: #FF8A7E; }
.fairplay { width: 100%; max-width: 400px; background: rgba(255,255,255,.06); border-radius: 16px; padding: 10px 12px; color: #F3EEE3; display: flex; flex-direction: column; gap: 8px; text-align: right; }
.fp-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.fp { display: flex; align-items: center; gap: 8px; }
.fp .nm { flex: 1; font-size: 14px; }
.fpb { width: 44px; height: 38px; border-radius: 11px; border: none; background: rgba(255,255,255,.08); color: #A9A6C4; display: flex; align-items: center; justify-content: center; }
.fpb.on { background: rgba(79,185,138,.3); color: #6FE0A8; }
.fpb.bad.on { background: rgba(194,69,59,.35); color: #FF8A7E; }

@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes radar { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes wobble { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
@keyframes sweep { 0%, 60% { left: -60px; } 100% { left: 110%; } }
@keyframes frameturn { to { --fa: 360deg; } }
@keyframes rainbow { to { background-position: 200% 0; } }
@keyframes rxup { 0% { transform: translate(-50%, 20px) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } 30% { transform: translate(-50%, -16px) scale(1); }
  80% { opacity: 1; } 100% { transform: translate(-50%, -70px) scale(.9); opacity: 0; } }
@keyframes smoke { 0% { transform: translate(-50%, 0) scale(.3); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), -70px) scale(2.4); opacity: 0; } }
@keyframes petal { 0% { transform: translate(calc(-50% + var(--x)), 0) rotate(var(--r)); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x) * 1.4), 130px) rotate(calc(var(--r) + 300deg)); opacity: 0; } }
@keyframes ghost { 0% { transform: translateY(10px) scale(.5); opacity: 0; } 20% { opacity: 1; transform: translateY(0) scale(1); } 100% { transform: translateY(-90px) translateX(14px); opacity: 0; } }
@keyframes bolt { 0% { opacity: 0; transform: scaleY(.2); transform-origin: top; } 15% { opacity: 1; transform: scaleY(1); } 30% { opacity: .3; } 45% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes prizein { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes chest { 0% { transform: scale(.3) translateY(40px); opacity: 0; } 60% { transform: scale(1.1) translateY(-6px); opacity: 1; } 75% { transform: scale(1) rotate(-6deg); } 90% { transform: rotate(6deg); } 100% { transform: rotate(0); } }
@keyframes coinspin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

.ann-p { position: relative; }

/* ---------- scenarios & extra roles ---------- */
:root { --purple: #B57BE0; }
.rolechip.joker { background: rgba(181, 123, 224, .2); color: var(--purple); }
#app[data-time="day"] .rolechip.joker { color: #7B3FA8; }
.role-ic.joker { color: var(--purple); }
.face.front.joker { border-color: #7B3FA8; }
.face.front.joker .art { background: #2C1E3A; }
.face .side.joker { background: #7B3FA8; color: #fff; }
.settings-row .seg { min-width: 180px; }
.settings-row .seg button { min-height: 36px; padding: 0 10px; }
.sc-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sc-role { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line, rgba(255,255,255,.1));
  background: var(--raised); color: var(--text); font-size: 12px; font-weight: 700; }
.sc-role.mafia svg { color: var(--red); }
.sc-role.town svg { color: var(--gold); }
.sc-role.joker svg { color: var(--purple); }
.pcard .knife.hush { left: auto; right: 2px; color: var(--purple); }
.silencedmark { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 9px; background: #7B3FA8; color: #fff; display: flex; align-items: center; justify-content: center; }
.joker-win { color: var(--purple); font-weight: 800; }
.joker-win svg { color: var(--purple); }

/* ---------- season pass ---------- */
.fr-pass { --f1: #7B3FA8; --f2: #2FE0E8; }
.avwrap.fr-pass::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 14px #B57BE0; animation: pulse 1.6s ease-in-out infinite; pointer-events: none; }
.pcard.fr-pass { box-shadow: 0 0 12px rgba(181,123,224,.55); }
.nc-purple { color: #C99BF0 !important; text-shadow: 0 0 8px rgba(181,123,224,.5); }
#app[data-time="day"] .nc-purple { color: #6B2F98 !important; text-shadow: none; }
.passcard { display: flex; align-items: center; gap: 12px; border: none; border-radius: 20px; padding: 12px 14px; min-height: 72px; color: #F3EEE3; text-align: right;
  background: linear-gradient(100deg, #2C1E54, #4B2470); box-shadow: inset 0 0 0 1.5px rgba(181,123,224,.55); }
.passcard .small { color: #E0D3F2; }
.passlvl { width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: conic-gradient(from 200deg, #F2C14E, #B57BE0, #F2C14E); color: #1B1030; box-shadow: 0 4px 14px rgba(181,123,224,.35); }
.passlvl.sm { width: 50px; height: 50px; }
.passlvl small { font-size: 10px; font-weight: 800; }
.passlvl b { font-size: 22px; font-weight: 900; }
.xpbar { display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #B57BE0, #F2C14E); transition: width .6s ease; }
.goldtag { font-size: 10px; font-weight: 900; background: var(--gold); color: #12142B; border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.passhead { background: var(--card); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.passgold { border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; color: #2A1A08;
  background: linear-gradient(110deg, #F2C14E, #E8973A 60%, #D9783A); position: relative; overflow: hidden; }
.passgold::after { content: ''; position: absolute; top: 0; bottom: 0; width: 50px; left: -70px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transform: skewX(-20deg); animation: sweep 3.2s ease-in-out infinite; pointer-events: none; }
.passgold .small { color: #4A3010; }
.passgold .btn.gold { background: #2A1A08; color: #F2C14E; }
.passgold .btn:not(.gold) { background: rgba(255,255,255,.45); color: #2A1A08; }
.pg-ic { width: 52px; height: 52px; border-radius: 15px; background: rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pg-ic.huge { width: auto; height: auto; background: none; color: var(--gold); }
.passtrack { background: var(--card); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pt-head, .pt-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: stretch; }
.pt-head span { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.pt-head .g { color: var(--gold); }
.pt-l { display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--muted); border-radius: 10px; }
.pt-row.reached .pt-l { color: #1B1030; background: linear-gradient(#F2C14E, #B57BE0); }
.pt-row.next .pt-l { box-shadow: inset 0 0 0 2px #B57BE0; color: var(--text); }
.pt-cell { position: relative; min-height: 54px; border-radius: 12px; background: var(--raised); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 4px; }
.pt-cell.gold { background: linear-gradient(140deg, rgba(242,193,78,.18), rgba(181,123,224,.16)); box-shadow: inset 0 0 0 1px rgba(242,193,78,.35); }
.pt-cell.locked > :not(.pt-lock) { opacity: .45; filter: grayscale(.5); }
.pt-cell.done > :not(.pt-ok) { opacity: .4; }
.pr-v { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 13px; }
.pr-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pr-item small { font-size: 10px; color: var(--muted); max-width: 90px; text-align: center; line-height: 1.3; }
.pr-item .avwrap.big { padding: 2px; }
.pr-item .rxrow { gap: 0; }
.pt-ok, .pt-lock, .pt-ready { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.pt-ok { background: var(--green); color: #12142B; }
.pt-lock { background: rgba(0,0,0,.45); color: #fff; }
.pt-ready { background: var(--gold); box-shadow: 0 0 0 0 rgba(242,193,78,.7); animation: pulse 1.4s ease-in-out infinite; width: 10px; height: 10px; top: 6px; left: 6px; }
.pr-item .namedemo { font-size: 12px; } .pr-item .rxrow svg { width: 18px; height: 18px; }

/* ---------- art v2: shaded avatars, city skyline, role posters ---------- */
.av-dead { filter: grayscale(.85) brightness(.85); }

.skyline { display: block; width: 100%; height: 100%; }
.skyline .sk-far { fill: #1C2050; transition: fill 1.2s; }
.skyline .sk-near { fill: #0B0D22; transition: fill 1.2s; }
.skyline .sk-win rect { fill: #FFC86B; opacity: .85; animation: winflick var(--t, 5s) ease-in-out var(--d, 0s) infinite; transition: opacity 1s; }
.skyline .sk-beacon { fill: #E06A5F; animation: beacon 1.6s steps(1) infinite; }
@keyframes winflick { 0%, 86%, 100% { opacity: .85; } 90% { opacity: .35; } }
@keyframes beacon { 50% { fill: #5A1F24; } }

/* game screen: the city sits along the bottom of the sky */
.sky .skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; width: 100%; opacity: .55; }
.sky::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, var(--bg)); }
#app[data-time="day"] .sky .skyline .sk-far { fill: #E9C79A; }
#app[data-time="day"] .sky .skyline .sk-near { fill: #CFA374; }
#app[data-time="day"] .sky .skyline .sk-win rect { opacity: 0; animation: none; }
#app[data-time="day"] .sky .skyline .sk-beacon { animation: none; fill: #B8862B; }

/* home hero */
.hero .skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; width: 100%; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero .crowd, .hero .logo, .hero .tagline { position: relative; z-index: 2; }
.hero .searchlight { position: absolute; bottom: 30px; left: 50%; width: 60px; height: 260px; transform-origin: 50% 100%; margin-left: -30px;
  background: linear-gradient(to top, rgba(255, 220, 150, .22), transparent 85%); clip-path: polygon(40% 100%, 60% 100%, 100% 0, 0 0); animation: sweep2 9s ease-in-out infinite; }
@keyframes sweep2 { 0%, 100% { transform: rotate(-32deg); } 50% { transform: rotate(32deg); } }

/* night falls: windows switch off one by one */
.cityscene { position: relative; width: min(420px, 100vw); height: 210px; margin-bottom: 10px; }
.cityscene .skyline { position: absolute; inset: auto 0 0 0; height: 150px; }
.cityscene .moonrise { position: absolute; left: 62%; bottom: 40px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 36% 36%, #FFF6D8, #F3D98A 60%, #D9B45A); box-shadow: 0 0 40px 8px rgba(243, 217, 138, .35); animation: moonup 2.2s cubic-bezier(.2,.8,.3,1) both; }
.cityscene .sunrise { position: absolute; left: 50%; bottom: 20px; width: 90px; height: 90px; margin-left: -45px; border-radius: 50%;
  background: radial-gradient(circle, #FFE7A0, #F2A93B 65%, #E07A2A); box-shadow: 0 0 60px 20px rgba(242, 169, 59, .45); animation: sunup 2.4s cubic-bezier(.2,.8,.3,1) both; }
@keyframes moonup { from { transform: translateY(110px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sunup { from { transform: translateY(120px) scale(.8); } to { transform: none; } }
.cityscene.sleep .sk-win rect { animation: lightsout .5s ease-in calc(.6s + var(--d) * .7) both; }
@keyframes lightsout { 0% { opacity: .9; } 60% { opacity: 1; } 100% { opacity: 0; } }
.cityscene.wake .sk-far { fill: #6B4A3A; } .cityscene.wake .sk-near { fill: #2A2238; }
.cityscene.wake .sk-win rect { animation: lightsout .6s ease-in calc(.4s + var(--d) * .5) both; }

/* role poster on the reveal card */
.ra { position: absolute; inset: 0; overflow: hidden; }
.ra svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ra .ra-city { top: auto; height: 90px; opacity: .8; }
.ra .ra-city .sk-near { fill: #07080F; }
.ra .ra-city .sk-far { fill: rgba(0, 0, 0, .35); }
.ra .ra-fg { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.ra-fog { position: absolute; left: -20%; right: -20%; bottom: -6px; height: 46px; background: radial-gradient(ellipse at center, rgba(200, 200, 230, .22), transparent 70%); animation: fogdrift 7s ease-in-out infinite alternate; }
@keyframes fogdrift { to { transform: translateX(14%); } }
.ra-spot { transform-origin: 50% 0; animation: spotsway 6s ease-in-out infinite alternate; }
@keyframes spotsway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.ra-smoke { animation: smoke 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(6px) scaleY(.7); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) scaleY(1.1); } }
.ra-glint { animation: glint 2.4s ease-in-out infinite; }
@keyframes glint { 0%, 70%, 100% { opacity: 0; } 80% { opacity: 1; } }
.ra-pulse { animation: rapulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes rapulse { 50% { opacity: .65; } }
.ra-flag { transform-box: fill-box; transform-origin: 0 50%; animation: flag 1.6s ease-in-out infinite alternate; }
@keyframes flag { to { transform: skewY(6deg) scaleX(.92); } }
.ra-conf rect { animation: confall 3.6s linear calc(var(--i) * -.6s) infinite; }
@keyframes confall { from { transform: translateY(-20px); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(60px); opacity: 0; } }
.ra-scope { animation: scope 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes scope { to { transform: translate(4px, -3px); } }
.ra-spark { animation: glint 1.4s ease-in-out infinite; }
.ra-shh { animation: rapulse 1.6s ease-in-out infinite; }
.face .art { overflow: hidden; }
.face .art .role-badge { z-index: 3; }
.face .side { z-index: 3; }
.face.front { box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .05) inset; }
.face.front::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .14) 48%, transparent 60%); background-size: 250% 100%; animation: cardshine 1.4s ease-out 1.9s both; }
@keyframes cardshine { from { background-position: 120% 0; } to { background-position: -60% 0; } }

@media (prefers-reduced-motion: reduce) {
  .skyline .sk-win rect, .ra *, .ra-fog, .hero .searchlight, .cityscene * { animation: none !important; }
}
.cityscene.sm { height: 150px; }
.cityscene.sm .skyline { height: 110px; }
.overlay.day-ov .cityscene .sk-far { fill: #C9A27A; } .overlay.day-ov .cityscene .sk-near { fill: #6B4A3A; }
.hero .skyline { height: 110px; opacity: .7; }
.hero .logo { text-shadow: 0 4px 18px rgba(0, 0, 0, .7); }
.hero .tagline { text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
