html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
}

#left-column {
    width: 400px;
    height: 100%;
    background: #1e1e1e;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

header {
    font-weight: 600;
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    height: 24px;
    width: 24px;
    transition: transform 0.25s;
}

header a:hover {
    transform: rotate(15deg);
}

#right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#game-container {
    flex: 1;
    position: relative;
    background-color: #222;
}

#game-canvas {
    width: 100%;
    height: 100%;
    border: 1px solid #555;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

#cheatsheet-container {
    height: 300px;
    position: relative;
    background-color: #222;
}

#viewer-canvas {
    width: 100%;
    height: 100%;
    border: 1px solid #555;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
    cursor: grab;
}

#viewer-canvas:active {
    cursor: grabbing;
}

#left-column label {
    display: block;
    margin: 10px 0 5px;
}

#left-column input,
#left-column textarea,
#left-column button {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
    background: #333;
    color: #fff;
    border: 1px solid #555;
}

#left-column button {
    background: #2a6d2d;
    color: white;
    border: none;
    cursor: pointer;
}

#left-column button:hover {
    background: #19411b;
}

#left-column button:disabled {
    background: #555;
    cursor: not-allowed;
}

#left-column button:disabled:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    transform: translateY(-100%);
    white-space: nowrap;
}

#record-button.recording {
    background: #ff0000;
}

#record-button.recording:hover {
    background: #cc0000;
}

#spritesheet-dimensions {
    font-size: 12px;
    margin: 0;
    padding: 6px;
    color: #ddd;
    background-color: #00000054;
    text-align: right;
    position: absolute;
    bottom: 6px;
    right: 0;
    opacity: 0;
}

h2 {
    margin-top: 0;
}

#frame-delays-container {
    display: flex;
    gap: 10px;
}

#frame-delays-container .frame-delay-input {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#frame-delays-container .frame-delay-input label {
    font-size: 12px;
    margin-bottom: 5px;
    margin-top: 0;
}

#frame-delays-container .frame-delay-input input {
    padding: 6px;
    margin-bottom: 0;
}

.side-buttons {
    display: flex;
    flex-direction: row;
}

#image-input-container {
    display: flex;
    gap: 5px;
    position: relative;
}

#image-input-container input[type="text"] {
    flex: 1;
    padding-right: 28px; /* Space for the X */
}

#image-input-container button {
    width: auto;
    padding: 8px 16px;
    margin-bottom: 0;
}

#clear-image-x {
    display: none;
    position: absolute;
    right: 8px; /* Position inside the text input */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: rgba(182, 95, 95, 0.8); /* Semi-transparent red */
    color: white;
    text-align: center;
    line-height: 20px;
    border-radius: 10%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}

#clear-image-x:hover {
    background: rgb(133, 65, 65); /* Darker red on hover */
}

#recording-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background-color: red;
    border-radius: 50%;
    display: none;
    box-shadow: 0 0 10px rgba(255,0,0,0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

#modal video {
    max-width: 80%;
    max-height: 80%;
    border: 2px solid #fff;
}

#modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ff0000;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
}

#modal-close:hover {
    background: #cc0000;
}

#image-url-input-wrapper {
    position: relative;
    width: 70%;
}

#image-url-input-wrapper input#image-url {
    margin: 0;
}

label#row-config-label {
    margin-top: 20px;
}