body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: sans-serif;
}

canvas {
    display: block;
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

#regenButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#regenButton:hover {
    background-color: #45a049;
}

#regenButton:active {
    background-color: #3e8e41;
}

#nationsButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#nationsButton:hover {
    background-color: #007ba7;
}

#nationsButton.active {
    background-color: #006a92;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

#optionsButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#optionsButton:hover {
    background-color: #546E7A;
}

#pauseButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#pauseButton:hover {
    background-color: #e53935;
}

#pauseButton.paused {
    background-color: #4CAF50;
}

#pauseButton.paused:hover {
    background-color: #45a049;
}

#speedButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
    min-width: 100px;
}

#speedButton:hover {
    background-color: #fb8c00;
}

#nationInfo {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(40, 40, 40, 0.9);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 20;
    width: 280px;
    border: 1px solid #555;
    font-size: 15px;
    transition: opacity 0.2s, transform 0.2s;
}

#nationInfo.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

#nationInfo h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #4CAF50;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    font-size: 18px;
}

#nationInfo p {
    margin: 8px 0;
}

#nationInfo strong {
    color: #b0b0b0;
    display: inline-block;
    width: 90px;
}

#closeInfo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

#closeInfo:hover {
    color: white;
}

#nationInfo #warInfo {
    margin-top: 15px;
    border-top: 1px solid #555;
    padding-top: 10px;
}

#nationInfo #warInfo h4 {
    margin: 0 0 10px 0;
    color: #f44336;
}

#nationInfo #warList {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#nationInfo #warList li {
    margin-bottom: 5px;
    padding-bottom: 12px;
    border-bottom: 1px solid #555;
}

#nationInfo #warList li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.war-status {
    font-size: 14px;
    margin-bottom: 6px;
}

.casualties-btn {
    background-color: #5a5a5a;
    color: white;
    border: none;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.casualties-btn:hover {
    background-color: #717171;
}

.casualties-details {
    background-color: rgba(0,0,0,0.25);
    padding: 10px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 13px;
}

.casualties-details.hidden {
    display: none;
}

.casualties-details p {
    margin: 5px 0;
}

.casualties-details strong {
    color: #b0b0b0;
    display: inline-block;
    width: auto;
}

#nationInfo #warList li {
    margin-bottom: 5px;
}

#notificationContainer {
    position: absolute;
    /* Position is now adjusted by JS to sit above the filter controls */
    bottom: 80px; 
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    pointer-events: none;
    transition: bottom 0.3s;
}

.notification {
    background-color: rgba(20, 20, 20, 0.85);
    color: #f1f1f1;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-left: 4px solid #008CBA;
    animation: fadeInOut 5s forwards;
    white-space: nowrap;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

#toggleNotifButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #888;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#toggleNotifButton.on {
    background-color: #4CAF50;
}

#toggleNotifButton.off {
    background-color: #b71c1c;
}

#optionsPanel {
    position: absolute;
    top: 70px; /* Below controls */
    left: 10px;
    background-color: rgba(40, 40, 40, 0.9);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 20;
    width: 280px;
    border: 1px solid #555;
    font-size: 15px;
    transition: opacity 0.2s, transform 0.2s;
}

#optionsPanel.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#optionsPanel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #FF9800; /* Orange to match speed button theme */
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    font-size: 18px;
}

.option-item {
    margin-bottom: 15px;
}

.option-item label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
}

.option-item input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.option-item input[type="number"] {
    width: 80px;
    padding: 5px;
    background-color: #333;
    border: 1px solid #666;
    color: white;
    border-radius: 4px;
    font-size: 14px;
}

#closeOptions {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

#closeOptions:hover {
    color: white;
}

.options-hint {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    text-align: center;
    font-style: italic;
}

#shipInfo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(40, 40, 40, 0.9);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 20;
    width: 250px;
    border: 1px solid #555;
    font-size: 15px;
    transition: opacity 0.2s, transform 0.2s;
}

#shipInfo.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#shipInfo h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #00BFFF; /* light blue for ships */
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    font-size: 18px;
}

#shipInfo p {
    margin: 8px 0;
}

#shipInfo strong {
    color: #b0b0b0;
    display: inline-block;
    width: 110px;
}

#closeShipInfo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

#closeShipInfo:hover {
    color: white;
}

#notificationOptions {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 101;
    display: flex;
    flex-direction: column-reverse; /* Button is visually below the panel */
    align-items: flex-start;
    gap: 10px;
}

#toggleNotifOptionsButton {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
}

#toggleNotifOptionsButton:hover {
    background-color: #546E7A;
}

#notifCheckboxes {
    background-color: rgba(40, 40, 40, 0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 1px solid #555;
    width: 200px;
}

#notifCheckboxes.hidden {
    display: none;
}

#notifCheckboxes h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #FF9800;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    font-size: 16px;
}

.option-item-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.option-item-checkbox:last-child {
    margin-bottom: 0;
}

.option-item-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option-item-checkbox label {
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}