@font-face {
    font-family: 'EKModena-Bold';
    src: url('fonts/EKModena-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'EKModena-Medium';
    src: url('fonts/EKModena-Medium.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'EKModenaExpanded-Heavy';
    src: url('fonts/EKModenaExpanded-Heavy.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

body {
    font-family: 'EKModena-Medium', Arial, sans-serif;
    background-image: url('assets/bg.webp');
    background-size: contain;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: #333;
    background-repeat: repeat-x;
    width: 100%;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

.container {
    max-width: 400px;
    width: 90%;
    text-align: center;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    touch-action: manipulation;
}

.header h1 {
    font-family: 'EKModena-Bold', Arial, sans-serif;
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.display-section {
    margin-bottom: 2rem;
}

.number-display {
    font-family: 'EKModenaExpanded-Heavy', Arial, sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: #333;
    margin-bottom: 1rem;
    min-height: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad {
    margin-bottom: 2rem;
}

.keypad-row {
    display: flex;
    justify-content: flex-end  ;
    gap: 1rem;
    margin-bottom: 1rem;
}

.key {
    width: 80px;
    height: 80px;
    font-family: 'EKModenaExpanded-Heavy', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: transparent;
    border: 2px solid #333;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key:hover {
    background-color: rgba(51, 51, 51, 0.1);
    transform: scale(1.05);
}

.key:active {
    transform: scale(0.95);
    background-color: rgba(51, 51, 51, 0.2);
}

.delete-key {
    font-size: 2rem;
}

.project-title {
    font-family: 'EKModena-Bold', Arial, sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    /* Mindestlänge für Wortteile: 5 Zeichen vor und nach dem Trennstrich */
    hyphenate-limit-before: 5;
    hyphenate-limit-after: 5;
    -webkit-hyphenate-limit-before: 5;
    -webkit-hyphenate-limit-after: 5;
}

.project-button {
    font-family: 'EKModena-Bold', Arial, sans-serif;
    background-color: white;
    color: #333;
    border: 2px solid #333;
    padding: 1rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    min-width: 200px;
}

.project-button:hover:not(.disabled) {
    background-color: #333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.project-button:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-button.disabled {
    background-color: #f0f0f0;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.visible {
    opacity: 1;
    pointer-events: all;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .container {
        width: 95%;
        padding: 1rem 0.5rem;
        justify-content: center;
        min-height: 100vh;
    }
    
    .header h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
        line-height: 1.1;
    }
    
    .number-display {
        font-size: 4.5rem;
        min-height: 4rem;
    }
    
    .key {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }
    
    .keypad-row {
        gap: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .project-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        line-height: 1.3;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
        -ms-hyphens: auto;
        hyphenate-limit-before: 5;
        hyphenate-limit-after: 5;
        -webkit-hyphenate-limit-before: 5;
        -webkit-hyphenate-limit-after: 5;
    }
    
    .project-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-width: 180px;
    }
    
    .display-section {
        margin-bottom: 1.2rem;
    }
    
    .keypad {
        margin-bottom: 1.2rem;
    }
}

@media (max-height: 700px) {
    .container {
        justify-content: center;
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }
    
    .number-display {
        font-size: 4rem;
        min-height: 80px;
    }
    
    .display-section {
        margin-bottom: 1rem;
    }
    
    .keypad {
        margin-bottom: 1rem;
    }
    
    .key {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }
    
    .keypad-row {
        margin-bottom: 0.6rem;
    }
    
    .project-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
        hyphenate-limit-before: 5;
        hyphenate-limit-after: 5;
        -webkit-hyphenate-limit-before: 5;
        -webkit-hyphenate-limit-after: 5;
    }
    
    .project-button {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-height: 600px) {
    body {
        padding: 0.5rem 0.2rem;
    }
    
    .container {
        padding: 0.2rem;
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .number-display {
        font-size: 3.5rem;
        min-height: 3rem;
    }
    
    .display-section {
        margin-bottom: 0.8rem;
    }
    
    .keypad {
        margin-bottom: 0.8rem;
    }
    
    .key {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
    }
    
    .keypad-row {
        margin-bottom: 0.4rem;
    }
    
    .project-title {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
        hyphenate-limit-before: 5;
        hyphenate-limit-after: 5;
        -webkit-hyphenate-limit-before: 5;
        -webkit-hyphenate-limit-after: 5;
    }
    
    .project-button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}
