@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0d0d0d;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #1f1f1f 0%, #2d2d2d 100%);
    font-size: 1.5rem;
    overflow-x: hidden;
}

header {
    width: 100%;
    padding: 15px 0;
    text-align: center;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 2.5rem;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

header .highlight {
    color: #fcb045;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 1800px;
    margin: 20px auto;
    animation: fadeIn 2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.content-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.left-column, .right-column {
    width: 48%;
    display: flex;
    flex-direction: column;
}

img#screen-image {
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid;
    border-image: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045) 1;
    border-image-slice: 1;
    transition: box-shadow 0.3s ease-in-out;
    border-radius: 0;
    margin-bottom: 20px; /* Add spacing below the screen */
}

#key-presses {
    background-color: #292929;
    padding: 20px;
}

#goals, #game-log, #strategy, #closest-examples {
    background-color: #292929;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid;
    border-image: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045) 1;
    border-image-slice: 1;
    margin-bottom: 20px;
}

#keys {
    display: grid;
    grid-template-areas: 
        ". up . . ."
        "left . right a b"
        ". down . . start";
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.key {
    padding: 15px 30px;
    border-radius: 12px;
    margin: 8px;
    background-color: #555;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    color: #ffffff;
    font-size: 1.25rem;
}

.key.pressed {
    background: linear-gradient(135deg, #fcb045 0%, #fd1d1d 100%) !important;
    transform: scale(1.3);
}

#key-up { grid-area: up; }
#key-down { grid-area: down; }
#key-left { grid-area: left; }
#key-right { grid-area: right; }
#key-a { grid-area: a; }
#key-b { grid-area: b; }
#key-start { grid-area: start; }

.goal-list {
    list-style-type: none;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.goal-list li {
    margin: 10px 0;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 1.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    gap: 25px;
}

#terminal-goals .goal-list li {
    background-color: #fcb045; /* Darker Orange */
}

#instrumental-goals .goal-list li {
    background-color: #fd1d1d; /* Darker Yellow */
}

#completed-goals .goal-list li {
    background-color: #888; /* Grey */
    color: #fff;
}

.goal-list li::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: inherit;
}

.goal-list li.completed {
    text-decoration: line-through;
    color: #888;
}

.goal-list li.completed::before {
    background: #888;
}

#terminal-goals {
    margin-bottom: 20px;
}

#terminal-goals h2 {
    color: #fcb045; 
}

#instrumental-goals h2 {
    color: #fd1d1d; 
}

#game-log {
    margin-top: 20px;
}

#game-log-content {
    max-height: 200px;
    overflow-y: auto;
}

#game-log-list {
    list-style-type: none;
    padding: 0;
}

#game-log-list li {
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 1.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.carousel {
    overflow: hidden;
    width: 80%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel img {
    max-width: 100px;
    margin: 0 5px;
    cursor: pointer;
}

.carousel-button {
    background-color: #333;
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
}

.carousel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.modal-prompt {
    font-size: 1.25rem;
    font-family: monospace;
    color: #333;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

h2 {
    margin-top: 0px;
    font-size: 1.5rem;
}

#closest-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

#closest-examples-grid img {
    width: 100%;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.section-header {
    cursor: pointer;
    user-select: none;
}

.hidden {
    display: none;
}

.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 18px;
    color: #555;
    position: relative;
}

.loading-indicator::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-top: 2px solid #e67e22; 
    border-right: 2px solid transparent;
    animation: spinner 1s linear infinite;
}

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

#screen-image-container {
    position: relative;
    display: inline-block;
}

#screen-image {
    width: 100%;
    height: auto;
}

.surrounding-info {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px;
    border-radius: 5px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#surround-up {
    top: 5%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#surround-down {
    bottom: 5%; 
    left: 50%;
    transform: translate(-50%, 50%);
}

#surround-left {
    top: 50%;
    left: 5%; 
    transform: translate(-50%, -50%);
}

#surround-right {
    top: 50%;
    right: 5%; 
    transform: translate(50%, -50%);
}
