﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.loading-progress {
    display: none;
}
.loading-progress-text {
    display: none;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: system-ui, sans-serif;
    background: #112a1a;
    color: #b8d8a8;
}

body { display: flex; flex-direction: column; }

/* App root — flex column so #world can flex-grow to fill remaining height */
#app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#blazor-error-ui { display: none; }

/* â”€â”€ Header â”€â”€ */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1.2rem;
    padding: .55rem 1.4rem;
    background: rgba(4, 14, 8, 0.88);
    border-bottom: 1px solid rgba(60, 140, 60, 0.18);
    flex-shrink: 0;
    z-index: 10;
    backdrop-filter: blur(4px);
}

h1 { font-size: 1.35rem; letter-spacing: .06em; color: #a8d890; text-shadow: 0 0 18px rgba(80,180,60,.35); }

.controls { display: flex; gap: .7rem; align-items: center; }

button {
    padding: .42rem 1.15rem;
    border: 1px solid rgba(60,140,60,.35);
    border-radius: 6px;
    background: rgba(30, 70, 28, 0.75);
    color: #b8d8a0;
    font-size: .88rem; cursor: pointer;
    transition: background .2s, border-color .2s;
}
button:hover { background: rgba(40, 95, 35, 0.9); border-color: rgba(80,170,60,.5); }
button.secondary { background: rgba(18, 45, 18, 0.7); color: #8ab880; }
button.secondary:hover { background: rgba(30, 65, 28, 0.85); }

#stats {
    display: flex; gap: 1rem;
    font-size: .8rem; flex-wrap: wrap;
    opacity: .88;
}
#stats span { display: flex; align-items: center; gap: .25rem; }

/* â”€â”€ Phase label â”€â”€ */
.phase-label {
    font-size: .84rem; font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 20px;
    background: rgba(255,255,255,.08);
    white-space: nowrap;
    transition: background .4s;
    color: #c8e8b0;
}
.phase-label.phase-night   { background: rgba(5, 8, 35, 0.85);  color: #8090d8; }
.phase-label.phase-dawn    { background: rgba(160, 55, 18, 0.7); color: #ffe0b0; }
.phase-label.phase-debate  { background: rgba(140, 90, 0, 0.75); color: #ffe890; }
.phase-label.phase-vote    { background: rgba(110, 0, 110, 0.75); color: #e8b0ff; }
.phase-label.phase-execute { background: rgba(180, 0, 0, 0.85);  color: #fff; }
.phase-label.phase-over    { background: rgba(170, 0, 0, 0.8);   color: #fff; }

/* â”€â”€ Vote tally panel â”€â”€ */
#vote-tally {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 60;
    background: rgba(4, 10, 20, 0.88);
    border: 1px solid rgba(160, 80, 220, 0.35);
    border-radius: 10px;
    padding: .65rem .9rem;
    min-width: 160px;
    backdrop-filter: blur(6px);
    pointer-events: none;
}
#vote-tally .vt-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #c055f0;
    margin-bottom: .45rem;
}
#vote-tally .vt-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .3rem;
}
#vote-tally .vt-name {
    font-size: .78rem;
    color: #dde;
    width: 68px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
#vote-tally .vt-bar-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,.08);
    border-radius: 4px;
    overflow: hidden;
}
#vote-tally .vt-bar {
    height: 100%;
    border-radius: 4px;
    background: #c055f0;
    transition: width .35s ease;
}
#vote-tally .vt-bar.leading { background: #e03050; }
#vote-tally .vt-count {
    font-size: .78rem;
    font-weight: 700;
    color: #e8b8ff;
    width: 16px;
    text-align: right;
    flex-shrink: 0;
}

/* â”€â”€ Condemned walk â”€â”€ */
.gator.condemned {
    filter: drop-shadow(0 0 8px #e03050) drop-shadow(0 0 18px #ff0038);
    animation: condemnedPulse 0.5s ease-in-out infinite alternate;
    z-index: 25;
}
@keyframes condemnedPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

/* â”€â”€ Dead body marker â”€â”€ */
.dead-marker {
    position: absolute;
    z-index: 8;
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none;
    animation: fadeInDrop .6s ease;
}
.dead-icon  { font-size: 1.5rem; line-height: 1; }
.dead-name  {
    font-size: .72rem; color: #e8d8b0;
    text-shadow: 0 1px 6px rgba(0,0,0,.95);
    font-weight: 700; margin-top: 2px;
}
@keyframes fadeInDrop {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* â”€â”€ Dead gator â”€â”€ */
.gator.dead { opacity: .22; filter: grayscale(1) brightness(.55); pointer-events: auto; cursor: default; }

/* â”€â”€ Voter highlight â”€â”€ */
.gator.voting-active {
    filter: drop-shadow(0 0 10px #c055f0) drop-shadow(0 0 22px #9900dd);
    animation: voterPulse 0.7s ease-in-out infinite alternate;
    z-index: 20;
}
@keyframes voterPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.09); }
}

/* â”€â”€ Game-over overlay â”€â”€ */
#game-over-overlay {
    position: absolute; inset: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
}
.go-card {
    background: linear-gradient(160deg, #0e2018 0%, #081510 100%);
    border: 1px solid rgba(80,180,80,.2);
    border-radius: 18px;
    padding: 2.4rem 3.2rem;
    text-align: center;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 60px rgba(0,0,0,.75), 0 0 40px rgba(40,140,60,.08);
}
.go-title { font-size: 2rem; font-weight: 800; margin-bottom: .8rem; color: #c0e8a0; }
.go-body  { font-size: .96rem; line-height: 1.65; margin-bottom: 1.5rem; opacity: .88; color: #a8cc90; }
.go-card button { padding: .58rem 1.8rem; font-size: .96rem; }

.go-character-list {
    margin: 1.5rem 0 1.5rem;
    text-align: left;
}
.go-list-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a8d890;
    margin-bottom: 0.8rem;
    text-align: center;
    border-bottom: 1px solid rgba(80,180,80,.2);
    padding-bottom: 0.5rem;
}
.go-char {
    background: rgba(20,48,20,.4);
    border: 1px solid rgba(60,140,60,.2);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.go-char-alive {
    border-color: rgba(80,180,80,.4);
    background: rgba(30,60,30,.5);
}
.go-char-dead {
    opacity: 0.7;
    border-color: rgba(140,60,60,.3);
}
.go-char-icon {
    font-size: 1.4rem;
    min-width: 1.8rem;
    text-align: center;
}
.go-char-info {
    flex: 1;
}
.go-char-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #c8e8b0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.go-char-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(200,60,60,.4);
    color: #ff9090;
    text-transform: uppercase;
    font-weight: 700;
}
.go-char-badge-killer {
    background: rgba(200,60,60,.5);
    color: #ffa0a0;
}
.go-char-badge-liar {
    background: rgba(180,120,60,.4);
    color: #ffcc90;
}
.go-char-details {
    font-size: 0.75rem;
    color: #a0c888;
    margin-top: 0.2rem;
    line-height: 1.4;
}
.go-char-death {
    font-size: 0.72rem;
    color: #d88080;
    margin-top: 0.2rem;
    font-style: italic;
}

/* â”€â”€ World stage â€” the pond â”€â”€ */
#world {
    flex: 1;
    position: relative;
    overflow: hidden;
    /* Deep murky swamp water */
    background: #1a4225;
    transition: background 3s ease;
}
/* Animated water shimmer as a pseudo-element */
#world::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        118deg,
        transparent            0px,
        transparent            38px,
        rgba(40,120,60,0.07)   38px,
        rgba(40,120,60,0.07)   40px
    ),
    repeating-linear-gradient(
        208deg,
        transparent            0px,
        transparent            55px,
        rgba(30,90,45,0.06)    55px,
        rgba(30,90,45,0.06)    57px
    );
    animation: waterDrift 28s linear infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes waterDrift {
    from { transform: translate(0,0); }
    to   { transform: translate(60px, 40px); }
}

#world.night { background: #0a1a0f; }

/* Night overlay */
#night-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 50;
    background: rgba(0, 0, 0, 0);
    transition: background .5s ease;
}
#night-overlay.active {
    background: rgba(0, 0, 0, 1);
}
#night-overlay.active::after {
    content: '\1F319';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    opacity: .55;
    pointer-events: none;
}
#night-overlay::before { content: ''; }
#world:not(.night) #night-overlay::before {
    content: '\2600\FE0F';
    position: absolute;
    top: 20px; right: 30px;
    font-size: 2.4rem;
    opacity: 0;
    animation: sunRise 4s ease forwards;
}
@keyframes sunRise {
    from { opacity: 0; transform: translateY(10px); }
    60%  { opacity: 1; }
    to   { opacity: 0; }
}

/* SVG talk-line overlay */
#connections {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* ── Gator ── */
.gator {
    position: absolute;
    width: 66px;
    cursor: pointer; user-select: none;
    z-index: 10;
    display: flex; flex-direction: column; align-items: center;
    transition: opacity .5s, filter .5s;
}
.gator:hover .figure { filter: brightness(1.3) drop-shadow(0 0 6px rgba(120,220,120,.5)); }

/* Name floats above the figure */
.name-above {
    font-size: .78rem;
    color: #d8f0c0;
    text-shadow: 0 1px 5px rgba(0,0,0,.95), 0 0 12px rgba(0,0,0,.8);
    white-space: nowrap;
    pointer-events: none;
    margin-bottom: 2px;
    font-weight: 700;
    letter-spacing: .03em;
}

.personality-badge {
    position: absolute; top: 20px; right: -5px;
    font-size: .65rem; pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.9));
}

/* The SVG figure itself */
.figure { overflow: visible; display: block; }

/* Activity visual states */
.activity-sleeping  { opacity: .42; filter: saturate(.25) brightness(.7); }
/* Swim: gentle side-to-side drift instead of vertical bob */
.activity-moving    .figure { animation: swim .70s ease-in-out infinite; }
.activity-eating    .figure { animation: munch .55s ease-in-out infinite; }
.activity-talking   { filter: drop-shadow(0 0 10px rgba(140,255,100,.75)); }
.activity-hosting   { filter: drop-shadow(0 0 10px rgba(80,200,80,.7)); }
.activity-visiting  { filter: drop-shadow(0 0 10px rgba(60,200,160,.7)); }
.activity-hosting   .figure { animation: swim .90s ease-in-out infinite; }
.activity-visiting  .figure { animation: swim .90s ease-in-out infinite; }
.gator.indoors     { opacity: .68; transform: scale(.80); transform-origin: bottom center; z-index: 3; }
/* Hosting/visiting pair — full visibility, inside the enclosure bubble */
.gator.indoors-private { opacity: 1; transform-origin: bottom center; z-index: 12; }

/* ── Bite flash ──────────────────────────────────────────────── */
/* Applied for ~3 s when a gator is bitten. Red tint pulses on the sprite. */
@keyframes bitten-pulse {
    0%   { filter: drop-shadow(0 0 0px rgba(255, 0, 0, 0));    }
    15%  { filter: drop-shadow(0 0 12px rgba(255, 0, 0, 0.95)) brightness(1.6) saturate(2); }
    40%  { filter: drop-shadow(0 0  6px rgba(255, 60, 60, 0.7)) brightness(1.3); }
    70%  { filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8))  brightness(1.5) saturate(2); }
    100% { filter: drop-shadow(0 0 0px rgba(255, 0, 0, 0));    }
}
.gator.bitten-flash {
    animation: bitten-pulse 0.55s ease-in-out 5 !important;
    z-index: 20;
}

/* ── Private chat enclosure (lilypad bubble) ─────────────────── */
.private-chat-enclosure {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(140, 230, 140, 0.55);
    background: radial-gradient(ellipse at center, rgba(20, 60, 25, 0.45) 0%, rgba(10, 30, 15, 0.22) 70%, transparent 100%);
    box-shadow:
        0 0 18px rgba(80, 200, 100, 0.30),
        inset 0 0 24px rgba(40, 120, 50, 0.18);
    pointer-events: none;
    z-index: 6;
    animation: privateGlow 2.8s ease-in-out infinite alternate;
}
.private-label {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .65rem;
    font-weight: 700;
    color: #a8e890;
    text-shadow: 0 1px 6px rgba(0,0,0,.9);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: .04em;
}
@keyframes privateGlow {
    from { box-shadow: 0 0 14px rgba(80,200,100,.28), inset 0 0 20px rgba(40,120,50,.15); border-color: rgba(140,230,140,.45); }
    to   { box-shadow: 0 0 28px rgba(80,200,100,.50), inset 0 0 32px rgba(40,120,50,.28); border-color: rgba(180,255,160,.70); }
}

@keyframes swim  {
    0%   { transform: translateX(0)   rotate(0deg);  }
    25%  { transform: translateX(3px) rotate(2deg);  }
    50%  { transform: translateX(0)   rotate(0deg);  }
    75%  { transform: translateX(-3px) rotate(-2deg); }
    100% { transform: translateX(0)   rotate(0deg);  }
}
@keyframes munch { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.88); } }

/* â”€â”€ House / lilypad label â”€â”€ */
.house-label {
    position: absolute;
    font-size: .72rem;
    font-weight: 700;
    color: #c8e8a8;
    text-shadow: 0 1px 5px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.7);
    pointer-events: none;
    z-index: 12;
    white-space: nowrap;
    transform: translateX(-50%);
}
.house-guests {
    position: absolute;
    background: rgba(30,80,28,.9);
    color: #b0e090;
    border: 1px solid rgba(70,160,60,.3);
    font-size: .60rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 1px 5px;
    pointer-events: none;
    z-index: 13;
    display: none;
}
.house-guests.visible { display: block; }

/* â”€â”€ Gator detail panel â”€â”€ */
.gator-panel {
    position: absolute;
    top: 0; left: 0;
    width: 268px;
    height: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: rgba(5, 16, 8, 0.97);
    border-right: 1px solid rgba(60,140,60,.12);
    box-shadow: 4px 0 28px rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.gator-panel.panel-open {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: 8px; right: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    color: #8aaa80;
    font-size: .85rem;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    z-index: 2;
    padding: 0;
}
.panel-close:hover { background: rgba(35,90,28,.8); color: #c0e890; }

#gator-panel-content {
    padding: .9rem .85rem .9rem .85rem;
    padding-top: 2.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .18rem;
    font-size: .83rem;
    line-height: 1.6;
    color: #c8d8b8;
}

.panel-name {
    font-size: 1.08rem;
    font-weight: 800;
    color: #d8f0b8;
    letter-spacing: .02em;
    margin-bottom: .2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.panel-murderer { font-size: .72rem; background: rgba(200,40,60,.28); color: #ff7080; border-radius: 4px; padding: 0 5px; }
.panel-liar     { font-size: .72rem; background: rgba(200,130,0,.22); color: #ffb040; border-radius: 4px; padding: 0 5px; }
.panel-dead     { font-size: .78rem; color: #8a9880; font-style: italic; }

.panel-meta { font-size: .8rem; color: #a8b890; }
.panel-debt { color: #ff8860; font-style: italic; }
.panel-orange-badge { font-size: .72rem; color: #ffb040; font-style: italic; margin-left: .3rem; }

.panel-stats { margin: .3rem 0; display: flex; flex-direction: column; gap: .12rem; }
.panel-stat-row {
    font-family: monospace;
    font-size: .75rem;
    color: #90a878;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.stat-bar { display: inline-flex; gap: 2px; align-items: center; }
.stat-pip {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.15);
}
.stat-pip.filled { background: #50a858; border-color: #70c878; }

.panel-divider {
    height: 1px;
    background: rgba(80,160,80,.12);
    margin: .45rem 0;
}

.panel-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6a9858;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.panel-count {
    background: rgba(80,140,60,.22);
    border-radius: 8px;
    padding: 0 5px;
    font-size: .68rem;
    font-weight: 700;
    color: #88b870;
}

.panel-suspect { font-size: .8rem; color: #ff8888; margin: .15rem 0; }
.panel-intent  { font-size: .82rem; margin: .25rem 0; padding: .25rem .4rem; border-radius: 4px; }
.panel-intent-kill { background: rgba(200,40,40,.15); color: #ff8888; border-left: 2px solid #c83030; }
.panel-intent-vote { background: rgba(80,140,200,.15); color: #88b8e8; border-left: 2px solid #4080c0; }
.panel-intent strong { color: #fff; }
.panel-intent-reason { font-size: .76rem; margin-top: .2rem; opacity: .8; font-style: italic; }
.panel-votes   { font-size: .78rem; color: #98a880; opacity: .85; }
.panel-theft   { font-size: .76rem; color: #ff9880; margin: .1rem 0; }

/* Relations list */
.panel-relations { display: flex; flex-direction: column; gap: 2px; }
.rel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: .78rem;
}
.rel-pos { background: rgba(60,150,60,.12); }
.rel-neg { background: rgba(200,50,60,.12); }
.rel-neu { background: transparent; }
.rel-name { color: #c0d0a8; }
.rel-val  { font-weight: 700; font-size: .74rem; }
.rel-pos .rel-val { color: #68c868; }
.rel-neg .rel-val { color: #e05060; }
.rel-neu .rel-val { color: #6a7860; }
.rel-lying { color: #ffb040; font-style: italic; font-size: .7rem; margin-left: 3px; }
.rel-susp  { color: #ff7070; font-size: .7rem; margin-left: 3px; }

/* History log */
.panel-history {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 999px;
}
.history-entry {
    font-size: .7rem;
    color: #7a8a68;
    padding: 2px 0;
    border-bottom: 1px solid rgba(80,140,60,.07);
    line-height: 1.4;
}

/* â”€â”€ Shopping activity â”€â”€ */
.gator.activity-shopping { filter: drop-shadow(0 0 8px rgba(30,180,140,.7)); }

/* â”€â”€ Swordfish lover glow â”€â”€ */
.orange-lover-badge {
    position: absolute;
    top: -8px; right: -6px;
    font-size: .82rem;
    pointer-events: none;
    z-index: 6;
}

/* â”€â”€ Chat bubbles â”€â”€ */
.chat-bubble {
    position: absolute;
    background: rgba(18, 38, 18, 0.96);
    color: #c8e8b0;
    border: 1px solid rgba(70,160,60,.3);
    border-radius: 10px;
    padding: .38rem .7rem .32rem;
    font-size: .75rem;
    max-width: 170px;
    text-align: center;
    word-wrap: break-word;
    line-height: 1.45;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 3px 14px rgba(0,0,0,.65);
    transform: translateX(-50%);
    animation: bubblePop .18s ease-out;
    backdrop-filter: blur(4px);
}
.bubble-name {
    display: block;
    font-weight: 700;
    font-size: .70rem;
    color: #78c860;
    margin-bottom: .15rem;
    letter-spacing: .02em;
}
.bubble-text { display: block; }
.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: rgba(70,160,60,.3);
    border-bottom: none;
}
@keyframes bubblePop {
    from { transform: translateX(-50%) scale(.72); opacity: 0; }
    to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

/* Left/right bubble positioning for conversations */
.bubble-left {
    text-align: left;
}
.bubble-left::after {
    left: 20px;
}
.bubble-left @keyframes bubblePop {
    from { transform: translateX(0) scale(.72); opacity: 0; }
    to   { transform: translateX(0) scale(1);   opacity: 1; }
}

.bubble-right {
    text-align: right;
}
.bubble-right::after {
    left: auto;
    right: 20px;
    transform: translateX(0);
}

/* Unique bubble colors for each gator (8 distinct color schemes) */
.bubble-gator-0 {
    background: rgba(28, 48, 28, 0.96);
    border-color: rgba(80,180,80,.4);
}
.bubble-gator-0::after { border-top-color: rgba(80,180,80,.4); }

.bubble-gator-1 {
    background: rgba(18, 38, 48, 0.96);
    border-color: rgba(60,160,200,.4);
    color: #b0d8e8;
}
.bubble-gator-1::after { border-top-color: rgba(60,160,200,.4); }

.bubble-gator-2 {
    background: rgba(48, 28, 38, 0.96);
    border-color: rgba(200,80,140,.4);
    color: #e8c0d8;
}
.bubble-gator-2::after { border-top-color: rgba(200,80,140,.4); }

.bubble-gator-3 {
    background: rgba(38, 38, 18, 0.96);
    border-color: rgba(180,180,60,.4);
    color: #e8e8b0;
}
.bubble-gator-3::after { border-top-color: rgba(180,180,60,.4); }

.bubble-gator-4 {
    background: rgba(48, 38, 18, 0.96);
    border-color: rgba(200,140,60,.4);
    color: #e8d8b0;
}
.bubble-gator-4::after { border-top-color: rgba(200,140,60,.4); }

.bubble-gator-5 {
    background: rgba(28, 18, 48, 0.96);
    border-color: rgba(120,80,200,.4);
    color: #d0b0e8;
}
.bubble-gator-5::after { border-top-color: rgba(120,80,200,.4); }

.bubble-gator-6 {
    background: rgba(18, 48, 38, 0.96);
    border-color: rgba(60,200,140,.4);
    color: #b0e8d8;
}
.bubble-gator-6::after { border-top-color: rgba(60,200,140,.4); }

.bubble-gator-7 {
    background: rgba(48, 18, 28, 0.96);
    border-color: rgba(200,60,100,.4);
    color: #e8b0c8;
}
.bubble-gator-7::after { border-top-color: rgba(200,60,100,.4); }

/* â”€â”€ Thought bubbles â”€â”€ */
.thought-bubble {
    position: absolute;
    background: rgba(20, 48, 20, 0.92);
    color: #b0d890;
    border: 1px solid rgba(60,130,50,.25);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    padding: .32rem .58rem .30rem;
    font-size: .68rem;
    max-width: 135px;
    text-align: center;
    word-wrap: break-word;
    line-height: 1.38;
    pointer-events: none;
    z-index: 18;
    box-shadow: 0 2px 10px rgba(0,0,0,.5);
    transform: translateX(-20%);
    animation: thoughtPop .22s ease-out;
    font-style: italic;
    backdrop-filter: blur(3px);
}
.thought-bubble::before,
.thought-bubble::after {
    content: '';
    position: absolute;
    background: rgba(20, 48, 20, 0.92);
    border-radius: 50%;
    bottom: -5px;
    left: 22%;
}
.thought-bubble::before { width: 7px; height: 7px; bottom: -8px; left: 18%; }
.thought-bubble::after  { width: 4px; height: 4px; bottom: -14px; left: 12%; }

@keyframes thoughtPop {
    from { transform: translateX(-20%) scale(.7); opacity: 0; }
    to   { transform: translateX(-20%) scale(1);  opacity: 1; }
}

/* ── Animated waiting dots (shown in chat bubbles while awaiting AI) ── */
.bubble-waiting {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}
.bubble-waiting .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #78c860;
    animation: dotBounce 1.2s ease-in-out infinite;
}
.bubble-waiting .dot:nth-child(2) { animation-delay: 0.2s; }
.bubble-waiting .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: .4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Chat history in detail pane ── */
.panel-chat-history {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}
.chat-entry {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: .74rem;
    line-height: 1.4;
    max-width: 90%;
}
.chat-entry-self {
    background: rgba(40,100,40,.3);
    color: #c8e8b0;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.chat-entry-other {
    background: rgba(20,50,20,.5);
    color: #a8d890;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.chat-entry-thought {
    background: rgba(80,60,20,.25);
    color: #d8c890;
    align-self: center;
    font-style: italic;
    border: 1px dashed rgba(180,140,40,.25);
    font-size: .7rem;
}
.chat-entry-overheard {
    background: rgba(60,60,80,.2);
    color: #a0a8c0;
    align-self: flex-start;
    font-style: italic;
    font-size: .7rem;
}
.chat-entry-private {
    background: rgba(40,60,30,.3);
    border-left: 2px solid rgba(80,160,60,.35);
}
.chat-private-badge {
    font-weight: 400;
    font-style: italic;
    font-size: .65rem;
    color: #80c068;
    opacity: .8;
}
.chat-entry .chat-speaker {
    font-weight: 700;
    font-size: .68rem;
    margin-bottom: 1px;
    display: block;
}
.chat-entry-self .chat-speaker { color: #88d870; }
.chat-entry-other .chat-speaker { color: #70b0d0; }
.chat-entry-thought .chat-speaker { color: #c8b060; }
.chat-entry-overheard .chat-speaker { color: #8890b0; }
.chat-entry .chat-time {
    font-size: .6rem;
    opacity: .5;
    float: right;
    margin-left: 6px;
}

/* ── Nightfall countdown timer ── */
.nightfall-timer {
    font-size: .82rem;
    font-weight: 700;
    color: #ffe890;
    background: rgba(80,60,0,.45);
    border: 1px solid rgba(200,160,40,.3);
    border-radius: 12px;
    padding: .15rem .65rem;
    white-space: nowrap;
    display: none;
}
.nightfall-timer.visible { display: inline-block; }

/* ── Night Report Overlay ────────────────────────────────────── */
.nr-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
}
.nr-panel {
    background: linear-gradient(160deg, #080f0a 0%, #050c08 100%);
    border: 1px solid rgba(60,140,60,.25);
    border-radius: 16px;
    width: min(96vw, 880px);
    max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 80px rgba(0,0,0,.9), 0 0 60px rgba(10,60,20,.3);
    overflow: hidden;
}
.nr-header {
    padding: 1.1rem 1.6rem .8rem;
    border-bottom: 1px solid rgba(60,140,60,.15);
    display: flex; flex-direction: column; gap: .2rem;
    flex-shrink: 0;
}
.nr-title    { font-size: 1.3rem; font-weight: 800; color: #8090d8; letter-spacing: .04em; }
.nr-subtitle { font-size: .82rem; color: #5a7050; }
.nr-body {
    display: flex; flex: 1; overflow: hidden;
    min-height: 0;
}
.nr-gator-list {
    width: 220px; flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(60,140,60,.12);
    padding: .5rem 0;
    display: flex; flex-direction: column; gap: 1px;
}
.nr-gator-row {
    display: flex; flex-direction: column; gap: .15rem;
    padding: .55rem .85rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
}
.nr-gator-row:hover   { background: rgba(30,80,30,.35); border-left-color: rgba(60,140,60,.4); }
.nr-gator-row.nr-selected { background: rgba(40,100,40,.4); border-left-color: #50a858; }
.nr-gator-row.nr-murderer {
    background: rgba(80, 10, 10, 0.45);
    border-left-color: #cc2222;
}
.nr-gator-row.nr-murderer:hover   { background: rgba(100,15,15,.55); border-left-color: #ee3333; }
.nr-gator-row.nr-murderer.nr-selected { background: rgba(120,20,20,.6); border-left-color: #ff4444; }
.nr-gator-name    { font-size: .88rem; font-weight: 700; color: #c8e0a8; }
.nr-gator-row.nr-murderer .nr-gator-name { color: #ff9090; }
.nr-gator-suspect { font-size: .74rem; color: #7a9068; }
.nr-gator-suspect strong { color: #ff8888; }
.nr-murderer-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: #ff4444;
    background: rgba(120,0,0,.55);
    border: 1px solid rgba(200,40,40,.4);
    border-radius: 4px;
    padding: .05rem .35rem;
    margin-left: .4rem;
    vertical-align: middle;
    text-transform: uppercase;
}
.nr-loading { padding: 1rem; font-size: .84rem; color: #5a7050; font-style: italic; }
.nr-none    { font-size: .74rem; color: #4a5a40; font-style: italic; }

.nr-detail {
    flex: 1; overflow-y: auto;
    padding: .9rem 1rem;
    display: flex; flex-direction: column; gap: .5rem;
    font-size: .82rem; color: #b8d0a0;
}
.nr-detail-header {
    display: flex; align-items: baseline; gap: .6rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid rgba(60,140,60,.15);
}
.nr-detail-name { font-size: 1.1rem; font-weight: 800; color: #d8f0b0; }
.nr-detail-meta { font-size: .78rem; color: #688058; }
.nr-detail-stats { margin: .2rem 0; }

.nr-report-block {
    background: rgba(5, 10, 30, 0.6);
    border: 1px solid rgba(80,80,180,.25);
    border-radius: 8px;
    padding: .7rem .9rem;
    display: flex; flex-direction: column; gap: .3rem;
}
.nr-report-label   { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #8090c0; }
.nr-report-suspect { font-size: .86rem; color: #c8d8f0; }
.nr-report-suspect strong { color: #ff8888; }
.nr-report-reason  { font-size: .82rem; color: #9aaccb; line-height: 1.5; }
.nr-report-thought {
    font-size: .8rem; color: #a0b080; font-style: italic;
    border-left: 3px solid rgba(80,180,60,.25);
    padding-left: .6rem; margin-top: .15rem;
}
.nr-kill-target { color: #ff9090; }
.nr-kill-target strong { color: #ff4444; }
.nr-kill-block .nr-report-label { color: #cc4444; }
.nr-kill-block .nr-report-suspect strong { color: #ff4444; }

.nr-conv-list {
    display: flex; flex-direction: column; gap: 3px;
    max-height: 300px; overflow-y: auto;
}

.nr-footer {
    padding: .85rem 1.4rem;
    border-top: 1px solid rgba(60,140,60,.15);
    display: flex; justify-content: flex-end;
    flex-shrink: 0;
}
.nr-continue-btn {
    padding: .58rem 1.8rem; font-size: 1rem;
    background: rgba(100,80,10,.7); color: #ffe890;
    border: 1px solid rgba(200,160,40,.35); border-radius: 8px; cursor: pointer;
    transition: background .2s;
}
.nr-continue-btn:hover { background: rgba(130,105,15,.9); }


.ai-modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(4px);
}
.ai-modal-card {
    background: linear-gradient(160deg, #0e2018 0%, #081510 100%);
    border: 1px solid rgba(80,180,80,.3);
    border-radius: 14px;
    padding: 2rem 2.4rem;
    min-width: 340px; max-width: 560px;
    box-shadow: 0 10px 50px rgba(0,0,0,.8);
    display: flex; flex-direction: column; gap: .8rem;
    text-align: center;
}
.ai-modal-title { font-size: 1.1rem; font-weight: 700; color: #a8d890; }
.ai-modal-speaker { font-size: .9rem; color: #8ab880; font-style: italic; }
.ai-modal-status { font-size: .9rem; color: #6a9860; font-style: italic; }
.ai-modal-result {
    font-size: 1.05rem; color: #d8f8b0;
    background: rgba(20,60,20,.5);
    border: 1px solid rgba(80,180,60,.25);
    border-radius: 8px; padding: .7rem 1rem;
    line-height: 1.5;
}
.ai-modal-thought {
    font-size: .88rem; color: #a0c880; font-style: italic;
    background: rgba(10,30,10,.4);
    border-left: 3px solid rgba(80,180,60,.3);
    padding: .5rem .8rem; text-align: left;
}
.ai-modal-ok {
    padding: .6rem 1.8rem; font-size: 1rem; margin-top: .4rem;
    background: rgba(30,100,28,.85); color: #c8f0a8;
    border: 1px solid rgba(80,180,60,.4); border-radius: 8px; cursor: pointer;
    align-self: center;
}
.ai-modal-ok:hover { background: rgba(40,120,35,.95); }

/* ── POV free-camera control hint ── */
#pov-control-hint {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    color: rgba(200,230,180,.85);
    font-size: .78rem;
    padding: .28rem .7rem;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .35s ease;
    z-index: 12;
}

/* ── POV gator context menu ── */
.pov-context-menu {
    position: absolute;
    z-index: 50;
    background: rgba(12, 28, 12, 0.96);
    border: 1px solid rgba(80, 180, 60, 0.45);
    border-radius: 9px;
    padding: .35rem .3rem .3rem;
    min-width: 170px;
    box-shadow: 0 6px 28px rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
    animation: ctxMenuPop .12s ease-out;
}
@keyframes ctxMenuPop {
    from { transform: scale(.88); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.pov-ctx-title {
    font-size: .78rem;
    font-weight: 700;
    color: #78c860;
    padding: .1rem .5rem .35rem;
    border-bottom: 1px solid rgba(80,180,60,.2);
    margin-bottom: .25rem;
    white-space: nowrap;
}
.pov-ctx-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #c8e8b0;
    font-size: .82rem;
    text-align: left;
    padding: .32rem .55rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background .12s;
}
.pov-ctx-btn:hover:not([disabled]) {
    background: rgba(80,180,60,.18);
}
.pov-ctx-btn[disabled] {
    opacity: .38;
    cursor: default;
}

/* Distinct tint for the Attack button so it stands out from social actions */
.pov-ctx-attack {
    color: #ff9090;
}
.pov-ctx-attack:hover:not([disabled]) {
    background: rgba(180, 40, 40, .22);
}

/* Distinct tint for the Make Attack button — amber to show it's a manipulation action */
.pov-ctx-make-attack {
    color: #ffd080;
}
.pov-ctx-make-attack:hover:not([disabled]) {
    background: rgba(160, 100, 10, .22);
}

/* Cancel Conversation button — grey-red to signal a negative/destructive action */
.pov-ctx-cancel {
    color: #e07070;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 2px;
    padding-top: 5px;
}
.pov-ctx-cancel:hover {
    background: rgba(140, 30, 30, .20);
}

/* ── Make Attack picker ── */
/* A floating overlay that presents a two-step gator selection:
   Step 1 — choose the attacker; Step 2 — choose the victim.
   Appears centred at the top of the Babylon container. */
.pov-make-attack-picker {
    position: absolute;
    z-index: 60;                                   /* above context menu (50) */
    background: rgba(12, 22, 8, 0.97);
    border: 1px solid rgba(200, 120, 20, 0.55);
    border-radius: 10px;
    padding: .4rem .35rem .35rem;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0,0,0,.85);
    backdrop-filter: blur(7px);
    animation: ctxMenuPop .13s ease-out;           /* reuse existing pop keyframe */
}
.pov-picker-title {
    font-size: .76rem;
    font-weight: 700;
    color: #ffc060;
    padding: .1rem .5rem .35rem;
    border-bottom: 1px solid rgba(200,120,20,.25);
    margin-bottom: .25rem;
    white-space: nowrap;
}
.pov-picker-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #e8d8a0;
    font-size: .82rem;
    text-align: left;
    padding: .3rem .55rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background .12s;
}
.pov-picker-btn:hover {
    background: rgba(200, 120, 20, .18);
}
/* Cancel button inside the picker gets a muted red tint */
.pov-picker-cancel {
    color: #ff9898;
    border-top: 1px solid rgba(255,100,100,.15);
    margin-top: .25rem;
    padding-top: .4rem;
}

/* Influence picker — teal/purple accent overrides the default amber */
.pov-influence-picker {
    border-color: rgba(140, 80, 220, .55);
}
.pov-influence-picker .pov-picker-title {
    color: #c8a8f8;
    border-bottom-color: rgba(140,80,220,.25);
}
.pov-influence-picker .pov-picker-btn:hover {
    background: rgba(120, 60, 220, .18);
}

/* ── POV in-conversation response choices ── */
.pov-choices {
    position: absolute;
    bottom: 9rem;   /* above the self-speech bar (5rem) and HUD (1.2rem) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 55;
    background: rgba(8, 22, 8, 0.96);
    border: 1px solid rgba(80, 200, 60, 0.5);
    border-radius: 12px;
    padding: .6rem .5rem .5rem;
    min-width: 280px;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,.85);
    backdrop-filter: blur(8px);
    animation: choicesPop .15s ease-out;
}
@keyframes choicesPop {
    from { transform: translateX(-50%) translateY(8px) scale(.9); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0)   scale(1);  opacity: 1; }
}
.pov-choices-label {
    font-size: .72rem;
    color: #78c860;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 0 .4rem .4rem;
    border-bottom: 1px solid rgba(80,200,60,.2);
    margin-bottom: .4rem;
}
.pov-choice-btn {
    display: block;
    width: 100%;
    background: rgba(30,70,20,.45);
    border: 1px solid rgba(80,180,60,.25);
    color: #d8f0c0;
    font-size: .85rem;
    text-align: left;
    padding: .45rem .7rem;
    border-radius: 7px;
    cursor: pointer;
    margin-bottom: .3rem;
    transition: background .12s, border-color .12s;
    line-height: 1.4;
}
.pov-choice-btn:last-child {
    margin-bottom: 0;
}
.pov-choice-btn:hover {
    background: rgba(60,160,40,.3);
    border-color: rgba(100,220,70,.5);
}

/* ── Relationship-toggle button ── */
button.rel-delta-toggle {
    background: rgba(18, 40, 18, 0.75);
    color: #90c878;
    border-color: rgba(80,160,60,.35);
}
button.rel-delta-toggle:hover {
    background: rgba(30, 65, 28, 0.9);
    border-color: rgba(100,200,70,.55);
}

/* ── POV HUD pause / rel-delta buttons ── */
#babylon-pov-hud .pov-hud-btn,
#pov-hud-pause-btn,
#pov-hud-rel-delta-btn {
    background: rgba(8, 25, 8, 0.82);
    color: #a0d888;
    border: 1px solid rgba(80,180,60,.4);
    border-radius: 7px;
    padding: .3rem .65rem;
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
#pov-hud-pause-btn:hover,
#pov-hud-rel-delta-btn:hover {
    background: rgba(30, 70, 20, 0.95);
    border-color: rgba(110,220,70,.65);
}

/* ── 2D relationship-delta floating labels ── */
#rel-delta-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 35;
}
.rel-delta-label {
    position: absolute;
    max-width: 200px;
    padding: .25rem .55rem;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    animation: relDeltaRise .4s ease-out forwards;
    transition: opacity .6s;
}
.rel-delta-pos {
    background: rgba(20, 80, 20, 0.82);
    color: #b8f090;
    border: 1px solid rgba(80, 200, 50, 0.6);
    box-shadow: 0 2px 12px rgba(40,200,40,.25);
}
.rel-delta-neg {
    background: rgba(80, 15, 15, 0.82);
    color: #f0a0a0;
    border: 1px solid rgba(200, 60, 50, 0.6);
    box-shadow: 0 2px 12px rgba(200,40,40,.25);
}
.rel-delta-fade {
    opacity: 0;
}
@keyframes relDeltaRise {
    from { transform: translateX(-50%) translateY(6px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0px); opacity: 1; }
}

/* ── POV rel-delta floating labels ── */
.pov-rel-delta {
    position: absolute;
    max-width: 220px;
    padding: .25rem .6rem;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    white-space: normal;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    animation: relDeltaRise .35s ease-out forwards;
    transition: opacity .6s;
    z-index: 60;
}
.pov-rel-delta-pos {
    background: rgba(20, 80, 20, 0.88);
    color: #c0f0a0;
    border: 1px solid rgba(80,210,60,.55);
    box-shadow: 0 2px 14px rgba(40,200,40,.3);
}
.pov-rel-delta-neg {
    background: rgba(80, 15, 15, 0.88);
    color: #f0a8a8;
    border: 1px solid rgba(200,60,50,.55);
    box-shadow: 0 2px 14px rgba(200,40,40,.3);
}
