.pyramiden-spiel-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    border: 6px solid #333;
    border-radius: 20px;
    padding: 10px;
    background: linear-gradient(#ffe600, #fff6a0);
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
}

.ps-top {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ps-header {
    text-align: center;
    margin-bottom: 10px;
}

.ps-timer-label {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.ps-timer-display {
    font-size: 22px;
    font-weight: 800;
    padding: 4px 10px;
    background: #fff;
    border-radius: 12px;
    display: inline-block;
    margin: 2px 0 4px;
    border: 3px solid #333;
    min-width: 120px;
}

.ps-buttons-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ps-btn {
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
    transition: transform .1s, box-shadow .1s, filter .2s;
}

.ps-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.ps-btn-start {
    background: #ff4d4f;
    color: #fff;
}

.ps-btn-reset {
    background: #4caf50;
    color: #fff;
}

.ps-player-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.ps-player-btn {
    position: relative;
    padding: 6px 4px;
    border-radius: 999px;
    border: 3px solid #1c6dd0;
    background: #8bb9ff;
    color: #04396b;
    font-size: 14px;
    font-weight: 700;
}

.ps-player-btn.ps-active {
    background: #ffb74d;
    border-color: #ff6f00;
}

.ps-player-score {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    color: #222;
}

.ps-game-area {
    border-radius: 16px;
    overflow: hidden;
    border: 4px solid #333;
    background: #000;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 6px;
}

.ps-pyramid-area {
    background: #ffd600;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.ps-pyramid {
    width: 100%;
    height: 100%;
    position: relative;
}

.ps-pyramid-slot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 26px;
    border-radius: 6px;
    border: 2px dashed rgba(255,255,255,0.6);
    box-sizing: border-box;
}

.ps-pyramid-slot.ps-filled {
    border-style: solid;
    border-color: #fff;
}

.ps-storage-area {
    background: #111;
    height: 15%;
    border-top: 4px solid #333;
    padding: 6px 6px 10px;
    display: flex;
    flex-direction: column;
}

.ps-storage-label {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.ps-storage {
    flex: 1;
    border-radius: 10px;
    background: #000;
    border: 2px solid #fff;
    padding: 4px;
    position: relative;
    overflow: visible;
}

.ps-block {
    position: absolute;
    border-radius: 6px;
    border: 2px solid #fff;
    background: #4f7cff;
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.ps-block.ps-draggable {
    cursor: grab;
}

.ps-block.ps-dragging {
    cursor: grabbing;
    z-index: 1000;
}

.ps-block.ps-correct-hit {
    animation: ps-pulse 0.4s ease-out;
}

@keyframes ps-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.8); }
    50% { transform: scale(1.08); box-shadow: 0 0 12px 4px rgba(255,255,255,0.9); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* Dropdown-Bereich unterhalb des Spielfeldes */

.ps-controls-wrapper {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.ps-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    border: 3px solid #333;
    max-width: 700px;
    width: 100%;
    box-sizing: border-box;
}

.ps-control-group {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.ps-control-group select {
    margin-top: 2px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 2px solid #1c6dd0;
    font-size: 13px;
}

.ps-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ps-popup.ps-visible {
    display: flex;
}

.ps-popup-inner {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    min-width: 260px;
    max-width: 360px;
    text-align: center;
    border: 5px solid #ff9800;
    box-shadow: 0 0 18px rgba(0,0,0,0.5);
}

.ps-popup-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #e65100;
}

.ps-popup-text {
    font-size: 18px;
    margin-bottom: 14px;
}

.ps-btn-popup-close {
    background: #ff9800;
    color: #fff;
}

/* Mobile */
@media (max-width: 600px) {
    .pyramiden-spiel-wrapper {
        border-width: 4px;
        border-radius: 16px;
        height: 80vh;
        max-height: 80vh;
    }
    .ps-timer-display {
        font-size: 26px;
    }
}

.ps-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* 20px Abstand zwischen START, Zeit und NEUSTART */
    margin-top: 4px;
}
