:root {
    --ui-accent: #FFD400;
    --ui-accent-hover: #FFE066;
    --ui-accent-dark: #D4A200;
    --ui-accent-bg: #332a00;
    --ui-danger-accent: #C1121F;
    --walker-hair: #FFD400;
    --walker-shirt: #C1121F;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
    touch-action: none;
}

body {
    margin: 0;
    min-height: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: #111;
    color: #fff;
    font-family: monospace;
    overscroll-behavior: none;
    touch-action: none;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

input, select {
    user-select: auto; /* Zorg dat je in de editor nog wel waardes kan typen/selecteren */
    -webkit-user-select: auto;
}

#main-menu-overlay {
    position: absolute;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.94);
    color: #fff;
    font-family: monospace;
    overflow-y: auto;
}

.main-menu-card {
    width: min(440px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    box-sizing: border-box;
    background: #181818;
    border: 3px solid #555;
    border-top-color: #777;
    border-left-color: #777;
    box-shadow: 0 10px 0 #050505, 0 0 0 1px #111;
    overflow-y: auto;
}

.main-menu-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.main-menu-walker {
    width: 64px;
    height: 112px;
    margin-bottom: 2px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='28' viewBox='0 0 32 28'%3E%3Cstyle%3E.h%7Bfill:%23FFD400%7D.f%7Bfill:%23ffdab9%7D.b%7Bfill:%23C1121F%7D.w%7Bfill:%23fff%7D%3C/style%3E%3Cpath class='h' d='M4,14h5v3H4zM4,17h3v4H4zM20,14h5v3H20zM20,17h3v4H20z'/%3E%3Cpath class='f' d='M7,17h3v3H7zM23,17h3v3H23z'/%3E%3Cpath class='b' d='M5,20h5v5H5zM4,25h2v2H4zM8,25h2v2H8zM21,20h5v5H21zM22,25h2v2H22z'/%3E%3Cpath class='w' d='M4,27h2v1H4zM8,27h2v1H8zM8,21h2v2H8zM22,27h2v1H22zM20,21h2v2H20z'/%3E%3C/svg%3E");
    background-size: 128px 112px;
    background-repeat: no-repeat;
    background-position: 0px 0px;
    image-rendering: pixelated;
    animation: menu-walker-anim 0.6s steps(2) infinite;
}

@keyframes menu-walker-anim {
    0% { background-position: 0px 0px; }
    100% { background-position: -128px 0px; }
}

.main-menu-title {
    margin: 0;
    color: var(--ui-accent);
    font-size: 34px;
    line-height: 1;
    font-weight: bold;
    text-transform: uppercase;
}

.main-menu-subtitle {
    margin: 0;
    color: #aaa;
    font-size: 12px;
    line-height: 1.3;
}

.main-menu-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--ui-accent-dark), var(--ui-accent), var(--ui-accent-dark), transparent);
    flex: 0 0 auto;
}

.main-menu-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    text-align: center;
}

.main-menu-section-title {
    margin: 0;
    color: #eee;
    font-size: 15px;
    line-height: 1.2;
    font-weight: bold;
    text-transform: uppercase;
}

#level-select {
    width: 100%;
    height: 34px;
    padding: 4px 8px;
    box-sizing: border-box;
    background: #262626;
    color: #fff;
    border: 2px solid var(--ui-accent-dark);
    border-radius: 3px;
    font-family: monospace;
    font-size: 15px;
    cursor: pointer;
}

.main-menu-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.main-menu-primary-btn,
.main-menu-secondary-btn,
.main-menu-danger-btn {
    min-height: 34px;
    padding: 7px 14px;
    box-sizing: border-box;
    border-radius: 3px;
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
}

.main-menu-primary-btn {
    background: var(--ui-accent-bg);
    border: 2px solid var(--ui-accent);
}

.main-menu-secondary-btn {
    background: #24364f;
    border: 2px solid #668cff;
    font-size: 13px;
}

.main-menu-danger-btn {
    align-self: center;
    min-height: 28px;
    padding: 5px 10px;
    background: #3a1111;
    border: 1px solid #c33;
    color: #f5cccc;
    font-size: 12px;
}

.main-menu-primary-btn:hover,
.main-menu-secondary-btn:hover,
.main-menu-danger-btn:hover {
    filter: brightness(1.18);
}

.main-menu-file-input {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 6px 8px;
    background: #121212;
    border: 1px solid #333;
    border-radius: 3px;
    color: #bbb;
    font-size: 12px;
    text-align: left;
}

.main-menu-file-input span {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
}

.main-menu-file-input input {
    width: 100%;
    color: #aaa;
    font-family: monospace;
    font-size: 11px;
}

.main-menu-file-input input::file-selector-button {
    margin-right: 8px;
    padding: 4px 9px;
    background: #242424;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
}

.main-menu-file-input input::file-selector-button:hover {
    background: #303030;
    border-color: #0a0;
    color: #fff;
}

@media (max-width: 480px) {
    .main-menu-card {
        padding: 14px;
        gap: 9px;
    }

    .main-menu-walker {
        width: 48px;
        height: 84px;
        background-size: 96px 84px;
        animation: menu-walker-anim-mob 0.6s steps(2) infinite;
    }
    @keyframes menu-walker-anim-mob {
        0% { background-position: 0px 0px; }
        100% { background-position: -96px 0px; }
    }

    .main-menu-title {
        font-size: 28px;
    }

    .main-menu-actions {
        flex-direction: column;
    }

    .main-menu-primary-btn,
    .main-menu-secondary-btn {
        width: 100%;
    }
}

#game-container {
    position: relative;
    display: flex; /* Maak dit een flex-container om de kinderen te beheren */
    flex-direction: column;
    justify-content: center; /* Centreer alles verticaal op hele hoge schermen */
    flex-grow: 1; /* Laat de container meegroeien */
    min-height: 0; /* Essentieel om kinderen correct te laten krimpen */
}

#game-viewport {
    flex: 0 1 auto;
    width: 100%;
    height: calc(50dvh + 6px);
    min-height: 320px;
    max-height: 410px;
    border: 4px solid #555;
    background: #000;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    touch-action: none;
    overscroll-behavior: none;
}

@media (max-width: 768px) {
    #game-viewport {
        height: calc(48dvh + 6px);
        min-height: 340px;
        max-height: 410px;
    }
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none;
    image-rendering: pixelated;
    touch-action: none;
    -webkit-touch-callout: none;
}

#game-canvas.grab {
    touch-action: none;
}

#ui-panel {
    background-color: #222;
    padding: 5px 10px 10px 10px; /* Bovenkant strakker onder de scrollbar */
    display: flex;
    flex-direction: column;
    gap: 6px; /* Iets minder tussenruimte voor een compacter paneel */
    border-top: 4px solid #555;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#info-panel {
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#stats {
    display: flex;
    flex-wrap: wrap; /* Laat stats naar volgende regel springen op smalle schermen */
    justify-content: center;
    gap: 15px; /* Iets compactere tussenruimte */
    font-weight: bold;
    color: var(--ui-accent);
    font-size: 14px; /* Iets compacter lettertype */
}

#skills-panel {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    flex-grow: 1;
}

.skill-btn {
    background-color: #222;
    color: #fff;
    border: 2px solid #444;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 32px; /* Kan krimpen tot de breedte van het icoontje */
    flex: 1 1 0; /* Laat de knoppen schalen als de rij te smal wordt */
    height: auto;
    min-height: 88px;
    gap: 4px;
}

#actions-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    background: #111;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #333;
}

.skill-btn:hover { background-color: #444; }
.skill-btn.selected { background-color: var(--ui-accent-bg); border-color: var(--ui-accent); }

.skill-icon {
    width: 32px;
    height: 56px;
    background-size: 256px 672px; /* Opschaling van het 128x336 sprite-vel */
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
}

.icon-climber { background-position: 0px -448px; }
.icon-floater { background-position: 0px -112px; }
.icon-bomber  { background-position: 0px -616px; } /* Gebruikt unieke UI Iconen rij (11) */
.icon-blocker { background-position: 0px -168px; }
.icon-builder { background-position: 0px -280px; }
.icon-basher  { background-position: 0px -336px; }
.icon-miner   { background-position: -64px -392px; } /* Frame offset naar moment dat pikhouweel omhoog staat! */
.icon-digger  { background-position: 0px -224px; }
.icon-nuke    { background-position: -32px -616px; } /* Frame 2 van de UI ICONS (Rij 11) */
.icon-width   { background-position: -64px -616px; } /* Frame 3 */
.icon-lemmings{ background-position: -96px -616px; } /* Frame 4 */
.icon-rate    { background-position: -128px -616px; } /* Frame 5 */
.icon-time    { background-position: -160px -616px; } /* Frame 6 */
.icon-target  { background-position: -192px -616px; } /* Frame 7 */

.skill-count {
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

#controls-panel {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    align-items: flex-start;
    flex-grow: 1; /* Laat het paneel meerekt als hij naar regel 2 zakt */
}

#controls-panel > * {
    min-height: 88px;
    box-sizing: border-box;
    min-width: 32px; /* Kan krimpen zodat het niet langer de Desktop Resize blokkeert! */
    flex: 1 1 0;
}

#controls-panel button {
    background-color: #333;
    color: #fff;
    border: 2px solid #555;
    cursor: pointer;
    font-family: monospace;
    border-radius: 4px;
}

#controls-panel button:hover { background-color: #555; }

#btn-nuke {
    background-color: #311;
    color: #fff;
    border: 2px solid #822;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    flex: 1 1 0;
    height: auto;
    min-height: 88px;
    gap: 4px;
}
#btn-nuke:hover { background-color: #511; border-color: #f00; }

#btn-fast-forward, #btn-pause, #btn-restart, #btn-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-size: 12px;
    flex: 0.3 1 0; /* Extreem smal, zodat RATE maximale ruimte op eist */
}

#btn-action {
    display: none; /* Standaard verborgen */
    width: 100%;
    padding: 12px;
    color: #FFF;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 10;
    margin-bottom: 5px;
    touch-action: manipulation;
}

/* Toon de actieknop op ALLE apparaten met een touchscreen (telefoons én tablets) */
@media (pointer: coarse) {
    #btn-action {
        display: block;
        background-color: var(--ui-accent-bg) !important;
        border-color: var(--ui-accent) !important;
        color: #FFF !important;
    }
}

.control-widget {
    flex: 4 1 0; /* Nóg hogere prioriteit om sliders breed en bruikbaar te houden */
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    background: #222;
    padding: 0 4px;
    border-radius: 4px;
    border: 1px solid #444;
}

/* Media Query voor kleinere schermen om de UI knoppen compacter te maken */
@media (max-height: 750px), (max-width: 640px) {
    #actions-container {
        gap: 2px;
        padding: 2px;
    }
    #skills-panel, #controls-panel {
        gap: 2px; /* Krimp de tussenruimtes tussen knoppen om ruimte te besparen */
    }
    #info-panel {
        padding: 4px;
    }
    #stats {
        font-size: 12px;
        gap: 8px;
    }
    #info-bar {
        font-size: 12px;
    }
    .skill-btn, #btn-nuke {
        min-height: 65px; /* Maak knoppen minder hoog */
        min-width: 24px; /* Exacte breedte van het verkleinde icoontje */
        padding: 0; /* Verwijder alle padding om ruimte te winnen */
        border-width: 1px; /* Een dunnere rand wint 18 pixels over 9 knoppen! */
        gap: 2px;
    }
    .skill-icon {
        width: 24px; /* Verklein de icoontjes */
        height: 42px;
        background-size: 192px 504px; /* 0.75x schaling van de spritesheet */
    }
    .editor-input-card .skill-icon {
        width: 32px !important;
        height: 56px !important;
        min-width: 32px !important;
        min-height: 56px !important;
        max-width: 32px !important;
        max-height: 56px !important;
        background-size: 256px 672px !important;
        flex: 0 0 56px !important;
    }
    .skill-count, #btn-nuke span { font-size: 12px; } /* Kleinere tekst */
    #controls-panel > * { min-height: 65px; padding: 2px; } /* Match hoogte van de control knoppen */
    #btn-fast-forward, #btn-pause, #btn-restart, #btn-menu { font-size: 9px; } /* Maak knop-tekst kleiner op mobiel */
    #btn-minus, #btn-plus { padding: 2px 4px !important; }
    #release-rate { font-size: 12px !important; width: 14px !important; }
    #volume-slider { width: 35px !important; }

    /* Aangepaste posities voor de verkleinde iconen */
    .skill-btn .icon-climber { background-position: 0px -336px; }
    .skill-btn .icon-floater { background-position: 0px -84px; }
    .skill-btn .icon-bomber  { background-position: 0px -462px; }
    .skill-btn .icon-blocker { background-position: 0px -126px; }
    .skill-btn .icon-builder { background-position: 0px -210px; }
    .skill-btn .icon-basher  { background-position: 0px -252px; }
    .skill-btn .icon-miner   { background-position: -48px -294px; }
    .skill-btn .icon-digger  { background-position: 0px -168px; }
    #btn-nuke .icon-nuke     { background-position: -24px -462px; }

    .editor-tabbar button {
        padding: 3px 8px;
        font-size: 11px;
        min-height: 30px;
    }
    
    .editor-tool-card,
    .editor-input-card {
        min-width: 42px !important;
        max-width: 72px !important;
        height: 120px !important;
        min-height: 120px !important;
        padding: 6px 4px !important;
        font-size: 9px !important;
    }
    .editor-texture-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 14px !important;
    }

    #terrain-image-panel .editor-btn[data-tool^="pick-"] {
        height: 64px !important;
        min-height: 64px !important;
        padding: 2px 5px !important;
        gap: 2px !important;
        font-size: 10px !important;
        line-height: 1.1 !important;
    }

    #terrain-image-panel .editor-btn[data-tool^="pick-"] .editor-texture-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 10px !important;
    }
}

#editor-top-panel,
#editor-panel {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    flex-shrink: 0;
    overflow: visible;
}

body.editor-mode #game-container {
    justify-content: flex-start;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

@media (pointer: fine) {
    body.editor-mode {
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    body.editor-mode #game-container {
        overflow-y: visible;
    }
}

body.editor-mode #game-viewport {
    height: 408px;
    min-height: 408px;
    max-height: 408px;
    flex: 0 0 auto;
}

body.editor-mode #custom-scrollbar {
    display: block !important;
    visibility: visible !important;
    flex: 0 0 24px;
}

body.editor-mode #editor-top-panel {
    margin-top: 0;
}

body:not(.editor-mode) #game-container {
    overflow: hidden;
}

#editor-panel {
    background-color: #222;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 4px solid #555;
}

.editor-btn {
    background-color: #444;
    color: #fff;
    border: 2px solid #777;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.1s ease-in-out;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.editor-btn:hover { background-color: #666; }

.editor-btn.selected { 
    color: #FFF !important;
    background-color: var(--ui-accent-bg) !important; 
    border-color: var(--ui-accent) !important; 
}

.editor-history-btn {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 11px;
}

.editor-history-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.editor-history-danger-btn {
    background: #3a1111;
    border-color: #b33;
    color: #f5cccc;
}

/* --- EDITOR UI POLISH --- */
.editor-section-title {
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    margin: 0 0 2px 0;
}

.editor-section-subtitle {
    color: #888;
    text-align: center;
    font-size: 10px;
    margin: 0 0 8px 0;
}

.editor-tabbar {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.editor-tabbar::-webkit-scrollbar {
    display: none;
}

.editor-tab-button {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    margin: 0;
}

.editor-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #333; /* Behoud gewone border */
    border-top: none; /* Verwijder groene lijn uit onderste editor-cards */
    border-radius: 4px;
    padding: 8px;
    box-sizing: border-box;
    width: 100%;
}

.editor-card-title {
    font-size: 10px;
    color: #888;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 2px;
}

#editor-bottom-tab-brushes,
#editor-bottom-tab-objects,
#editor-bottom-tab-config,
#editor-bottom-tab-skills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    padding-top: 0;
    margin-top: 0;
}

.editor-card-grid,
.editor-tool-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    overflow: hidden;
}

#editor-bottom-tab-brushes .editor-card,
#editor-bottom-tab-objects .editor-card,
#editor-bottom-tab-config .editor-card,
#editor-bottom-tab-skills .editor-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* --- TOOL CARDS & TEXTURES --- */
.editor-global-settings {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    background: #1a1a1a;
    padding: 6px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 5px;
}

.editor-tool-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 4px;
    background-color: #222;
    border: 2px solid #444;
    cursor: pointer;
    font-family: monospace;
    font-size: 10px;
    text-align: center;
    transition: all 0.1s ease-in-out;
    box-sizing: border-box;
}


/* Alle editor cards even hoog en schaalbaar */
.editor-card-grid .editor-tool-card,
.editor-tool-grid .editor-input-card {
    flex: 1 1 0;
    min-width: 46px;
    max-width: 82px;
    width: auto;
    height: 120px;
    min-height: 120px;
    padding: 8px 5px;
    box-sizing: border-box;
    overflow: hidden;
}

.editor-tool-card:hover { background-color: #444; }
.editor-tool-card.selected { 
    background-color: var(--ui-accent-bg) !important; 
    border-color: var(--ui-accent) !important; 
}

.editor-texture-icon {
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.1s ease;
}

.editor-tool-card span {
    font-size: 9px;
    opacity: 0.85;
}

.editor-input-card .skill-icon {
    width: 32px;
    height: 56px;
    min-width: 32px;
    min-height: 56px;
    max-width: 32px;
    max-height: 56px;
    background-size: 256px 672px;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
    flex: 0 0 56px;
    overflow: hidden;
    transform: none !important;
}

.editor-input-label,
.editor-tool-card span {
    font-size: 9px;
    line-height: 1;
    max-width: 100%;
    white-space: nowrap; /* Voorkom wrapping */
    overflow: hidden; /* Verberg overlopende tekst */
    text-overflow: ellipsis; /* Voeg puntjes toe */
}

.editor-tool-card:hover .editor-texture-icon {
    transform: scale(1.1);
}

#terrain-image-panel .editor-card-grid {
    gap: 2px;
}

#terrain-image-panel .editor-btn[data-tool^="pick-"] {
    height: 68px;
    min-height: 68px;
    padding: 2px 6px;
    gap: 3px;
    font-size: 11px;
    line-height: 1.1;
}

#terrain-image-panel .editor-btn[data-tool^="pick-"] .editor-texture-icon {
    width: 34px;
    height: 34px;
    font-size: 11px;
}

#terrain-image-panel .editor-btn[data-tool="pan-terrain"] {
    min-height: 24px;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.1;
}

/* CSS representation of canvas patterns */
.tex-earth {
    background-color: #8B4513;
    background-image: radial-gradient(#A0522D 15%, transparent 16%), radial-gradient(#654321 15%, transparent 16%);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
}
.tex-metal {
    background-color: #888;
    border: 2px solid #aaa;
    border-bottom-color: #555;
    border-right-color: #555;
    background-image: radial-gradient(#aaa 15%, transparent 16%);
    background-size: 16px 16px;
    box-sizing: border-box;
}
.tex-water {
    background-color: #00F;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, #0000F6 2px, #0000F6 4px);
}
.tex-ice {
    background-color: #0FF;
    border-top: 2px solid rgba(255,255,255,0.8);
    box-sizing: border-box;
}
.tex-oneway-left { background-color: #963232; }
.tex-oneway-right { background-color: #323296; }
.tex-erase { background: repeating-conic-gradient(#555 0% 25%, #222 0% 50%) 50% / 10px 10px; }
.tex-object { background-color: #111; border: 1px solid #333; }

/* --- GAMEWORLD OBJECT STYLES --- */
.editor-object-icon {
    position: relative;
    box-sizing: border-box;
}

.obj-entrance {
    background-color: #222;
    border: 4px solid #444;
    border-top-color: #666;
}
.obj-entrance::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 4px;
    background-color: #8B4513; /* Houten valklep */
}

.obj-exit {
    background-color: #444;
    border: 4px solid #666;
}
.obj-exit::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 14px; height: 14px;
    border-radius: 50%;
    background-color: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 6px #0F0;
}

.obj-fire {
    background: linear-gradient(to top, #FF4500 20%, #FFFF00 90%);
    border-bottom: 4px solid #FFFF00;
}

.obj-smasher {
    background-color: #888;
    border: 4px solid #333;
    border-bottom: 6px solid #DDDD00; /* Gevaarstrepen randje */
}

.obj-erase-trap {
    background: 
        linear-gradient(45deg, transparent 40%, #F00 40%, #F00 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, #F00 40%, #F00 60%, transparent 60%);
    border: 2px solid #F00;
}

/* --- EDITOR INPUT CARDS --- */
.editor-input-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    border-radius: 4px;
    background-color: #222;
    border: 2px solid #444;
    color: #fff; /* Basiskleur voor tekst in de kaart */
    cursor: pointer; /* Zodat de hele kaart klikbaar voelt */
}
.editor-input-card .editor-skill-input {
    width: 42px;
    height: 22px;
    min-height: 22px;
    flex: 0 0 22px;
    font-size: 11px;
    padding: 1px 2px;
    box-sizing: border-box;
    /* Overige stijlen overgenomen van de algemene .editor-skill-input */
    background: #111;
    color: #FFF;
    border: 1px solid #555;
    text-align: center;
    border-radius: 3px;
    font-family: monospace;
}
.editor-input-card .editor-skill-input:focus { border-color: var(--ui-accent); outline: none; }

.editor-input-card.wide-input .editor-skill-input {
    width: 56px; /* Aangepaste breedte voor 'Breedte' input */
}

.editor-input-card .editor-input-label {
    display: block;
    height: 12px;
    min-height: 12px;
    line-height: 12px;
    flex: 0 0 12px;
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Losse editor input buiten cards */
select#edit-grid {
    background: #222;
    color: #FFF;
    border: 1px solid #555;
    text-align: center;
    border-radius: 3px;
    padding: 2px;
    font-family: monospace;
    font-size: 12px;
    height: 24px;
    min-height: 24px;
    box-sizing: border-box;
    width: auto;
}

.editor-skill-input {
    background: #222;
    color: #FFF;
    border: 1px solid #555;
    text-align: center;
    border-radius: 3px;
    padding: 2px;
    font-family: monospace;
    font-size: 12px;
    box-sizing: border-box;
}

/* Kleine UX verbetering (optioneel maar nice) */
.editor-input-card input {
    text-align: center;
}

input.editor-skill-input:focus,
select#edit-grid:focus { border-color: var(--ui-accent); outline: none; }

.editor-input-card .editor-skill-input {
    width: 42px;
    height: 22px;
    min-height: 22px;
    flex: 0 0 22px;
    font-size: 11px;
    padding: 1px 2px;
}

.editor-input-card.wide-input .editor-skill-input {
    width: 56px;
}
