/* ============================================================================
   Haupt-Stylesheet | Version 3.4  (Soft-Glow + geringere Sättigung)
   ────────────────────────────────────────────────────────────────────────────
   • Buttons deutlich dezenter:  –­ niedrigere --button-alpha
                                  –­ reduzierte Sättigung in allen Gradients
                                  –­ geringeres Hover-Aufhellen & Leuchtkranz
   • Restliche Features bleiben erhalten (Leuchtkranz-Ring, Text-Kontur,
     Hover-Halo, Haptik-Kompatibilität …)
   ==========================================================================*/

:root {
    /* ===== Sichtbarkeit & Transparenz ==================================== */
    --button-alpha : 0.65;        /* vorher 0.80 → weniger „knallig“        */
    --outline-size : 3px;
    --halo-strength: 1.0;         /* vorher 1.25 → sanfteres Hover-Leuchten */
    --num-font-scale: 1.3;

    /* ===== Layout-Parameter & Grundpalette =============================== */
    --top-offset : 70px;
    --hue-start : 210;
    --hue-step  : 18;

    --light-brown: #8D6E63;
    --dark-brown : rgba(79,50,6,.27);
    --hover-brown: rgb(167,167,191);
    --olive-green: #33691E;

    --save-green : #2E7D32;
    --delete-red : #D32F2F;

    --creamy-ivory : #FAFAFA;
    --subtle-shadow: 0 4px 6px rgba(0,0,0,.15);
    --hover-shadow : 0 8px 18px rgba(0,0,0,.35); /* dezenter              */
    --glass-bg     : rgba(255,255,255,.05);       /* Grundglas dezenter    */
  --other-country-bg:    #5e35b1; /* Grundfarbe – gedecktes Violett */
    --other-country-hover: #7e57c2; /* Hellere Farbe bei Hover        */
    --other-country-active:#9575cd; /* Persistenter Ton bei Aktivität */
    --scale-factor: 1.0;
    --message-fixed-width: calc(420px * var(--scale-factor));
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--light-beige);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Zentrieren */
    align-items: center;
    height: 100vh;
    transition: filter 0.3s ease;
}

body.blur-active {
    filter: blur(5px);
}

.form-group {
    display: flex;
    margin-top: 80px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
    gap: 20px;
    position: relative;

    &::after {
        content: '';
        position: absolute;
        bottom: -20px;
        left: 0;
        width: 100%;
        height: 2px; /* Strichstärke erhöht */
        background-color: var(--dark-brown);
    }
}

.grid-custom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, calc(100px * var(--scale-factor))); /* Skalierung der Größe */
    gap: calc(20px * var(--scale-factor)); /* Skalierung des Abstands */
    justify-content: center;
    position: relative;
    max-width: 100%; /* Flexibles Layout */
    max-height: 100%; /* Flexibles Layout */

    &::before,
    .horizontal-line,
    .vertical-line {
        content: '';
        position: absolute;
        background-color: var(--dark-brown);
        z-index: 1;
    }

    &::before {
        top: calc(100% + calc(20px * var(--scale-factor)));
        left: 0;
        width: 100%;
        height: 2px; /* Strichstärke erhöht */
    }

    .horizontal-line {
        width: 100%;
        height: 2px; /* Strichstärke erhöht */
    }

    .vertical-line {
        width: 2px; /* Strichstärke erhöht */
        height: 100%;
    }

    .horizontal-line:nth-child(4n + 3),
    .horizontal-line:nth-child(4n + 4) {
        top: calc(25% * 1);
    }

    .horizontal-line:nth-child(4n + 7),
    .horizontal-line:nth-child(4n + 8) {
        top: calc(25% * 2);
    }

    .vertical-line:nth-child(2n + 1),
    .vertical-line:nth-child(2n + 2) {
        left: calc(33.333% * 1);
    }

    .vertical-line:nth-child(2n + 3),
    .vertical-line:nth-child(2n + 4) {
        left: calc(33.333% * 2);
    }
}

.numpad-button,
.message-display,
.increase-quantity,
.keyboard-button {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--creamy-ivory);
    background-color: var(--harmonious-blue); /* Geänderte Farbe für besseren Kontrast */
    border-radius: 15px; /* Geänderte Form */
    box-shadow: var(--subtle-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    font-size: calc(2rem * var(--scale-factor)); /* Skalierung der Schriftgröße */
    margin: calc(10px * var(--scale-factor)); /* Skalierung des Abstands */
    padding: calc(20px * var(--scale-factor)); /* Skalierung des Innenabstands */

    &:hover {
        background-color: var(--harmonious-green); /* Geänderte Hover-Farbe */
        box-shadow: var(--hover-shadow);
        transform: scale(1.05);
    }
}

.numpad-save,
.numpad-clear {
    font-size: calc(2rem * var(--scale-factor)); /* Skalierung der Schriftgröße */
    color: var(--creamy-ivory);

    &.numpad-save {
        grid-column: span 3;
        padding: calc(20px * var(--scale-factor));
        cursor: pointer;
        background-color: var(--batch-green);
        border: none;
        box-shadow: var(--hover-shadow);
    }

    &.numpad-clear {
        background-color: var(--dark-red);
    }
}

.message-display,
.increase-quantity,
.keyboard-button {
    height: calc(70px * var(--scale-factor));
    padding: calc(15px * var(--scale-factor));
    border-radius: 10px;
    color: var(--creamy-ivory); !important
    box-shadow: var(--subtle-shadow);
    font-size: calc(2rem * var(--scale-factor));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin: calc(10px * var(--scale-factor));
}

.message-display {
    flex: 1;
    max-width: calc(600px * var(--scale-factor)); /* Skalierung der maximalen Breite */
    margin: 0 calc(20px * var(--scale-factor));
    font-size: calc(2rem * var(--scale-factor));
    text-align: center;
    overflow: hidden;
}

.keyboard-button {
    padding: calc(10px * var(--scale-factor)) calc(20px * var(--scale-factor));
    font-size: calc(1.4rem * var(--scale-factor)); /* Skalierung der Schriftgröße */
    color: var(--creamy-ivory); !important;
    background-color: rgba(64, 64, 65, 0); !important;
    border: none;
    border-radius: 50px;  !important;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: var(--subtle-shadow);
    font-family: 'Arial', sans-serif;
    margin: calc(10px * var(--scale-factor));
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    position: relative;
    overflow: hidden;
    align-self: flex-start;

    &:active {
        background-color: var(--hover-brown);
        box-shadow: var(--hover-shadow);
        transform: scale(1.05);
    }
}

.increase-quantity {
    width: calc(70px * var(--scale-factor));
    font-size: calc(2rem * var(--scale-factor));
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-left: calc(20px * var(--scale-factor));
    position: relative;

    &::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: calc(2rem * var(--scale-factor));
        color: white;
        opacity: 0;
        transition: opacity 0.3s ease, background-color 0.3s ease;
        width: 100%;
        height: 100%;
        background: var(--olive-green);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    &.show-check::after {
        opacity: 1;
    }
}

.numpad-button:active,
.numpad-save:active,
.numpad-clear:active {
    animation: buttonFade 0.5s ease-out;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
    transform: scale(0.98);
}

@keyframes buttonFade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.5;
    }
}

@keyframes sparkles {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
    }
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 10px;
    border-radius: 50px;
    transition: all 4000ms ease-out;
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.27);
    border-width: 0.3px;
    background: #FFD700;
    transform: scale(1);
}

@media (orientation: portrait) {
    .grid-custom {
        grid-template-rows: repeat(4, calc(120px * var(--scale-factor)));
    }
    .numpad-button,
    .numpad-save,
    .numpad-clear {
        font-size: calc(2.5rem * var(--scale-factor));
    }
}

/* Basisklassen für die verschiedenen Buttons */
.other-country-button {
  transition: background-color 0.3s ease, opacity 0.3s ease;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Deaktivierter Zustand */
.other-country-button--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Aktivierter Zustand: gut sichtbarer Akzent */
.other-country-button--active {
  opacity: 1;
  cursor: pointer;
  background-color: rgba(94, 53, 177, 0.6);
  border-color: rgba(94, 53, 177, 0.8);
  box-shadow: 0 0 8px rgba(94, 53, 177, 0.7);
  color: #ffffff;
}

/* Delete‑ und Save‑Buttons behalten ihren gläsernen Effekt */
.numpad-delete-button {
  background-color: rgba(211, 47, 47, 0.25);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.numpad-save-button {
  background-color: rgba(46, 125, 50, 0.25);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Sparkles weiterhin grün */
.sparkle {
  background: #4cd24c !important;
}
