body { transition: background-color .8s; }
body.is-night { background-color: color-mix(in srgb, var(--bg) 70%, #000); }
.role-card { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 1.4rem 1rem; border-radius: calc(var(--radius) + 4px); background: radial-gradient(circle at 50% 20%, rgb(var(--primary-rgb) / .18), transparent 65%), var(--surface-2); border: 2px solid var(--line); }
.role-card.mafia { border-color: rgb(239 68 68 / .55); background: radial-gradient(circle at 50% 20%, rgb(239 68 68 / .2), transparent 65%), var(--surface-2); }
.role-card .ri { width: 76px; height: 76px; color: var(--primary-ink); }
.role-card.mafia .ri, .role-card.mafia b { color: #ef4444; }
.role-card .ri svg { width: 100%; height: 100%; }
.role-card b { font-size: 1.5rem; font-weight: 900; }
.role-card p { margin: 0; color: var(--text-dim); line-height: 1.8; max-width: 340px; }
.role-card .team-tag { font-size: .76rem; font-weight: 800; padding: .2rem .7rem; border-radius: 99px; background: var(--surface-3); color: var(--text-dim); }
.role-card.small { flex-direction: row; padding: .7rem .9rem; text-align: start; }
.role-card.small .ri { width: 40px; height: 40px; }
.role-card.small b { font-size: 1.05rem; flex: 1; }

.flip-card { width: min(360px, 100%); aspect-ratio: 3 / 4; margin: 1rem auto; perspective: 1200px; position: relative; display: block; }
.flip-card .fc { position: absolute; inset: 0; backface-visibility: hidden; transition: transform .8s var(--ease); border-radius: calc(var(--radius) + 6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.flip-card .front { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 14px, var(--surface-2) 14px, var(--surface-2) 28px); border: 2px solid var(--line); font-weight: 800; color: var(--text-dim); }
.flip-card .front b { width: 70px; height: 70px; color: var(--primary-ink); }
.flip-card .front b svg { width: 100%; height: 100%; }
.flip-card .back { transform: rotateY(180deg); }
.flip-card .back .role-card { width: 100%; height: 100%; justify-content: center; }
.flip-card.is-flipped .front { transform: rotateY(180deg); }
.flip-card.is-flipped .back { transform: rotateY(360deg); }

.night-scene { display: grid; place-items: center; height: 90px; color: var(--primary-light); }
.night-scene svg { width: 64px; height: 64px; filter: drop-shadow(0 0 24px var(--glow)); animation: art-float 4s ease-in-out infinite; }
@keyframes art-float { 50% { transform: translateY(-8px); } }
.big-msg { padding: 1.4rem 0; }
.big-msg h2 { font-size: clamp(1.3rem, 3.5vw, 1.9rem); line-height: 1.6; margin: .6rem 0; }
.big-msg .sun { display: inline-block; width: 64px; height: 64px; color: var(--primary); animation: art-spin 20s linear infinite; }
@keyframes art-spin { to { transform: rotate(360deg); } }
.history { display: flex; flex-direction: column; gap: .3rem; margin-top: 1rem; color: var(--text-mute); font-size: .86rem; text-align: center; }
.tally { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.tally div { display: grid; grid-template-columns: 120px 1fr 30px; align-items: center; gap: .6rem; font-weight: 700; }
.tally i { display: block; height: 10px; border-radius: 99px; background: var(--primary); min-width: 4px; }
.final-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-top: 1rem; }
.fr { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); text-align: center; }
.fr.mafia { border-color: rgb(239 68 68 / .45); }
.fr .ri { width: 36px; height: 36px; color: var(--primary-ink); }
.fr.mafia .ri { color: #ef4444; }
.fr small { color: var(--text-mute); font-weight: 700; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.people li { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: 10px; background: var(--bg-2); font-weight: 700; font-size: .9rem; }
.people li.dead { opacity: .45; text-decoration: line-through; }
.people .av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 900; flex: none; }
.people .av svg { width: 16px; height: 16px; }
.people .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .nm small { color: var(--text-mute); }
.flag { font-size: .7rem; font-weight: 800; padding: .1rem .45rem; border-radius: 99px; background: var(--surface-3); color: var(--text-dim); white-space: nowrap; text-decoration: none; }
.flag.bad { background: rgb(239 68 68 / .14); color: #ef4444; }
.checks { display: flex; flex-direction: column; gap: .3rem; margin-top: .7rem; font-size: .86rem; font-weight: 700; }
.checks .bad { color: #ef4444; } .checks .good { color: var(--ok); }
.targets small { font-weight: 600; }
