body, html {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background-color: #f0f0f0;
    overflow: hidden; /* Hide overflow from the board */
}

#game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Ensure no scrollbars */
}

#game-window {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    position: absolute;
    background-color: #fff;
}

.tile {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #eaeaea;
    transition: all 0.5s ease;
    cursor: pointer;
    position: relative;
}

.debug-text {
    font-size: 12px; /* Small font for the debug text */
    position: absolute;
    top: 0;
    left: 0;
    text-align: left;
    white-space: nowrap;
    line-height: 1; /* Two lines: first row for X, second row for Y */
}

#player {
    position: absolute;
    width: 100%; /* The width and height will adjust to the tile size */
    height: 100%;
    background-color: transparent; /* Ensure the background is transparent */
    transition: all 0.5s ease; /* Smooth animation for size changes */
}

#player img {
    width: 100%; /* Always make the image fit the entire player */
    height: 100%; /* Adjust height to ensure it fills the container */
    object-fit: fill; /* Ensure the image stretches to cover both width and height */
}

#iframe-overlay {
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    border: 4px solid #666; /* Outer layer border */
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* Fancy shadow effect */
}

iframe {
    border: none; /* Remove default iframe border */
}

button {
    background-color: red;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1b7ed4;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.plane {
    width: 100px;
    height: 100px;
    background-image: url('./data/player.png'); /* Use a small cartoon-style plane image */
    background-size: cover;
    animation: flyAcross 3s infinite linear;
}

@keyframes flyAcross {
    0% {
        transform: translateX(0%);
    }
    25% {
        transform: translateX(100%) translateY(-30px) rotate(10deg);
    }
    50% {
        transform: translateX(0%) translateY(-60px);
    }
    75% {
        transform: translateX(-100%) translateY(-30px) rotate(-10deg);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#floating-map {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    height: 150px;
    z-index: 9000;
    border: 3px solid #666;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}

#floating-map img {
    width: 100%; /* Stretch to fill the container’s width */
    height: 100%; /* Stretch to fill the container’s height */
    object-fit: fill; /* Ensure the image completely fills the div */
}

#floating-map .player-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: green;
    box-shadow: 0 0 8px yellow, 0 0 12px yellow; /* Shining effect */
    animation: shine 0.5s infinite alternate;
    z-index: 9001;
}

.other-dot {
    position: absolute;
    border-radius: 50%;
    background-color: red;
    z-index: 9001;
}

@keyframes shine {
    0% {
        background-color: green;
        box-shadow: 0 0 8px yellow, 0 0 12px yellow;
    }
    100% {
        background-color: yellow;
        box-shadow: 0 0 12px green, 0 0 16px green;
    }
}

#navigator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    min-height: 50px;
    max-height: 480px;
    background-color: white;
    border: 4px solid #666; /* Outer layer border */
    border-radius: 10px;
    padding: 10px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* Fancy shadow effect */
}

#navigator-title {
    width: 100%;
    height: 50px; /* Adjust as needed for reduced size */
    overflow: hidden; /* Hide any overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Required for child positioning */
    border-radius: 5px;

    box-shadow: 
        2px 2px 0 #3e8e41,     /* 45-degree solid shadow */
        2px 2px 4px rgba(0,0,0,0.3); /* Blurred shadow in same direction */
}

#navigator-title:active {
    background-color: #3e8e41;
    box-shadow: 
      1px 1px 0 #3e8e41,
      1px 1px 2px rgba(0,0,0,0.3);
    transform: translate(1px, 1px); /* Button moves diagonally when pressed */
  }

#navigator-title img {
    width: auto; /* Maintain aspect ratio */
    height: 100%; /* Scale the image to the container’s height */
    object-fit: cover; /* Cover the area without stretching */
    object-position: center; /* Center the image within the container */
}


#navigator-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto; /* Allow scrolling if content overflows */
    max-height: 400px; /* Adjust as needed for your layout */
}

.navigator-section-title {
    margin: 2px 2px 0;
    color: #24594b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.navigator-button{
    width: 100%;
    height: 45px;
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(31, 115, 178, .16);
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.navigator-button:active {
    transform: translate(0px, 1px); /* Button moves diagonally when pressed */
}

.navigator-button-park {
    width: 100%;
    height: 45px;
    padding: 10px;
    background-color: #0e9f2e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(14, 159, 46, .16);
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.navigator-button-park:active {
    transform: translate(0px, 1px); /* Button moves diagonally when pressed */
}
.navigator-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(31, 115, 178, .24);
}

.navigator-button-park:hover {
    background-color: #087c25;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(14, 159, 46, .24);
}

.current-location {
    background-color: rgb(90, 111, 219);
    font-weight: bold;
    color: yellow;
    cursor: pointer;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0% {
        background-color: rgb(90, 111, 219);
    }
    50% {
        background-color: rgb(110, 130, 235);
    }
    100% {
        background-color: rgb(90, 111, 219);
    }
}

/* Keep your hover state */
.current-location:hover {
    animation: none; /* Stop blinking on hover */
    background-color: rgb(75, 93, 187); /* Darker blue on hover */
}

#arrival-panel {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: min(300px, calc(100vw - 32px));
    z-index: 9100;
    pointer-events: auto;
    color: #073b2e;
    background: rgba(255, 253, 247, .9);
    border: 2px solid rgba(6, 78, 59, .2);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
    backdrop-filter: blur(5px);
    animation: routeCardIn .42s ease both;
}

#arrival-panel:before {
    content: "";
    position: absolute;
    left: 18px;
    top: -12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 0 8px rgba(249, 115, 22, .18);
}

.arrival-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background: #073b2e;
    color: white;
    font-size: 18px;
    line-height: 1;
}

.arrival-kicker {
    display: block;
    margin-bottom: 6px;
    color: #0f766e;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#arrival-panel strong {
    display: block;
    margin-right: 28px;
    font-size: 22px;
    line-height: 1.05;
}

#arrival-panel p {
    margin: 9px 0 7px;
    color: #24594b;
    font-size: 14px;
    line-height: 1.32;
}

#arrival-panel small {
    display: block;
    color: #426459;
    line-height: 1.35;
}

.arrival-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.arrival-route,
.arrival-story {
    min-height: 36px;
    border-radius: 999px;
    padding: 0 13px;
    color: #073b2e;
    font-weight: 800;
}

.arrival-route {
    background: #f97316;
    color: #111827;
}

.arrival-story {
    background: #dcfce7;
}

.navigator-attention {
    animation: navigatorPulse 1.8s ease both;
}

@keyframes navigatorPulse {
    0%, 100% {
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(0);
    }
    25%, 65% {
        box-shadow: 0 0 0 8px rgba(249, 115, 22, .28), 0 18px 34px rgba(0, 0, 0, .2);
        transform: translateY(-2px);
    }
}

@keyframes routeCardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-cloud {
    pointer-events: none;
}

.switch-container {
    display: flex;
    justify-content: flex-end;
    margin: 1px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 25px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 8px;
    width: 8px;
    left: 1px;
    bottom: 1px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.history-icon {
    margin-right: 8px;
    font-size: 8px;
}
