/* * {
    user-select: none;
    -webkit-user-drag: none;
} */

/* .ration-item,
.ration-item * {
    user-select: auto !important;
    -webkit-user-drag: auto !important;
} */

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: black;
    position: relative;
    height: 100vh;
    background-color: black;
    overflow: hidden;
}

#corruption-warning {
    display: none;
    color: white;
    font-family: 'Courier New', monospace;
    background: #000000;
    padding: 5px 20px;
    border: 1px solid;
    pointer-events: none;
    transition: all 0.4s;
    opacity: 0;
}

#corruption-warning.fadeIn {
    opacity: 1;
}

canvas {
    /* image-rendering: crisp-edges; */
    /* image-rendering: pixelated; */
}

.game-over-container {
    position: absolute;
    top: 345px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 2rem;
    border: 1px solid #555;
    text-align: center;
    z-index: 9999;
    display: none;
    min-width: 600px;
    box-shadow: 0 0 40px rgba(255,255,255,0.1);
}

.game-over-header {
    font-family: 'Arial', sans-serif;
    color: #fff;
    font-size: 2.5rem !important;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255,255,255,0.3);
    border-bottom: 2px solid #555;
    padding-bottom: 1rem;
}

.injury-list {
    color: #fff;
    font-family: 'Arial', sans-serif;
    margin: 2rem 0;
    text-align: left;
    padding: 1rem;
    border: 1px solid #555;
}

.injury-list ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.injury-list li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.injury-list li::before {
    content: "▰";
    color: #555;
    position: absolute;
    left: 0;
}

.gameoverhandler-button {
    padding: 1.2rem 2.5rem !important;
    font-size: 1.4rem !important;
    background: #333;
    color: #fff;
    border: 2px solid #555 !important;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    margin-top: 1rem;
    width: 100%;
}

.gameoverhandler-button:hover {
    background: #444;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.gameoverhandler-button:active {
    transform: scale(0.98);
}

#storyText {
    position: absolute;
    top: 600px;
    left: 50%;
    transform: translateX(-50%);
    width: 945px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 20px;
    padding: 10px;
    color: #E0E0E0;
    z-index: 11;
    text-align: left;
    background: black;
    min-height: 420px;
}

#actualStoryText {
    position: absolute;
    top: 600px;
    left: 50%;
    transform: translateX(-50%);
    width: 945px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 20px;
    padding: 10px;
    color: #E0E0E0;
    z-index: 11;
    text-align: left;
    background: black;
    min-height: 420px;
}

#storyContent {
    /* min-height: 300px; */
    height: auto;
    margin-bottom: 15px;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
}

#storyContent p {
    margin-bottom: 10px;
}

#storyNextBtn {
    padding: 8px;
    font-size: 16px;
    background: #2a2a2a00;
    color: #E0E0E0;
    cursor: pointer;
    margin: 10px 25px;
    padding: 10px 40px;
    text-align: right;
    width: 400px;
    border: navajowhite;
    float: right;
    background: linear-gradient(-90deg, rgb(25 25 25) 0%, rgba(0, 0, 0, 0) 100%);
    transition: all 0.4s;
}

#storyNextBtn:hover {
    background: linear-gradient(-90deg,rgba(42, 42, 42, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

#cutsceneSkip {
    display: none;
    font-size: 14px;
    color: #E0E0E0;
    cursor: pointer;
    padding: 2px 20px;
    width: auto;
    transition: all 0.4s;
    z-index: 99;
    background: black;
    border: 1px solid #E0E0E0;
    margin-top: 30px;
    margin-right: 855px;
    opacity: 0.5;
    position: absolute;
    top: 90px;
}

#cutsceneSkip:hover {
    opacity: 1;
}

.storyTextChoice {
    padding: 8px;
    font-size: 16px;
    background: #2a2a2a00;
    color: #E0E0E0;
    cursor: pointer;
    margin: 10px 25px;
    padding: 10px 40px;
    text-align: right;
    width: 400px;
    border: navajowhite;
    float: right;
    background: linear-gradient(-90deg, rgb(25 25 25) 0%, rgba(0, 0, 0, 0) 100%);
    transition: all 0.4s;
}

.storyTextChoice:hover {
    background: linear-gradient(-90deg,rgba(42, 42, 42, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

#gameContainer {
    position: absolute;
    top: -145px;
    left: 0;
    width: 100%;
    height: 980px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease-out;
}

#hudContainer {
    position: absolute;
    top: -145px;
    left: 0;
    width: 100%;
    height: 980px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: 1px solid black;
    max-width: 100%;
    max-height: 100%;
}

#darknessCanvas {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    transition: opacity 1.5s ease;
}

#rainCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 7;
    opacity: 0.7;
}

.overlayCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 7;
    opacity: 1;
}

#cooldownIndicator {
    display: flex;
    flex-direction: column-reverse;  /* Flips the fill direction */
    align-items: center;            /* Center horizontally */
    width: 10px;
    height: 20px;
    opacity: 0 !important;
}

#cooldownProgress {
    width: 100%;
    height: 0%;
    background: rgba(200, 200, 200, 0.9);
    transform: translateZ(0); /* Keep for hardware acceleration */
    transition: height linear;
}

#clusterTooltip {
    /* All original properties remain unchanged */
    position: absolute;
    display: none;
    background: rgba(0, 0, 0, 0.9);
    color: #eee;
    border: 1px solid rgba(150, 150, 150, 0.5);
    padding: 12px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;

    /* New grid layout */
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
}

/* New progress bar styles */
.tooltip-progress {
    grid-column: 1 / -1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    margin-top: 4px;
    overflow: hidden;
    position: relative; /* Add this */
    display: flex;
    align-items: flex-start;
}

.tooltip-progress-bar {
    height: 100%;
    background: gray;
    /* transition: width 0.3s ease; */
    width: 0%; /* Initial value - will be overwritten by inline style */
    display: block; /* Force block display */
    box-shadow: 0 0 4px rgba(74, 158, 255, 0.4); /* Add glow effect */
    transform: translateZ(0); /* Force hardware acceleration */
    height: 100%;
    margin-top: 0;
}

.tooltip-row {
    grid-column: 1 / -1;
    font-weight: bold;
    margin-bottom: 4px;
}

.tooltip-label {
    color: inherit; /* Preserve original color */
    padding-right: 20px;
}

.tooltip-value {
    text-align: right;
    color: inherit; /* Keep original value color */
}

.show-cooldown {
  opacity: 1 !important;
}

#actionText {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.9);
    color: #eee;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    display: none;
    z-index: 20;
    border-radius: 3px;
    border: 1px solid #E0E0E0;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    white-space: normal;
    word-wrap: break-word;
}

#actionText .options {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #555;
    text-align: left;
}

#actionText .options span {
    margin: 5px 12px;
    color: #aaa;
    cursor: pointer;
    display: inline-block;
    padding: 3px 8px;
}

#actionText .options span:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

#actionText.start-interaction-style {
    width: 400px;
}

#actionText.start-interaction-style .options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

#actionText.settlement-interaction-style {

}

#actionText.start-interaction-style .options span {
    padding: 8px 0;
    margin: 0;
    border-radius: 0;
    text-align: center;
    min-width: 0;
}

#statsContainer {
    position: absolute;
    top: 75px;
    left: calc(50% - (var(--canvas-width) / 2));
    display: flex;
    gap: 10px;
    z-index: 100;
    opacity: 0.9;
}

#rightStatsContainer {
    position: absolute;
    top: 75px;
    right: calc(50% - (var(--canvas-width) / 2));
    display: flex;
    gap: 10px;
    z-index: 100;
    opacity: 0.9;
}

.stat-counter {
    font-family: 'Consolas', monospace;
    font-size: 14px;
    padding: 2px 8px;
    min-width: 90px;
    text-align: center;
    background: rgb(50 50 50 / 40%); /* Dark gray with transparency */
    border: 1px solid rgba(70, 70, 70, 0.9); /* Very subtle border */
    color: #dbdbdbe6;
    border-radius: 1px;
    letter-spacing: 0;
    line-height: 1.2;
    cursor: default;
    height: 17px;
}

.stat-counter-xp {
    font-family: 'Consolas', monospace;
    font-size: 14px;
    padding: 2px 8px;
    min-width: 90px;
    text-align: left;
    background: rgb(50 50 50 / 40%); /* Dark gray with transparency */
    border: 1px solid rgba(70, 70, 70, 0.9); /* Very subtle border */
    color: #dbdbdbe6;
    border-radius: 1px;
    letter-spacing: 0;
    line-height: 1.2;
    cursor: default;
    height: 17px;
}

.combat-view {
    text-align: right;
    width: 125px;
}

#clusterTooltip {
    position: absolute;
    display: none;
    background: rgba(0, 0, 0, 0.9);
    color: #eee;
    padding: 12px;
    border: 1px solid #E0E0E0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    pointer-events: none;
    z-index: 25;
    max-width: 300px;
    white-space: pre-wrap;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

#dayCycleBar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 6px;
  background: rgba(50, 50, 50, 0.7);
  border: 1px solid rgba(100, 100, 100, 0.5);
  z-index: 100;
}

#dayCycleProgress {
  height: 100%;
  width: 0%;
  background: #777;
  transition: none; /* Remove smooth animation */
}

#timeContainer {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

#timeIndicator, #dayCounter {
    color: #ddd;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    text-shadow: 1px 1px 1px #000;
    min-width: 100px;
}

#dayCounter::before {
    content: "Day ";
}
