/* SCHIEBEPUZZLE – alle Regeln auf #schiebepuzzle begrenzt */
#schiebepuzzle {
    --puzzle-tile: 110px;
    --puzzle-cols: 3;
    --puzzle-rows: 3;
    --puzzle-board-width: 340px;
    --puzzle-board-height: 340px;
    --puzzle-top-offset: 115px;
    --puzzle-side-offset: 115px;
    box-sizing: border-box;
    width: 100%;
    color: inherit;
    background: transparent;
    text-align: center;
}
#schiebepuzzle *, #schiebepuzzle *::before, #schiebepuzzle *::after { box-sizing: border-box; }
#schiebepuzzle [hidden] { display: none !important; }
#schiebepuzzle .puzzle-main { width: 100%; margin: 0 auto; padding: 0; }
#schiebepuzzle .puzzle-main h2 { margin: 0 0 16px; }
#schiebepuzzle .puzzle-anleitung { line-height: 1.6; margin: 0 auto 18px; }
#schiebepuzzle .puzzle-preview { display: block; width: 150px; height: auto; max-width: 100%; margin: 0 auto 8px; border-radius: 5px; }
#schiebepuzzle .puzzle-stats { margin: 12px auto; line-height: 1.5; }
#schiebepuzzle .puzzle-status { margin: 12px auto; line-height: 1.5; }
#schiebepuzzle .puzzle-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 20px; }
#schiebepuzzle .puzzle-controls button { padding: 8px 12px; border: 1px solid #aab0b5; border-radius: 5px; background: #f5f5f5; color: #222; cursor: pointer; }
#schiebepuzzle button:disabled { opacity: .45; cursor: default; }

/* Vier Parkplätze um das Brett. Die äußeren Rasterzellen haben keine
   eigene Mindesthöhe; ihre Größe folgt ausschließlich --puzzle-tile. */
#schiebepuzzle .puzzle-layout {
    display: grid;
    grid-template-columns: var(--puzzle-tile) var(--puzzle-board-width) var(--puzzle-tile);
    grid-template-rows: var(--puzzle-tile) var(--puzzle-board-height) var(--puzzle-tile);
    column-gap: 15px;
    row-gap: 15px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    align-items: start;
    justify-items: start;
}
/* Keine Parkplätze: identische Kachelgröße, aber keine leeren Rasterzeilen.
   Das Spielfeld wird weder vergrößert noch mit zusätzlichem Rand versehen. */
#schiebepuzzle .puzzle-layout.puzzle-no-parking {
    grid-template-columns: var(--puzzle-board-width);
    grid-template-rows: var(--puzzle-board-height);
    gap: 0;
}
#schiebepuzzle .puzzle-board {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(var(--puzzle-cols), var(--puzzle-tile));
    grid-template-rows: repeat(var(--puzzle-rows), var(--puzzle-tile));
    gap: 0;
    padding: 5px;
    width: var(--puzzle-board-width);
    height: var(--puzzle-board-height);
    background: #203744;
    border-radius: 6px;
    overflow: hidden;
}
#schiebepuzzle .puzzle-no-parking .puzzle-board { grid-column: 1; grid-row: 1; }
#schiebepuzzle .puzzle-tile {
    position: relative;
    width: var(--puzzle-tile);
    height: var(--puzzle-tile);
    border-radius: 0;
    background-repeat: no-repeat;
    cursor: pointer;
}
#schiebepuzzle .puzzle-empty { background: #152936; cursor: default; }
#schiebepuzzle .puzzle-border-right { border-right: 1px solid #8a8a8a; }
#schiebepuzzle .puzzle-border-bottom { border-bottom: 1px solid #8a8a8a; }
#schiebepuzzle .puzzle-arrows {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgb(0 0 0 / 35%);
}
#schiebepuzzle .puzzle-arrows button {
    padding: 4px 7px;
    border: 0;
    border-radius: 4px;
    background: white;
    color: #172b37;
    font-size: 18px;
    cursor: pointer;
}
#schiebepuzzle .puzzle-arrows button.puzzle-park-arrow { background: #3f9ee8; color: white; }
#schiebepuzzle .puzzle-parking-slot { position: relative; width: var(--puzzle-tile); min-height: var(--puzzle-tile); }
#schiebepuzzle .puzzle-parking-slot[data-side="top"] { grid-column: 2; grid-row: 1; margin-left: var(--puzzle-top-offset); }
#schiebepuzzle .puzzle-parking-slot[data-side="bottom"] { grid-column: 2; grid-row: 3; margin-left: var(--puzzle-top-offset); }
#schiebepuzzle .puzzle-parking-slot[data-side="left"] { grid-column: 1; grid-row: 2; margin-top: var(--puzzle-side-offset); }
#schiebepuzzle .puzzle-parking-slot[data-side="right"] { grid-column: 3; grid-row: 2; margin-top: var(--puzzle-side-offset); }
#schiebepuzzle .puzzle-parking-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: var(--puzzle-tile);
    height: var(--puzzle-tile);
    padding: 0;
    border: 2px dashed #8aa1a8;
    border-radius: 5px;
    background: #e4ebeb;
    color: #243b43;
    cursor: pointer;
}
#schiebepuzzle .puzzle-parking-box .puzzle-tile { flex-shrink: 0; }
#schiebepuzzle .puzzle-parking-label { display: block; font-size: 13px; line-height: 18px; }
#schiebepuzzle .puzzle-parking-slot small { display: block; margin-top: 3px; font-size: 12px; }


.puzzle-title-container {
    position: relative;
}

.puzzle-title-container h2 {
    margin: 0;
}

.puzzle-toggle-anleitung {
    display: block;
    position: static;
    margin: 10px auto 20px;
    padding: 6px 16px;
    cursor: pointer;
}

.puzzle-anleitung[hidden] {
    display: none !important;
}

.puzzle-prev-level[hidden],
.puzzle-next-level[hidden] {
    display: none !important;
}