.level-editor {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: calc(100vh - 100px);
}

.editor-sidebar {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    min-height: 0;
}

body:not(.page-create-level) .editor-sidebar {
    overflow-y: auto;
}

.editor-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.editor-section:last-child {
    border-bottom: none;
}

.editor-section h2 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
}

.tools-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.tools-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tools-group__label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    padding-left: 2px;
}

.tools-group__items {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    padding: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tools-group--chest {
    position: relative;
}

.tools-group__items--chest {
    flex-wrap: nowrap;
}

.tool-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 58px;
    max-width: 78px;
    padding: 6px 8px 5px;
    border: 2px solid transparent;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    font-family: inherit;
}

.tool-btn__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.tool-btn__label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.15;
    text-align: center;
}

.tool-btn:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.tool-btn:hover .tool-btn__label {
    color: #1e293b;
}

.tool-btn.active {
    border-color: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.tool-btn--start {
    color: #16a34a;
}

.tool-btn--start .tool-btn__icon {
    background: #dcfce7;
    color: #15803d;
}

.tool-btn--start.active {
    background: #f0fdf4;
}

.tool-btn--start.active .tool-btn__icon {
    background: #16a34a;
    color: #fff;
}

.tool-btn--finish {
    color: #dc2626;
}

.tool-btn--finish .tool-btn__icon {
    background: #fee2e2;
    color: #b91c1c;
}

.tool-btn--finish.active {
    background: #fef2f2;
}

.tool-btn--finish.active .tool-btn__icon {
    background: #dc2626;
    color: #fff;
}

.tool-btn--chest {
    color: #b45309;
}

.tool-btn--chest .tool-btn__icon {
    background: #fef3c7;
    color: #a16207;
}

.tool-btn--chest.active {
    background: #fffbeb;
}

.tool-btn--chest.active .tool-btn__icon {
    background: #d97706;
    color: #fff;
}

.tool-btn--campfire {
    color: #c2410c;
}

.tool-btn--campfire .tool-btn__icon {
    background: #ffedd5;
    color: #ea580c;
}

.tool-btn--campfire.active {
    background: #fff7ed;
}

.tool-btn--campfire.active .tool-btn__icon {
    background: #ea580c;
    color: #fff;
}

.tool-btn--flint {
    color: #1d4ed8;
}

.tool-btn--flint .tool-btn__icon--tile {
    background: #dbeafe;
    padding: 2px;
}

.tool-btn--flint .tool-btn__icon--tile img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tool-btn--flint.active {
    background: #eff6ff;
}

.tool-btn--flint.active .tool-btn__icon--tile {
    background: #2563eb;
    box-shadow: inset 0 0 0 2px #fff;
}

.tools-group--portal .tools-group__items--portal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.tool-btn--portal-in,
.tool-btn--portal-out {
    color: #6d28d9;
}

.tool-btn--portal-out {
    color: #0e7490;
}

.tool-btn--portal-in .tool-btn__icon--tile,
.tool-btn--portal-out .tool-btn__icon--tile {
    background: #f5f3ff;
    padding: 2px;
}

.tool-btn--portal-out .tool-btn__icon--tile {
    background: #ecfeff;
}

.tool-btn--portal-in .tool-btn__icon--tile img,
.tool-btn--portal-out .tool-btn__icon--tile img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tool-btn--portal-in.active {
    background: #f5f3ff;
}

.tool-btn--portal-out.active {
    background: #ecfeff;
}

.tool-btn--portal-in.active .tool-btn__icon--tile {
    background: #7c3aed;
    box-shadow: inset 0 0 0 2px #fff;
}

.tool-btn--portal-out.active .tool-btn__icon--tile {
    background: #0891b2;
    box-shadow: inset 0 0 0 2px #fff;
}

.tool-hover-tooltip__panel--portal {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}

.tool-hover-tooltip__panel--portal::after {
    background: #f5f3ff;
    border-left: 1px solid #ddd6fe;
    border-top: 1px solid #ddd6fe;
}

.tool-hover-tooltip__panel--portal .tool-hover-tooltip__title {
    color: #5b21b6;
}

.tool-hover-tooltip__panel--portal .tool-hover-tooltip__hint {
    color: #4c1d95;
}

.tools-group__items--campfire {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

/* Araç hover açıklama tooltip’leri */
.tool-hover-anchor {
    position: relative;
    display: inline-flex;
}

.tool-hover-tooltip {
    position: absolute;
    z-index: 120;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    width: max-content;
    max-width: 248px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.tool-hover-anchor:hover .tool-hover-tooltip,
.tool-hover-anchor:focus-within .tool-hover-tooltip {
    opacity: 1;
    visibility: visible;
}

.tool-hover-tooltip__panel {
    position: relative;
    padding: 10px 12px 11px;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.06),
        0 12px 28px rgba(15, 23, 42, 0.14);
}

.tool-hover-tooltip__panel::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    width: 12px;
    height: 12px;
    transform: translateX(-50%) rotate(45deg);
}

.tool-hover-tooltip__title {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tool-hover-tooltip__hint {
    margin: 0;
    font-size: 0.65rem;
    line-height: 1.45;
    font-weight: 600;
}

.tool-hover-tooltip__hint strong {
    font-weight: 800;
}

.tool-hover-tooltip__panel--campfire {
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.tool-hover-tooltip__panel--campfire::after {
    background: #fff7ed;
    border-left: 1px solid #fdba74;
    border-top: 1px solid #fdba74;
}

.tool-hover-tooltip__panel--campfire .tool-hover-tooltip__title {
    color: #9a3412;
}

.tool-hover-tooltip__panel--campfire .tool-hover-tooltip__hint {
    color: #7c2d12;
}

.tool-hover-tooltip__panel--flint {
    background: #eff6ff;
    border: 1px solid #93c5fd;
}

.tool-hover-tooltip__panel--flint::after {
    background: #eff6ff;
    border-left: 1px solid #93c5fd;
    border-top: 1px solid #93c5fd;
}

.tool-hover-tooltip__panel--flint .tool-hover-tooltip__title {
    color: #1e40af;
}

.tool-hover-tooltip__panel--flint .tool-hover-tooltip__hint {
    color: #1e3a8a;
}

.tool-hover-tooltip__panel--start {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.tool-hover-tooltip__panel--start::after {
    background: #f0fdf4;
    border-left: 1px solid #86efac;
    border-top: 1px solid #86efac;
}

.tool-hover-tooltip__panel--start .tool-hover-tooltip__title {
    color: #166534;
}

.tool-hover-tooltip__panel--start .tool-hover-tooltip__hint {
    color: #14532d;
}

.tool-hover-tooltip__panel--finish {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.tool-hover-tooltip__panel--finish::after {
    background: #fef2f2;
    border-left: 1px solid #fca5a5;
    border-top: 1px solid #fca5a5;
}

.tool-hover-tooltip__panel--finish .tool-hover-tooltip__title {
    color: #991b1b;
}

.tool-hover-tooltip__panel--finish .tool-hover-tooltip__hint {
    color: #7f1d1d;
}

.tool-hover-tooltip__panel--chest {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.tool-hover-tooltip__panel--chest::after {
    background: #fffbeb;
    border-left: 1px solid #fcd34d;
    border-top: 1px solid #fcd34d;
}

.tool-hover-tooltip__panel--chest .tool-hover-tooltip__title {
    color: #92400e;
}

.tool-hover-tooltip__panel--chest .tool-hover-tooltip__hint {
    color: #78350f;
}

.tool-hover-tooltip__panel--ai-scan {
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
}

.tool-hover-tooltip__panel--ai-scan::after {
    background: #f5f3ff;
    border-left: 1px solid #c4b5fd;
    border-top: 1px solid #c4b5fd;
}

.tool-hover-tooltip__panel--ai-scan .tool-hover-tooltip__title {
    color: #5b21b6;
}

.tool-hover-tooltip__panel--ai-scan .tool-hover-tooltip__hint {
    color: #4c1d95;
}

.tool-hover-tooltip__panel--ai-deposit {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.tool-hover-tooltip__panel--ai-deposit::after {
    background: #fffbeb;
    border-left: 1px solid #fcd34d;
    border-top: 1px solid #fcd34d;
}

.tool-hover-tooltip__panel--ai-deposit .tool-hover-tooltip__title {
    color: #92400e;
}

.tool-hover-tooltip__panel--ai-deposit .tool-hover-tooltip__hint {
    color: #78350f;
}

.tool-hover-tooltip__panel--eraser {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.tool-hover-tooltip__panel--eraser::after {
    background: #f8fafc;
    border-left: 1px solid #cbd5e1;
    border-top: 1px solid #cbd5e1;
}

.tool-hover-tooltip__panel--eraser .tool-hover-tooltip__title {
    color: #334155;
}

.tool-hover-tooltip__panel--eraser .tool-hover-tooltip__hint {
    color: #475569;
}

.tool-hover-tooltip__panel--erase-object {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
}

.tool-hover-tooltip__panel--erase-object::after {
    background: #f0fdfa;
    border-left: 1px solid #99f6e4;
    border-top: 1px solid #99f6e4;
}

.tool-hover-tooltip__panel--erase-object .tool-hover-tooltip__title {
    color: #0f766e;
}

.tool-hover-tooltip__panel--erase-object .tool-hover-tooltip__hint {
    color: #115e59;
}

@media (prefers-reduced-motion: reduce) {
    .tool-hover-tooltip {
        transition: none;
    }
}

.tool-btn--eraser {
    color: #64748b;
}

.tool-btn--eraser .tool-btn__icon {
    background: #f1f5f9;
    color: #475569;
}

.tool-btn--eraser.active {
    background: #f8fafc;
}

.tool-btn--eraser.active .tool-btn__icon {
    background: #475569;
    color: #fff;
}

.tool-btn--erase-object {
    color: #0d9488;
}

.tool-btn--erase-object .tool-btn__icon {
    background: #ccfbf1;
    color: #0f766e;
}

.tool-btn--erase-object.active {
    background: #f0fdfa;
}

.tool-btn--erase-object.active .tool-btn__icon {
    background: #0d9488;
    color: #fff;
}

.tool-btn--grid {
    color: #2563eb;
}

.tool-btn--grid .tool-btn__icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.tool-btn--grid.active {
    background: #eff6ff;
}

.tool-btn--grid.active .tool-btn__icon {
    background: #2563eb;
    color: #fff;
}

/* Sandık ayarları — araç seçiliyken (sandık butonunun altında) */
.chest-gold-settings,
.chest-gold-tooltip {
    position: absolute;
    z-index: 121;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    pointer-events: none;
}

.chest-gold-settings:not([hidden]),
.chest-gold-tooltip:not([hidden]) {
    pointer-events: auto;
}

.chest-gold-settings[hidden],
.chest-gold-tooltip[hidden] {
    display: none !important;
}

.chest-gold-tooltip__panel {
    position: relative;
    min-width: 200px;
    max-width: 260px;
    padding: 10px 12px 11px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(146, 64, 14, 0.08),
        0 12px 28px rgba(15, 23, 42, 0.14);
}

.chest-gold-tooltip__panel::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    width: 12px;
    height: 12px;
    background: #fffbeb;
    border-left: 1px solid #fcd34d;
    border-top: 1px solid #fcd34d;
    transform: translateX(-50%) rotate(45deg);
}

.chest-gold-tooltip__title {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 0.01em;
}

.chest-gold-tooltip__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 6px;
}

.chest-gold-tooltip__hint {
    margin: 0;
    font-size: 0.65rem;
    line-height: 1.4;
    color: #78350f;
    font-weight: 600;
}

.chest-gold-tooltip__hint strong {
    font-weight: 800;
}

.chest-gold-tooltip__random {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #92400e;
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.chest-gold-tooltip__random input {
    margin: 0;
    accent-color: #f59e0b;
}

.chest-gold-tooltip__controls label:not(.chest-gold-tooltip__random) {
    color: #92400e;
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
}

.chest-gold-tooltip__controls input[type="number"] {
    width: 3.75rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    background: #fff;
    color: #78350f;
}

.chest-gold-tooltip__controls input[type="number"]:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 1px;
}

.tool-inline-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    flex-shrink: 0;
    align-self: center;
    height: auto;
    margin: 0;
}

.tool-inline-field[hidden] {
    display: none !important;
}

.tools-group--grid-size,
.tools-group--color-pads {
    flex: 0 1 auto;
}

.tools-group--color-pads {
    position: relative;
}

.tools-group__items--color-pads,
.tools-group__items--chest {
    flex-wrap: nowrap;
    align-items: center;
}

.tools-group__items--color-pads {
    gap: 4px;
    padding: 5px 6px;
}

.tools-group__items--grid-size {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
}

.grid-size-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.grid-size-field label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    cursor: default;
}

.grid-size-field label i {
    font-size: 0.75rem;
    color: #64748b;
    width: 1em;
    text-align: center;
}

.grid-size-field input {
    width: 3.25rem;
    padding: 0.35rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    background: #fff;
    color: #1e293b;
}

.grid-size-field input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    border-color: #93c5fd;
}

/* Rastgele seçilince — minik popover */
.color-pad-cycle-popover {
    position: absolute;
    z-index: 120;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    pointer-events: none;
}

.color-pad-cycle-popover:not([hidden]) {
    pointer-events: auto;
}

.color-pad-cycle-popover[hidden] {
    display: none !important;
}

.color-pad-cycle-popover__panel {
    position: relative;
    min-width: 168px;
    padding: 10px 12px 11px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.06),
        0 12px 28px rgba(15, 23, 42, 0.14);
}

.color-pad-cycle-popover__panel::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: translateX(-50%) rotate(45deg);
}

.color-pad-cycle-popover__title {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5b21b6;
    letter-spacing: 0.01em;
}

.color-pad-cycle-popover__hint {
    margin: 0 0 8px;
    font-size: 0.65rem;
    line-height: 1.35;
    color: #64748b;
}

.color-pad-cycle-popover__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.color-pad-cycle-popover__field > span {
    font-size: 0.68rem;
    font-weight: 600;
    color: #475569;
}

.color-pad-cycle-popover__field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.5rem;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    background: #faf5ff;
    color: #5b21b6;
}

.color-pad-cycle-popover__field input:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 1px;
    border-color: #c4b5fd;
}

.tool-btn--color-pad {
    min-width: 52px;
    max-width: 56px;
    padding: 5px 4px 4px;
    gap: 3px;
}

.tool-btn--color-pad .tool-btn__label {
    font-size: 0.58rem;
    line-height: 1.1;
}

.tool-btn__icon--swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pad-color, #999);
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tool-btn__icon--swatch-random {
    background: conic-gradient(#e74c3c 0deg, #3498db 120deg, #2ecc71 240deg, #e74c3c 360deg);
}

.tool-btn--color-pad.active .tool-btn__icon--swatch {
    box-shadow: 0 0 0 2px #2563eb, inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tools-container {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.editor-toolbar {
    overflow: visible;
    position: relative;
    z-index: 20;
}

.tools-container__title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 0.65rem;
}

.editor-main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 0;
}

.grid-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafbfc;
    border-radius: 10px;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.grid-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.grid-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--grid-stage-gutter-x, 64px) minmax(0, 1fr);
    grid-template-rows: var(--grid-stage-gutter-y, 36px) minmax(0, 1fr);
    column-gap: 6px;
    row-gap: 6px;
    align-items: stretch;
}

.grid-stage__corner {
    grid-column: 1;
    grid-row: 1;
}

.grid-dim-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: background 0.18s ease;
}

.grid-dim-zone::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: #f8fafc;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.grid-dim-zone:hover::before,
.grid-dim-zone:focus-within::before {
    opacity: 1;
}

.grid-dim-zone--top {
    grid-column: 2;
    grid-row: 1;
    min-height: var(--grid-stage-gutter-y, 36px);
}

.grid-dim-zone--left {
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    min-width: var(--grid-stage-gutter-x, 64px);
}

.grid-dim-reveal {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    opacity: 0.45;
    transform: scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.grid-dim-reveal--rows {
    flex-direction: column;
    gap: 8px;
}

.grid-dim-zone:hover .grid-dim-reveal,
.grid-dim-zone:focus-within .grid-dim-reveal {
    opacity: 1;
    transform: scale(1);
}

.grid-dim-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 5px 3px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.grid-dim-chip--vertical {
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    align-items: center;
    border-radius: 14px;
}

.grid-dim-chip-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
}

.grid-dim-chip--vertical .grid-dim-chip-label {
    margin-bottom: 1px;
}

.grid-dim-btn {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.6rem;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.grid-dim-btn:hover {
    background: #4caf50;
    border-color: #43a047;
    color: #fff;
}

.grid-dim-btn:active {
    transform: scale(0.94);
}

.grid-dim-btn:focus-visible {
    outline: 2px solid #4caf50;
    outline-offset: 1px;
}

#levelGrid {
    max-width: 100%;
    max-height: 100%;
}

.commands-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.command-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.editor-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.editor-actions button {
    flex: 1;
}

.page-create-level .editor-actions--float button {
    flex: 0 0 auto;
}

/* Izgara boyutu ayarları */
.grid-size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-size-inputs .form-group {
    margin: 0;
}

.grid-size-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

/* Komut seçenekleri */
.command-options {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.command-checkbox input:checked ~ .command-options {
    display: block;
}

.command-options input {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Komut grupları ana container */
.command-groups {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Komut grubu kartı */
.command-group {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

/* Grup başlığı */
.command-group h3 {
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.command-group h3:hover {
    background: #f1f1f1;
}

.command-group h3 i {
    color: #4CAF50;
    margin-right: 0.5rem;
}

/* Açılır/kapanır ok ikonu */
.command-group h3:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.2s ease;
}

.command-group.collapsed h3:after {
    transform: rotate(-90deg);
}

.command-group.collapsed .commands-list {
    display: none;
}

/* Komut listesi */
.commands-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Checkbox container */
.command-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.command-checkbox:hover {
    background: #f1f1f1;
}

/* Checkbox gizleme */
.command-checkbox input[type="checkbox"] {
    display: none;
}

/* İkon container */
.command-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    color: #4CAF50;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Komut adı */
.command-name {
    font-size: 0.9rem;
    color: #333;
    flex: 1;
}

/* Seçili durum stilleri */
.command-checkbox.selected {
    background: #e8f5e9;
}

.command-checkbox.selected .command-icon {
    background: #4CAF50;
    color: white;
}

/* Izgara boyutu ayarları */
.grid-size-inputs label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.grid-size-inputs label i {
    color: #4CAF50;
    font-size: 1.1rem;
}

/* Textarea stilleri */
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all 0.3s ease;
}

textarea:hover {
    border-color: #4CAF50;
}

textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

/* Responsive tasarım */
@media (max-width: 992px) {
    .level-editor {
        grid-template-columns: 1fr;
        height: auto;
    }

    .editor-sidebar {
        order: 2;
    }

    .editor-main {
        order: 1;
        aspect-ratio: 1;
    }
}

/* ============================================================
   Tile Paleti — sol panel
   ============================================================ */
.tile-palette-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tile-palette-header {
    flex-shrink: 0;
    padding: 0 6px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}

.tile-palette-header .commands-heading {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
}

.tile-palette-hint {
    margin: 0;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.35;
}

.tile-palette {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-gutter: stable;
}

.tile-palette::-webkit-scrollbar {
    width: 8px;
}

.tile-palette::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
}

.tile-palette::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 999px;
}

.tile-palette::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.65);
}

.tile-palette__loading {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

.tile-palette__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tile-palette__group + .tile-palette__group {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 2px solid rgba(15, 23, 42, 0.08);
}

.tile-palette__group-title {
    margin: 0;
    padding: 0 4px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #334155;
}

.tile-palette__group[data-palette-group="ground"] .tile-palette__group-title {
    color: #166534;
}

.tile-palette__group[data-palette-group="objects"] .tile-palette__group-title {
    color: #1d4ed8;
}

.tile-palette__group-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tile-palette__category {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tile-palette__category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    user-select: none;
    transition: background 0.15s ease;
}

.tile-palette__category-header:hover {
    background: #e2e8f0;
}

.tile-palette__category-title {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 0.85rem;
    color: #334155;
}

.tile-palette__category-count {
    background: rgba(15, 23, 42, 0.08);
    color: #475569;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.tile-palette__category-chevron {
    transition: transform 0.2s ease;
    color: #64748b;
    font-size: 0.7rem;
}

.tile-palette__category.is-collapsed .tile-palette__category-chevron {
    transform: rotate(-90deg);
}

.tile-palette__category.is-collapsed .tile-palette__grid {
    display: none;
}

.tile-palette__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    background: #f8fafc;
}

/* Dar sol panel: tek kaydırma (.tile-palette), iç grid sınırsız yükseklik */
.page-create-level .tile-palette__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
}

.page-create-level .editor-main {
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.page-create-level .grid-stage {
    width: 100%;
}

.page-create-level .grid-container {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-create-level #levelGrid {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.page-create-level .tile-palette__category--flat {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 10px;
}

.page-create-level .tile-palette__simple-title {
    margin: 0 0 6px;
    padding: 0 2px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.3;
}

.page-create-level .tile-palette__category--flat .tile-palette__grid {
    padding: 0 0 8px;
    background: none;
}

.page-create-level .tile-palette__category--flat .tile-palette__grid--props,
.page-create-level .tile-palette__category--flat .tile-palette__grid--ground {
    background: none;
}

/* Bölüm editörü — palet öğeleri (zemin / nesne / ekstra) */
.page-create-level .tile-palette__grid--ground .tile-palette__item--ground {
    background: linear-gradient(180deg, #ecfccb 0%, #d9f99d 100%);
    border-color: rgba(77, 124, 15, 0.14);
}

.page-create-level .tile-palette__grid--ground .tile-palette__item--ground-theme {
    background: linear-gradient(180deg, #d9f99d 0%, #bef264 100%);
    border-color: rgba(77, 124, 15, 0.2);
}

.page-create-level .tile-palette__grid--ground .tile-palette__item--ground:hover,
.page-create-level .tile-palette__grid--ground .tile-palette__item--ground-theme:hover {
    background: linear-gradient(180deg, #d9f99d 0%, #bef264 100%);
}

.page-create-level .tile-palette__grid--props .tile-palette__item--prop {
    background: linear-gradient(180deg, #ecfccb 0%, #d9f99d 100%);
    border-color: rgba(0, 0, 0, 0.06);
}

.page-create-level .tile-palette__grid--props .tile-palette__item--prop:hover {
    background: linear-gradient(180deg, #d9f99d 0%, #bef264 100%);
}

.page-create-level .tile-palette__grid--props .tile-palette__item--extra {
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: rgba(79, 70, 229, 0.15);
}

.page-create-level .tile-palette__grid--props .tile-palette__item--extra:hover {
    background: linear-gradient(180deg, #c7d2fe 0%, #a5b4fc 100%);
}

.page-create-level .tile-palette__item {
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.page-create-level .tile-palette__item.is-selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22), 0 3px 10px rgba(15, 23, 42, 0.12);
}

.tile-palette__item {
    appearance: none;
    border: 2px solid transparent;
    background: #fff;
    padding: 2px;
    border-radius: 8px;
    cursor: grab;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tile-palette__item:hover {
    transform: translateY(-1px);
    border-color: #94a3b8;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.tile-palette__item.is-selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 4px 10px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

.tile-palette__item.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.tile-palette__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    image-rendering: -webkit-optimize-contrast;
}

/* Prop palet item'ları — şeffaf zemin, görselin etrafı boş kalmasın */
.tile-palette__grid--props {
    background: #eef2f7;
}

.tile-palette__item--prop {
    background: linear-gradient(180deg, #ecfccb 0%, #d9f99d 100%);
    border-color: rgba(0, 0, 0, 0.06);
}

.tile-palette__item--prop:hover {
    background: linear-gradient(180deg, #d9f99d 0%, #bef264 100%);
}

.tile-palette__item--extra {
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: rgba(79, 70, 229, 0.15);
}

.tile-palette-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.tile-palette__extra-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.tile-palette__extra-btn:hover {
    filter: brightness(1.06);
}

/* Canvas drop hedefi vurgu — tile sürüklenirken */
#levelGrid {
    transition: box-shadow 0.15s ease, outline-color 0.15s ease;
}

/* ============================================================
   Bölümü Kaydet Modal'ı
   ============================================================ */
.level-save-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.level-save-modal.is-open {
    display: flex;
}

.level-save-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.level-save-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: min(520px, calc(100vw - 32px));
    max-height: min(90vh, 640px);
    overflow-y: auto;
    padding: 20px 22px 18px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    animation: levelSaveModalIn 0.18s ease-out;
    box-sizing: border-box;
}

.level-save-modal__dialog--wide {
    width: min(920px, calc(100vw - 32px));
    max-width: min(920px, calc(100vw - 32px));
    max-height: min(92vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 20px 16px;
}

.level-save-modal__dialog--wide .level-save-modal__title,
.level-save-modal__dialog--wide .level-save-modal__hint {
    flex-shrink: 0;
}

.level-save-modal__dialog--wide .level-save-modal__actions {
    flex-shrink: 0;
    margin-top: auto;
}

@keyframes levelSaveModalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.level-save-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.level-save-modal__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.level-save-modal__title {
    margin: 0 36px 6px 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.level-save-modal__hint {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 0.85rem;
}

.level-save-modal__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    min-width: 0;
}

.level-save-modal__dialog--wide .level-save-modal__grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 16px;
    align-items: stretch;
    overflow: hidden;
}

@media (max-width: 820px) {
    .level-save-modal__dialog--wide .level-save-modal__grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }
}

.level-save-modal__col {
    min-width: 0;
}

.level-save-modal__dialog--wide .level-save-modal__col {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.level-save-modal__dialog--wide .level-save-modal__col .editor-section.commands-section--in-modal {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.level-save-modal__col .form-group {
    margin-bottom: 14px;
}

.level-save-modal__col label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.level-save-modal__col input[type="text"],
.level-save-modal__col input[type="number"],
.level-save-modal__col textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
}

.level-save-modal__col input:focus,
.level-save-modal__col textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.level-save-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: stretch;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8edf2;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.level-save-modal__dialog--wide .level-save-modal__actions {
    margin-top: 12px;
    padding-top: 12px;
}

.level-save-modal__btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    flex: 0 0 auto;
}

.level-save-modal__btn i {
    font-size: 0.82rem;
}

.level-save-modal__btn--ghost {
    background: #f1f5f9;
    color: #475569;
}

.level-save-modal__btn--ghost:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.level-save-modal__btn--primary {
    background: #4CAF50;
    color: #fff;
    box-shadow: 0 1px 2px rgba(76, 175, 80, 0.25);
}

.level-save-modal__btn--primary:hover {
    background: #43a047;
}

@media (max-width: 480px) {
    .level-save-modal__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .level-save-modal__btn {
        width: 100%;
        min-width: 0;
        padding: 0 12px;
    }
}

/* Modal içindeki komut grupları */
.commands-section--in-modal {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    padding: 14px;
    margin-top: 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    .level-save-modal__dialog--wide .commands-section--in-modal {
        max-height: min(340px, 44vh);
    }
}

.commands-section--in-modal .commands-heading {
    margin: 0 0 12px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.commands-section--in-modal .command-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.commands-section--in-modal .command-group {
    margin-bottom: 0;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    padding: 10px 12px;
    overflow: visible;
}

.commands-section--in-modal .command-group h3 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
    background: transparent;
}

.commands-section--in-modal .command-group h3::after {
    content: none;
    display: none;
}

.commands-section--in-modal .command-group h3 i {
    color: #4CAF50;
    font-size: 0.78rem;
}

.commands-section--in-modal .command-group.collapsed .commands-list {
    display: flex;
}

.commands-section--in-modal .commands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    min-width: 0;
}

.commands-section--in-modal .command-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    margin: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
}

.commands-section--in-modal .command-checkbox:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.commands-section--in-modal .command-checkbox.selected {
    background: #e8f5e9;
    border-color: #4CAF50;
    color: #1b5e20;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.15);
}

.commands-section--in-modal .command-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.commands-section--in-modal .command-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef7ee;
    color: #4CAF50;
    border-radius: 50%;
    font-size: 0.72rem;
}

.commands-section--in-modal .command-name {
    min-width: 0;
    flex: 0 1 auto;
    line-height: 1.25;
    white-space: nowrap;
}

.commands-section--in-modal .command-checkbox.selected .command-icon {
    background: #4CAF50;
    color: #fff;
}

/* Oyun modu — kolay / zor */
.movement-mode-field {
    grid-column: 1 / -1;
    margin-bottom: 4px;
}

.movement-mode-field__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.movement-mode-field__hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.movement-mode-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.movement-mode-option {
    cursor: pointer;
}

.movement-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.movement-mode-option__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    color: #475569;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.movement-mode-option input:checked + .movement-mode-option__pill,
.movement-mode-option.is-active .movement-mode-option__pill {
    border-color: #4CAF50;
    background: #ecfdf3;
    color: #166534;
}

.movement-commands-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.movement-commands-panel[hidden] {
    display: none !important;
}

.movement-shared-command {
    margin-top: 8px;
}

.block-usage-rules {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fffbeb;
}

.block-usage-rules__heading {
    margin: 0 0 4px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #92400e;
}

.block-usage-rules__hint {
    margin: 0 0 12px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #78716c;
}

.block-usage-rule {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
}

.block-usage-rule:last-child {
    margin-bottom: 0;
}

.block-usage-rule__legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.block-usage-rule__question {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #475569;
}

.block-usage-rule__options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.block-usage-rule__option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #334155;
    cursor: pointer;
}

.block-usage-rule__option input {
    margin: 0;
    accent-color: #d97706;
}

.block-usage-rule__option span {
    line-height: 1.35;
}

.page-create-level .grid-container {
    position: relative;
}

.editor-object-size-status {
    position: absolute;
    left: 50%;
    bottom: 0.45rem;
    transform: translateX(-50%);
    z-index: 20;
    max-width: min(92%, 28rem);
    margin: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

.page-create-level .tool-btn--object-half.active {
    outline: 2px solid #7c3aed;
    outline-offset: 1px;
}

