:root {
    --background: #191d23;
    --container: #23272f;
    --card: #232734;
    --accent: #3491e4;
    --accent-faded: #26486c;
    --good: #44dd96;
    --death: #e05260;
    --neutral: #b5c1d4;
    --text-main: #f2f4fa;
    --text-muted: #c6cad6;
    --entry-bg: #242733;
    --status-list-bg: #1c1e25;
    --pause-banner: #222e3a;
    --pause-text: #ffe084;
}

html, body {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-main);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    font-size: 14px; /* Smaller for more space */
    box-sizing: border-box;
    overflow-x: hidden;
}

body .container {
    margin-top: 46px;
}

.container {
    width: 100vw;
    max-width: 100vw;
    min-height: 85vh;
    margin: 0 auto;
    padding: 0 0 14px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
}

h1 {
    color: var(--accent);
    font-size: 1.7em;
    letter-spacing: 0.02em;
    text-align: center;
    font-weight: 800;
    margin: 13px 0 2px 0;
}

h2 {
    font-size: 1.07em;
    color: var(--neutral);
    margin-top: 0;
    margin-bottom: 9px;
    font-weight: 600;
}

h3 {
    margin: 4px 0 2px 0;
    color: var(--accent);
    font-size: 0.93em;
    font-weight: 500;
    letter-spacing: 0.01em;
}

#setup-area {
    margin: 0 auto 16px auto;
    max-width: 560px;
    width: 100%;
    padding: 15px 10px 20px 10px;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 1px 5px #0002;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    font-size: 0.98em;
}

#setup-area label {
    margin-bottom: 7px;
    font-size: 1.06em;
    color: var(--accent);
    font-weight: 500;
}

#tribute-names {
    width: 100%;
    height: 110px;
    padding: 7px;
    font-size: 0.97em;
    background: var(--entry-bg);
    color: var(--text-main);
    border: 1px solid #384559;
    border-radius: 4px;
    font-family: monospace;
    margin-bottom: 10px;
    resize: vertical;
    box-sizing: border-box;
    transition: border 0.15s;
}

#tribute-names:focus {
    border: 1px solid var(--accent);
    outline: none;
}

#start-game-btn {
    width: 100%;
    font-size: 1em;
    padding: 11px 0;
    border: none;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent) 60%, var(--accent-faded) 100%);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px #17344a21;
    transition: background 0.18s, transform 0.11s;
    margin-top: 5px;
}

#start-game-btn:hover:enabled {
    background: linear-gradient(90deg, var(--accent-faded) 0%, var(--accent) 100%);
    transform: scale(1.009);
}

#start-game-btn:disabled {
    background: #394d5f;
    color: #cccccc;
    cursor: not-allowed;
}

.game-area {
    margin-top: 25px;
    width: 100vw;
    max-width: 100vw;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 2vw;
    padding: 0 0 1vw 0;
}

.card {
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 1px 6px 0 #0003;
    border: 1px solid #222c39;
    padding: 18px 18px 18px 18px;
    margin: 0;
    min-width: 250px;
    max-width: 46vw;
    width: 100%;
    box-sizing: border-box;
    font-size: 1em;
}

.log {
    min-width: 400px;
    max-width: 63vw;
}

.status {
    min-width: 210px;
    max-width: 30vw;
    margin-left: 1vw;
}

.status-lists {
    display: flex;
    flex-direction: row;
    gap: 2vw;
    justify-content: space-between;
    align-items: flex-start;
}

.status-lists > div {
    width: 49%;
    min-width: 110px;
    max-height: 31vh;
    background: var(--status-list-bg);
    border-radius: 6px;
    padding: 4px 4px 4px 8px;
    overflow-y: auto;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
    margin: 0 0 7px 0;
}

.log-entries {
    max-height: 65vh;
    min-height: 140px;
    overflow-y: auto;
    padding-right: 7px;
    background: var(--entry-bg);
    border-radius: 4px;
    border: 1px solid #333b4d;
    font-size: 0.99em;
    box-shadow: 0 1px 3px #0001;
    margin-top: 0;
}

.log-entry {
    padding: 4px 0 4px 3px;
    border-bottom: 1px dashed #384559;
    word-break: break-word;
    background: transparent;
    transition: background 0.14s;
    font-size: 0.97em;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.day-marker {
    font-weight: 600;
    color: var(--accent);
    text-align: center;
    margin: 7px 0;
    border-bottom: 1px solid var(--accent);
    background: #233d5528;
    border-radius: 2px;
    font-size: 0.98em;
}

.log-entry.death {
    color: var(--death);
    background: #3c263027;
    font-weight: bold;
}

.log-entry.good-event {
    color: var(--good);
    background: #1e352a1b;
}

.log-entry.neutral {
    color: var(--neutral);
}

.tributes-list {
    list-style-type: none;
    padding: 0 0 0 0;
    margin: 0 0 5px 0;
    background: transparent;
    max-height: 28vh;
    overflow-y: auto;
    font-size: 0.98em;
}

.tributes-list li {
    padding: 2px 0 2px 2px;
    font-size: 0.97em;
    color: var(--text-main);
    border-bottom: 1px solid #232e3d21;
    transition: color 0.13s;
    letter-spacing: 0.003em;
}

.tributes-list li:last-child {
    border-bottom: none;
}

.tribute-dead {
    text-decoration: line-through;
    color: #6a798d;
    font-style: italic;
}

/* Scrollbars */
.log-entries::-webkit-scrollbar,
.tributes-list::-webkit-scrollbar,
.status-lists > div::-webkit-scrollbar {
    width: 8px;
}
.log-entries::-webkit-scrollbar-thumb,
.tributes-list::-webkit-scrollbar-thumb,
.status-lists > div::-webkit-scrollbar-thumb {
    background: #233148;
    border-radius: 6px;
}
.log-entries::-webkit-scrollbar-track,
.tributes-list::-webkit-scrollbar-track,
.status-lists > div::-webkit-scrollbar-track {
    background: #232734;
}

/* Responsive tweaks */
@media (max-width: 1100px) {
    .game-area {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .card, .log, .status {
        max-width: 100vw !important;
        min-width: 0 !important;
        width: 100% !important;
        font-size: 0.97em;
    }
    .log {
        min-width: 0;
    }
    .status {
        min-width: 0;
    }
    .status-lists {
        flex-direction: row;
        gap: 1vw;
    }
    .status-lists > div {
        min-width: 70px;
        max-height: 22vh;
        font-size: 0.93em;
    }
}

@media (max-width: 700px) {
    .container {
        margin-top: 33px;
    }
    .card, .log, .status {
        padding: 5px 2px 7px 2px;
    }
    .status-row {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    .status-lists {
        flex-direction: column;
        gap: 6px;
    }
    .status-lists > div {
        min-width: 0;
        padding: 1px 2px 2px 5px;
        font-size: 0.93em;
    }
    .log-entries {
        min-height: 60px;
        max-height: 21vh;
    }
}

.controls-area {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 7px auto;
    background: var(--card);
    border-radius: 7px;
    box-shadow: 0 1px 4px #0002;
    padding: 12px 16px 8px 16px;
    font-size: 0.96em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

#speed-slider {
    width: 170px;
    accent-color: var(--accent);
    margin: 0 6px 0 7px;
    cursor: pointer;
}

#speed-display {
    font-family: monospace;
    min-width: 50px;
    display: inline-block;
}

.hint {
    color: #aaa;
    font-size: 0.91em;
    margin-left: 5px;
}

/* Pause Indicator and Next Turn Button */
.pause-indicator {
    display: none;
    position: fixed;
    top: 15px;
    right: 32px;
    z-index: 205;
    background: var(--pause-banner);
    color: var(--pause-text);
    font-size: 1.15em;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 6px 18px 6px 18px;
    border-radius: 9px;
    border: 1px solid #2a3650;
    box-shadow: 0 2px 7px #0002;
    opacity: 0.92;
}
.next-turn-btn {
    display: inline-block;
    margin-left: 16px;
    padding: 6px 14px;
    font-size: 0.99em;
    background: linear-gradient(90deg, var(--accent-faded) 40%, var(--accent) 90%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.09s;
    box-shadow: 0 1px 4px #17344a22;
    outline: none;
}
.next-turn-btn:active {
    transform: scale(0.98);
    background: linear-gradient(90deg, var(--accent) 40%, var(--accent-faded) 90%);
}

/* Modal and overlays */
.update-modal {
    position: fixed;
    z-index: 10001;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(20,28,40, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadein-modal 0.3s;
}
@keyframes fadein-modal {
    from { opacity: 0; }
    to { opacity: 1; }
}
.update-modal-content {
    background: var(--card, #232734);
    border: 1.5px solid var(--accent, #3491e4);
    box-shadow: 0 6px 24px #0007;
    border-radius: 13px;
    min-width: 330px;
    max-width: 92vw;
    padding: 34px 32px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.update-modal-content h2 {
    color: var(--accent, #3491e4);
    margin-bottom: 15px;
    font-size: 1.38em;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
}
.update-list {
    color: var(--neutral, #b5c1d4);
    font-size: 1.05em;
    margin-bottom: 27px;
    list-style: disc inside;
    padding-left: 0;
    text-align: left;
    width: 100%;
    max-width: 360px;
}
.update-list li {
    margin-bottom: 7px;
    line-height: 1.55;
    padding-left: 2px;
}
.modal-close-btn {
    font-size: 1.08em;
    background: linear-gradient(90deg, var(--accent-faded, #26486c) 40%, var(--accent, #3491e4) 90%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 9px 34px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 7px #0003;
    margin-top: 7px;
    transition: background 0.18s, transform 0.08s;
}
.modal-close-btn:hover {
    background: linear-gradient(90deg, var(--accent, #3491e4) 40%, var(--accent-faded, #26486c) 90%);
    transform: scale(1.03);
}

/* Betting area and betting overlay/summary */
.betting-area {
    margin: 28px auto 0 auto;
    background: var(--card, #252c3a);
    border: 1.5px solid var(--accent, #3491e4);
    border-radius: 11px;
    box-shadow: 0 2px 11px #0002;
    max-width: 510px;
    padding: 26px 32px 18px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.betting-area h2 {
    color: var(--accent, #3491e4);
    margin-bottom: 0.8em;
    font-size: 1.25em;
    letter-spacing: 0.01em;
}
.bet-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    margin: 5px 0;
    width: 100%;
}
#bet-tribute, #bet-amount {
    padding: 7px 13px;
    font-size: 1em;
    border-radius: 5px;
    border: 1px solid #35527a;
    background: #202738;
    color: #e0e7ff;
    width: 165px;
    margin-right: 7px;
}
#bet-money-info {
    color: #8cd689;
    font-size: 0.98em;
    margin-left: 7px;
}
#betting-area label {
    min-width: 68px;
    color: #bbb;
}
#place-bet-btn {
    margin-top: 15px;
    padding: 8px 36px;
    font-size: 1.04em;
    border-radius: 6px;
    border: none;
    background: linear-gradient(90deg, var(--accent-faded, #3a69a3) 0%, var(--accent, #3491e4) 100%);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.18s, transform 0.09s;
    box-shadow: 0 1px 7px #26385822;
}
#place-bet-btn:active {
    transform: scale(0.98);
}
.bet-error {
    color: #ee4242;
    margin-top: 4px;
    font-size: 0.97em;
    min-height: 19px;
}
.bet-tribute-suggest {
    position: absolute;
    margin-top: 32px;
    left: 0;
    background: #162136;
    color: #d7e2f7;
    border: 1px solid #293b5a;
    border-radius: 6px;
    z-index: 201;
    width: 240px;
    box-shadow: 0 3px 13px #0003;
    display: none;
    max-height: 160px;
    overflow-y: auto;
}
.bet-tribute-suggest div {
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.bet-tribute-suggest div:hover, .bet-tribute-suggest .active {
    background: #27458c;
    color: #fff;
}
.betting-summary {
    background: var(--card, #232d3a);
    border: 1.2px solid var(--accent, #3aa6e4);
    border-radius: 10px;
    box-shadow: 0 2px 10px #0003;
    padding: 19px 22px;
    color: #cce6fa;
    margin: 18px auto 0 auto;
    max-width: 410px;
    font-size: 1.08em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Modern Profit Ticker */
.profit-ticker {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 12px;
    z-index: 2000;
    background: #1b222c;
    border-radius: 16px;
    padding: 8px 38px;
    font-size: 1.18em;
    font-weight: 700;
    color: #5cc255;
    border: 2px solid #273958;
    box-shadow: 0 2px 12px #0311232e;
    letter-spacing: 0.02em;
    transition: color 0.25s, background 0.18s, transform 0.16s;
    user-select: none;
    pointer-events: none;
}
.profit-ticker.negative {
    color: #ff6363;
    background: #2b171b;
    border-color: #581a2a;
}
.profit-ticker.positive {
    color: #5cc255;
    background: #1b222c;
    border-color: #273958;
}
.profit-ticker.neutral {
    color: #53b1ea;
    background: #23283a;
    border-color: #2d436a;
}

/* Endgame/Victory Overlay Styles */
.endgame-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(18,24,35,0.96);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.endgame-content {
    background: #232e41;
    padding: 40px 50px 35px 50px;
    border-radius: 17px;
    box-shadow: 0 6px 40px #071128cc;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 97vw;
    min-width: 300px;
}
#victory-area {
    margin-bottom: 18px;
    text-align: center;
}
.victory-banner {
    font-size: 2em;
    color: #34df5e;
    font-weight: bold;
    margin-bottom: 9px;
    text-shadow: 0 3px 14px #1bcd4480;
}
.victory-banner.loss {
    color: #ea4e4e;
    text-shadow: 0 2px 10px #ea4e4e4c;
}
.victory-banner.top {
    color: #4eb4ea;
    text-shadow: 0 2px 10px #4eb4ea4c;
}
.victory-sub {
    font-size: 1.2em;
    color: #cdeaf8;
    margin-bottom: 13px;
    text-align: center;
}
.betting-summary-block {
    font-size: 1.15em;
    padding: 16px 32px;
    margin: 8px 0 10px 0;
    border-radius: 12px;
    background: #263354;
    color: #e8f9ff;
    box-shadow: 0 1px 9px #23305426;
    border: 2px solid #2f4e8a;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.betting-summary-block .big-profit {
    font-size: 1.36em;
    font-weight: bold;
    margin-top: 7px;
}
.betting-summary-block .big-profit.negative { color: #ff6868; }
.betting-summary-block .big-profit.positive { color: #59e483; }
.betting-summary-block .big-profit.neutral { color: #53b1ea; }
.betting-summary-block .badge {
    font-size: 0.99em;
    background: #44b481;
    color: #fff;
    border-radius: 9px;
    padding: 4px 12px;
    margin-bottom: 4px;
    display: inline-block;
    font-weight: 600;
}
.betting-summary-block .badge.loss { background: #ea6060; }
.betting-summary-block .badge.refund { background: #48a3ea; }
.betting-summary-block .badge.partial { background: #fadf5d; color: #3a3217;}
.betting-summary-block .badge.win { background: #45d77c; }
.betting-summary-block .bet-icon {
    font-size: 1.5em;
    vertical-align: middle;
    margin-right: 6px;
}
.next-game-btn {
    margin-top: 24px;
    padding: 12px 54px;
    font-size: 1.19em;
    border-radius: 8px;
    border: none;
    background: linear-gradient(90deg, #38a1ff 0%, #47e26a 100%);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 3px 20px #26a01e44;
    transition: background 0.18s, transform 0.09s;
}
.next-game-btn:active { transform: scale(0.97); }

@media (max-width: 600px) {
    .endgame-content { padding: 20px 3vw; }
}

/* Winner Announcement Banner (optional, if you keep it for notifications) */
.winner-announcement {
    position: fixed;
    z-index: 200;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 35px;
    background: linear-gradient(90deg, var(--accent-faded) 0, var(--accent) 100%);
    color: #fff;
    text-align: center;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 8px 0 6px 0;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 2px 8px 0 #0004;
    display: none;
}
