* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #0b0b0b;
    color: #f2f2f2;
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

.game-shell {
    max-width: 1350px;
    margin: 0 auto;
    padding: 20px;
}

/* TOP BAR */

.top-bar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    background: #151515;
    border: 1px solid #333;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.top-bar h1 {
    margin: 0;
    font-size: 28px;
}

.top-bar p {
    margin: 4px 0 0;
    color: #aaa;
}

.save-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* BUTTONS */

button,
.import-label {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 11px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

button:hover,
.import-label:hover {
    background: #505050;
}

.import-label {
    display: inline-block;
}

.import-label input {
    display: none;
}

/* WORLD GENERATOR */

.generator-panel {
    background: #121212;
    border: 1px solid #333;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}

#worldInput {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    background: #1d1d1d;
    color: white;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    margin-bottom: 12px;
}

/* EMPTY STATE */

.empty-state {
    background: #151515;
    border: 1px solid #333;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #bbb;
}

/* MAIN GAME LAYOUT */

.game-output {
    margin-bottom: 24px;
}

.game-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 18px;
    align-items: start;
}

.scene-image-panel,
.current-scene-panel,
.tabs-panel {
    background: #161616;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 18px;
}

/* IMAGE PANEL */

.scene-image-panel {
    min-height: 560px;
}

.scene-image-panel h2,
.current-scene-panel h2 {
    margin-top: 0;
}

.scene-image-box {
    height: 485px;
    border: 2px dashed #444;
    border-radius: 12px;
    background:
        radial-gradient(circle at center, #222 0%, #101010 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #aaa;
    padding: 20px;
}

/* CURRENT SCENE */

.current-scene-panel {
    min-height: 560px;
}

.scene-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #bbb;
    font-size: 14px;
    margin-bottom: 14px;
}

.scene-meta span {
    background: #222;
    border: 1px solid #333;
    padding: 6px 10px;
    border-radius: 999px;
}

.scene-text {
    font-size: 18px;
    line-height: 1.6;
    max-width: 75ch;
    white-space: normal;
    margin-bottom: 16px;
}

.scene-result {
    margin-top: 12px;
    padding: 12px;
    background: #111;
    border-left: 4px solid #777;
    border-radius: 8px;
}

/* CHOICES INSIDE SCENE PANEL */

.choices-inside-scene {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #333;
}

.choices-inside-scene h2 {
    margin-bottom: 12px;
}

#choiceButtons {
    display: grid;
    gap: 10px;
}

#choiceButtons button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: #252525;
    border-radius: 10px;
    font-size: 15px;
}

#choiceButtons button:hover {
    background: #3a3a3a;
}

/* CUSTOM ACTION INSIDE CHOICES */

.custom-action-row {
    display: flex;
    gap: 10px;
}

.inline-action {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #333;
}

#customAction {
    flex: 1;
    background: #1d1d1d;
    color: white;
    border: 1px solid #444;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
}

.custom-action-row button {
    min-width: 130px;
}

/* OLD ACTION BAR DISABLED */

.action-bar {
    display: none !important;
}

/* TABS */

.tabs-panel {
    margin-top: 18px;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-buttons button {
    background: #222;
}

.tab-buttons button.active {
    background: #555;
    border-color: #888;
}

.tab-content {
    background: #101010;
    border: 1px solid #2c2c2c;
    padding: 16px;
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.tab-content p {
    margin: 10px 0;
}

.log-entry {
    border-bottom: 1px solid #333;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.log-entry:last-child {
    border-bottom: none;
}

.art-prompt-text {
    font-style: italic;
    color: #ccc;
}

/* RESPONSIVE */

@media (max-width: 1050px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .scene-image-panel,
    .current-scene-panel {
        min-height: auto;
    }

    .scene-image-box {
        height: 320px;
    }
}

@media (max-width: 700px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .save-buttons {
        justify-content: flex-start;
    }

    .custom-action-row {
        flex-direction: column;
    }

    .custom-action-row button {
        width: 100%;
    }
}
/* FIX UPLOADED SCENE IMAGE SIZE */

.scene-image-box {
    width: 100%;
    height: 485px;
    overflow: hidden;
    position: relative;
}

.scene-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.scene-image-placeholder {
    width: 100%;
    height: 100%;
    border: 2px dashed #444;
    border-radius: 12px;
    background: radial-gradient(circle at center, #222 0%, #101010 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    text-align: center;
    padding: 20px;
}

.scene-image-controls {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.scene-image-controls button {
    flex: 1;
    min-width: 150px;
}

/* Match the new script names */
.scene-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.scene-stat-pill {
    background: #222;
    border: 1px solid #333;
    padding: 6px 10px;
    border-radius: 999px;
    color: #bbb;
    font-size: 14px;
}

.scene-text-box {
    font-size: 18px;
    line-height: 1.6;
    max-width: 75ch;
    margin-bottom: 16px;
}

.tab-content-card {
    background: #101010;
    border: 1px solid #2c2c2c;
    padding: 16px;
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.tab-button.active {
    background: #555;
    border-color: #888;
}

.choice-button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: #252525;
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 10px;
}

.choice-button:hover {
    background: #3a3a3a;
}
.scene-image-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}