body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url(../Bilder/html_background.png);
    background-color: black;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

#grid {
    position: relative;
    display: grid;
    gap: 0px;
    z-index: 2;
    pointer-events: auto;
    background-image: url(../Bilder/Background.png);
    background-color: transparent;
}

.cell {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.player {
    /*background-image: url("../Bilder/Player_rechts_Spitzhacke.png"); --- Wird rausgenommen, da jetzt in JS festgelegt*/
    background-size: cover;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background-color: transparent;
    border: none;
}

.skeleton {
    background-image: url("../Bilder/Skelett_Schwert_Schlüssel2_rechts.png");
    background-size: cover;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background-color: transparent;
    border: none;
}

.dirt {
    background-image: url("../Bilder/Block_3.png");
    background-size: cover;
    z-index: 2;
    /* Neu: Transparenz für zerstörte Blöcke */
    transition: all 0.025s ease;
    pointer-events: auto; /* Ermöglicht Interaktion */
}

/* Gate-Stil */
.cell.gate {
    background-image: url("../Bilder/Tor.png"); /* optional */
    background-size: cover;
    z-index: 2;
}

/* Block im zerstörten Zustand */
.dirt.destroyed {
    background-image: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* Deaktiviere Hover-Effekt für zerstörte Blöcke */
.dirt.destroyed:hover {
    filter: none;
    cursor: default;
}

.stone {
    background-image: url("../Bilder/harter_Block.png");
    background-size: cover;
    z-index: 2;
    transition: all 0.1s ease;
}

.stone.destroyed {
    background-image: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

.wall {
    background-image: url("../Bilder/Block_2.png");
    background-size: cover;
    z-index: 2;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.coin {
    background-image: url("../Bilder/Coin.gif");
    background-size: cover;
    border-radius: 50%;
    box-shadow: none;
    border: none;
    z-index: 2;
    background-color: transparent;
}

.key {
    background-image: url("../Bilder/Key.gif");
    background-size: cover;
    border-radius: 50%;
    box-shadow: none;
    border: none;
    z-index: 2;
    background-color: transparent;
}

.stalactite {
    background-image: url("../Bilder/Boulder.png");
    background-size: cover;
    z-index: 3;
}

#back-grid {
    z-index: 1;
    background-color: transparent;
    background-image: none;
}

#back-grid .cell:not(.wall) {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#scoreboard {
    position: absolute; /* Oder: fixed, wenn es beim Scrollen sichtbar bleiben soll */
    top: 10px;
    left: 10px;
    background-color: rgba(
        255,
        255,
        255,
        0.7
    ); /* halbtransparent, damit man das Spielfeld noch sieht */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* sicherstellen, dass es über dem Grid liegt */
}

.button {
    display: inline-block;
    margin: 20px auto;
    padding: 18px 48px;
    font-size: 1.3rem;
    font-family: inherit;
    font-weight: bold;
    color: #f1f1f1;
    background: #232323; /* Dunkelgrau, hebt sich dezent vom Hintergrund ab */
    border: 2px solid #353535;
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.18s, border 0.18s, color 0.18s;
}

.button:hover,
.button:focus {
    background: #353535; /* Leicht heller beim Hover */
    border: 2px solid #555;
    color: #fff;
    outline: none;
}

.top-right-buttons {
    position: absolute;
    top: 24px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 2px; /* Abstand zwischen den Buttons */
    align-items: flex-end;
    z-index: 100;
}

.tutorial-hint {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: 1.1rem;
    padding: 18px 0;
    text-align: center;
    letter-spacing: 0.5px;
    z-index: 99;
    border-top: 2px solid #353535;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

h1 {
    margin: 20px 0 10px 0;
    font-size: 2rem;
    text-align: center;
    color: white;
}

.header {
    position: relative;
    padding-top: 20px;
    padding-bottom: 5px;
    text-align: center;
}

.header-title {
    font-size: 2.5em;
    color: white;
    margin: 0;
    z-index: 1;
}

.header-scoreboard {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 80px;
    font-size: 2em;
    color: white;
}

/* Einzelne Score-Elemente gleich breit machen */
.header-scoreboard span {
    display: inline-block;
    min-width: 100px; /* Passe diese Breite je nach Inhalt an */
    text-align: center;
    font-family: monospace; /* Feste Zeichenbreite hilft gegen "Springen" */
}

.header-buttons {
    position: fixed;
    top: 2px;
    right: 10%; /* 10% vom rechten Rand entfernt */
    display: flex;
    gap: 10px;
    order: 1;
}

.button {
    padding: 6px 12px;
    font-size: 1.2rem;
    color: #f1f1f1;
    background: #232323;
    border: 1px solid #353535;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.gray-emoji {
    filter: grayscale(1) brightness(0.5);
    opacity: 0.5;
}
