html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #181a20;
    color: #e0e0e0;
}

h1, h2, h3, h4, h5, h6 {
    color: #fafafa;
}

a, .btn-link {
    color: #4fc3f7;
}

a:hover, .btn-link:hover {
    color: #81d4fa;
}

.btn-primary {
    color: #fff;
    background-color: #3949ab;
    border-color: #283593;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #222, 0 0 0 0.25rem #4fc3f7;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e57373;
}

.validation-message {
    color: #e57373;
}

#blazor-error-ui {
    display: none !important;
    background: #333;
    color: #fff;
}

#blazor-error-ui .dismiss {
    color: #fff;
}

.blazor-error-boundary {
    background: #b32121;
    color: #fff;
}

code {
    color: #ffb300;
    background: #23272b;
}

/* Password Gate */
.password-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.password-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.password-heart {
    font-size: 3rem;
    opacity: 0.5;
}

.password-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #4fc3f7;
    font-size: 1rem;
    text-align: center;
    padding: 0.4rem 0.8rem;
    outline: none;
    letter-spacing: 0.15em;
    width: 200px;
    caret-color: #4fc3f7;
}

.password-input::placeholder {
    color: #333;
}

.password-input:focus {
    border-bottom-color: #4fc3f7;
}

.password-error {
    color: #cc2222;
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.7;
}

/* Layout and component classes */
.centered-box-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;   
}

.box {
    position: relative;
    z-index: 20;
    width: 200px;
    height: 200px;
    background-color: #222a36;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s;
}

.box:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    background-color: #263245;
}

.box, .box-count {
    user-select: none;
}

.box:focus {
    outline: none;
}

.box-count {
    color: #4fc3f7;
    font-size: 2rem;
    font-weight: bold;
    margin-top: 1.5rem;
}

/* Animated text - letter drop */
.anim-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(calc(var(--drop-y, 0.5em) * -1)) rotate(var(--drop-rot, 0deg));
    animation: letter-drop 0.5s ease-out forwards;
}

@keyframes letter-drop {
    to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

.influence-counter {
    position: fixed;
    bottom: calc(2rem + 110px);
    left: 0;
    right: 0;
    text-align: center;
    color: #9575cd;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
    pointer-events: none;
}

.box-heart {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    user-select: none;
}

@keyframes pulse-box {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 0 rgba(79,195,247,0);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px 2px rgba(79,195,247,0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 0 rgba(79,195,247,0);
    }
}

@keyframes pulse-heart {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.box.pulse {
    animation: pulse-box 0.25s;
}

.box-heart.pulse {
    animation: pulse-heart 0.25s;
}

/* Click whispers - floating text */
.click-whispers {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.whisper {
    position: absolute;
    font-weight: 400;
    color: #4fc3f7;
    font-style: italic;
    letter-spacing: 0.05em;
    pointer-events: none;
    white-space: nowrap;
}

/* Glow/blur variants */
.whisper-glow {
    text-shadow: 0 0 8px rgba(79, 195, 247, 0.6), 0 0 16px rgba(79, 195, 247, 0.3);
}

.whisper-ghost {
    filter: blur(0.5px);
    opacity: 0.7;
}

.whisper-sharp-glow {
    text-shadow: 0 0 2px rgba(79, 195, 247, 0.9);
}

/* Uneven text inline spans */
.whisper-uneven > span {
    display: inline-block;
}

/* Style variants */
.whisper-0 { animation: whisper-rise 2.5s ease-out forwards; }
.whisper-1 { animation: whisper-drift-left 2.2s ease-out forwards; font-weight: 300; }
.whisper-2 { animation: whisper-drift-right 2.8s ease-out forwards; font-weight: 600; }
.whisper-3 { animation: whisper-pulse-fade 2s ease-in-out forwards; }
.whisper-4 { animation: whisper-rise 2s ease-out forwards; font-weight: 200; letter-spacing: 0.2em; }
.whisper-5 { animation: whisper-sink 2.4s ease-out forwards; font-weight: 500; }

@keyframes whisper-rise {
    0%   { opacity: 0; transform: translateY(0) rotate(var(--whisper-rot, 0deg)); }
    15%  { opacity: 0.35; }
    70%  { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-40px) rotate(var(--whisper-rot, 0deg)); }
}

@keyframes whisper-drift-left {
    0%   { opacity: 0; transform: translate(0, 0) rotate(var(--whisper-rot, 0deg)); }
    15%  { opacity: 0.3; }
    70%  { opacity: 0.15; }
    100% { opacity: 0; transform: translate(-25px, -15px) rotate(var(--whisper-rot, 0deg)); }
}

@keyframes whisper-drift-right {
    0%   { opacity: 0; transform: translate(0, 0) rotate(var(--whisper-rot, 0deg)); }
    15%  { opacity: 0.3; }
    70%  { opacity: 0.15; }
    100% { opacity: 0; transform: translate(25px, -15px) rotate(var(--whisper-rot, 0deg)); }
}

@keyframes whisper-pulse-fade {
    0%   { opacity: 0; transform: scale(0.8) rotate(var(--whisper-rot, 0deg)); }
    20%  { opacity: 0.4; transform: scale(1.05) rotate(var(--whisper-rot, 0deg)); }
    50%  { opacity: 0.3; transform: scale(1) rotate(var(--whisper-rot, 0deg)); }
    100% { opacity: 0; transform: scale(0.95) rotate(var(--whisper-rot, 0deg)); }
}

@keyframes whisper-sink {
    0%   { opacity: 0; transform: translateY(0) rotate(var(--whisper-rot, 0deg)); }
    15%  { opacity: 0.25; }
    70%  { opacity: 0.15; }
    100% { opacity: 0; transform: translateY(20px) rotate(var(--whisper-rot, 0deg)); }
}

/* Sidebar (NavMenu) */
.sidebar {
    background-color: #20232a;
    color: #e0e0e0;
    min-width: 220px;
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

.player-stats {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: #222a36;
    color: #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    padding: 1rem 1.5rem;
    min-width: 300px;
    width: 340px;
    min-height: 80px;
    height: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    box-sizing: border-box;
}

.sacrifice-btn {
    margin-left: 1rem;
    background: #3949ab;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.sacrifice-btn:hover {
    background: #283593;
}

.player-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed from flex-start */
    gap: 1rem;
}

.follower-stats {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #222a36;
    color: #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    padding: 1rem 1.5rem;
    min-width: 300px;
    width: 340px;
    min-height: 80px;
    height: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    box-sizing: border-box;
}

.follower-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.follower-stat-row .sacrifice-btn {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Debug Panel */
.debug-panel {
    position: fixed;
    top: 40px;
    right: 1rem;
    background: rgba(10, 10, 10, 0.92);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    z-index: 999;
    min-width: 280px;
    font-size: 0.8rem;
    color: #aaa;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.debug-panel-header {
    color: #555;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-bottom: 1px solid #222;
    padding-bottom: 0.4rem;
    margin-bottom: 0.1rem;
}

.debug-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.debug-label {
    color: #777;
    min-width: 110px;
}

.debug-btns {
    display: flex;
    gap: 0.3rem;
}

.debug-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s, color 0.15s;
}

.debug-btn:hover {
    background: #2a2a2a;
    color: #ccc;
    border-color: #555;
}

.debug-hint {
    color: #333;
    font-size: 0.65rem;
    text-align: right;
    margin-top: 0.2rem;
}

/* Life Force Bar */
.life-force-bar-container {
    position: fixed;
    top: 12px;
    left: 16px;
    right: 16px;
    height: 14px;
    background: #120606;
    border-radius: 7px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.8), inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.life-force-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3a0000, #8b0000, #c02020, #8b0000);
    border-radius: 7px;
    box-shadow: 0 0 12px rgba(160, 0, 0, 0.8), 0 0 24px rgba(139, 0, 0, 0.4);
    transition: width 0.15s linear;
    animation: life-force-pulse 3s ease-in-out infinite;
}

.life-force-critical {
    animation: life-force-critical-pulse 0.7s ease-in-out infinite;
}

@keyframes life-force-pulse {
    0%   { box-shadow: 0 0 12px rgba(160, 0, 0, 0.8), 0 0 24px rgba(139, 0, 0, 0.4); }
    50%  { box-shadow: 0 0 18px rgba(200, 0, 0, 1.0), 0 0 36px rgba(180, 0, 0, 0.6); }
    100% { box-shadow: 0 0 12px rgba(160, 0, 0, 0.8), 0 0 24px rgba(139, 0, 0, 0.4); }
}

/* Life Force Numbers */
.life-force-numbers {
    position: fixed;
    top: 32px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 200;
    pointer-events: none;
}

.life-force-hp-text {
    font-size: 0.7rem;
    color: #666;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.03em;
}

.life-force-drain-text {
    font-size: 0.7rem;
    color: #cc2222;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.03em;
    transition: color 0.3s;
}

@keyframes life-force-critical-pulse {
    0%   { box-shadow: 0 0 12px rgba(160, 0, 0, 0.8), 0 0 24px rgba(139, 0, 0, 0.4); opacity: 0.65; }
    50%  { box-shadow: 0 0 24px rgba(255, 40, 40, 1.0), 0 0 48px rgba(220, 0, 0, 0.7); opacity: 1.0; }
    100% { box-shadow: 0 0 12px rgba(160, 0, 0, 0.8), 0 0 24px rgba(139, 0, 0, 0.4); opacity: 0.65; }
}

/* Sacrifice Button */
.sacrifice-overlay {
    position: fixed;
    bottom: 30vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    text-align: center;
}

.sacrifice-life-btn {
    background: transparent;
    border: 1px solid #8b0000;
    color: #cc2222;
    font-size: 1.4rem;
    letter-spacing: 0.5em;
    padding: 0.8rem 2rem;
    cursor: pointer;
    text-transform: uppercase;
    animation: sacrifice-btn-pulse 1.5s ease-in-out infinite;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.sacrifice-life-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    border-color: #cc2222;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
}

/* Sacrifice screen flash */
.sacrifice-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(220, 0, 0, 0.8), rgba(120, 0, 0, 0.5), rgba(40, 0, 0, 0.3));
    z-index: 300;
    pointer-events: none;
    animation: sacrifice-flash-anim 0.8s ease-out forwards;
}

@keyframes sacrifice-flash-anim {
    0%   { opacity: 1; }
    30%  { opacity: 0.9; }
    100% { opacity: 0; }
}

@keyframes sacrifice-btn-pulse {
    0%   { opacity: 0.7; text-shadow: 0 0 4px rgba(139, 0, 0, 0.3); transform: scale(1.0); }
    50%  { opacity: 1.0; text-shadow: 0 0 12px rgba(204, 34, 34, 0.6); transform: scale(1.07); }
    100% { opacity: 0.7; text-shadow: 0 0 4px rgba(139, 0, 0, 0.3); transform: scale(1.0); }
}

/* Milestone Grid */
.milestone-grid {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(6, 48px);
    grid-template-rows: repeat(2, 48px);
    gap: 6px;
}

.milestone-tile {
    position: relative;
    width: 48px;
    height: 48px;
    background: #222a36;
    border-radius: 8px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: border-color 0.3s, box-shadow 0.3s, filter 0.3s;
    user-select: none;
}

.milestone-emoji {
    font-size: 1.2rem;
}

.milestone-locked .milestone-emoji {
    opacity: 0.3;
}

/* Hover tooltip */
.milestone-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: #1a1e26;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    z-index: 300;
    text-align: center;
}

.milestone-tooltip-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ccc;
}

.milestone-tooltip-req {
    font-size: 0.6rem;
    color: #888;
    margin-top: 2px;
}

.milestone-tooltip-cost {
    font-size: 0.6rem;
    color: #4fc3f7;
    margin-top: 2px;
}

.milestone-tile:hover .milestone-tooltip {
    display: block;
}

.milestone-tooltip-affordable {
    color: #66bb6a;
}

/* Empty placeholder slots */
.milestone-empty {
    background: #1a1e24;
    border-color: #262a30;
}

.milestone-locked {
    border-color: #222;
}

.milestone-available {
    border-color: #555;
    box-shadow: 0 0 6px rgba(100, 100, 100, 0.3);
    cursor: default;
}

.milestone-affordable {
    border-color: #4fc3f7;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.4);
    cursor: pointer;
    animation: milestone-glow 2s ease-in-out infinite;
}

.milestone-affordable:hover {
    box-shadow: 0 0 18px rgba(79, 195, 247, 0.7);
    border-color: #81d4fa;
}

.milestone-completed {
    border-color: #4a7a4a;
    background: #1a2e1a;
}

@keyframes milestone-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(79, 195, 247, 0.3); }
    50% { box-shadow: 0 0 20px rgba(79, 195, 247, 0.6); }
}
