Private
Public Access
1
0
Files
it232Abschied/static/style.css
Sebastian Unterschütz 0fdc7e0309
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 1m56s
fix Mobile
2025-11-25 18:34:45 +01:00

429 lines
11 KiB
CSS

/* =========================================
0. LOKALE SCHRIFTARTEN (DSGVO Konform)
========================================= */
/* press-start-2p-regular - latin */
@font-face {
font-display: swap; /* Zeigt Text sofort an (Fallback), bis Schrift geladen ist */
font-family: 'Press Start 2P';
font-style: normal;
font-weight: 400;
src: url('assets/fonts/press-start-2p-v16-latin-regular.woff2') format('woff2'),
url('assets/fonts/press-start-2p-v16-latin-regular.woff') format('woff');
}
/* =========================================
1. GRUNDLAGEN & GLOBAL
========================================= */
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
background-color: #1a1a1a;
color: white;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Press Start 2P', cursive;
font-size: 14px;
}
#game-container {
position: relative;
box-shadow: 0 0 50px rgba(0,0,0,0.8);
border: 4px solid #444;
background: #000;
/* Größe wird von JS gesetzt, hier nur Layout-Verhalten */
display: flex;
overflow: hidden;
}
canvas {
display: block;
width: 100%;
height: 100%;
background-color: #f0f0f0;
image-rendering: pixelated;
image-rendering: crisp-edges;
}
/* =========================================
2. UI & SCORE
========================================= */
#ui-layer {
position: absolute;
top: 25px;
right: 25px;
color: #333;
font-size: 24px;
font-weight: bold;
pointer-events: none;
text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
z-index: 5;
}
/* =========================================
3. OVERLAYS (Basis-Einstellungen)
========================================= */
#startScreen, #gameOverScreen {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
box-sizing: border-box;
padding: 20px;
}
h1 {
font-size: 32px;
color: #ff4444;
text-shadow: 4px 4px 0px #000;
line-height: 1.4;
margin: 10px 0 25px 0;
text-align: center;
text-transform: uppercase;
}
/* Fix für Input Section (Name eingeben) */
#inputSection {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
margin: 15px 0;
}
/* =========================================
4. START SCREEN (Links/Rechts Layout)
========================================= */
#startScreen {
flex-direction: row; /* Nebeneinander */
gap: 40px;
}
.start-left {
flex: 2;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 60%;
}
.start-right {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 35%;
}
/* =========================================
5. GAME OVER SCREEN (WICHTIG: Untereinander)
========================================= */
#gameOverScreen {
/* HIER IST DER FIX: */
flex-direction: column !important;
gap: 15px;
}
/* Das Leaderboard im Game Over Screen */
#leaderboard {
margin-top: 10px;
font-size: 12px;
width: 90%;
max-width: 450px;
background: rgba(0,0,0,0.5);
padding: 15px;
border: 2px solid #666;
/* Begrenzte Höhe mit Scrollen, falls Liste lang ist */
max-height: 200px;
overflow-y: auto;
}
/* =========================================
6. HALL OF FAME BOX (Startseite)
========================================= */
.hall-of-fame-box {
background: rgba(0, 0, 0, 0.6);
border: 4px solid #ffcc00;
padding: 15px;
width: 100%;
max-height: 300px;
overflow-y: auto;
box-shadow: 0 0 15px rgba(255, 204, 0, 0.1);
}
.hall-of-fame-box h3 {
color: #ffcc00;
text-align: center;
margin-top: 0;
margin-bottom: 10px;
border-bottom: 2px solid #555;
padding-bottom: 8px;
font-size: 14px;
}
.hof-entry {
display: flex;
justify-content: space-between;
padding: 6px 0;
border-bottom: 1px dotted #444;
font-size: 11px;
font-family: sans-serif;
color: #ddd;
line-height: 1.4;
}
.hof-rank { color: #ffcc00; font-weight: bold; margin-right: 8px; }
.hof-score { color: white; font-weight: bold; }
/* =========================================
7. BUTTONS & INPUTS
========================================= */
button {
font-family: 'Press Start 2P', cursive;
background: #ffcc00;
border: 4px solid #fff;
padding: 18px 30px;
font-size: 18px;
cursor: pointer;
color: #000;
box-shadow: 0 6px 0 #997a00;
text-transform: uppercase;
margin: 12px;
}
button:active { transform: translateY(4px); box-shadow: 0 1px 0 #997a00; }
button:disabled { background: #555; color: #888; box-shadow: none; }
input {
font-family: 'Press Start 2P', cursive;
padding: 12px;
font-size: 16px;
border: 3px solid white;
background: #222;
color: white;
text-align: center;
margin-bottom: 15px;
width: 250px;
outline: none;
}
/* =========================================
8. INFO BOXEN
========================================= */
.info-box {
background: rgba(255, 255, 255, 0.1);
border: 2px solid #555;
padding: 12px;
margin: 8px 0;
width: 100%;
max-width: 320px;
text-align: left;
box-sizing: border-box;
}
.info-box p {
font-family: sans-serif;
font-size: 14px;
color: #ccc;
line-height: 1.4;
margin: 0;
}
.info-title {
color: #ffcc00;
font-size: 12px;
margin-bottom: 6px;
text-align: center;
text-decoration: underline;
}
/* =========================================
9. RECHTLICHES
========================================= */
.legal-bar {
margin-top: 20px;
display: flex;
gap: 15px;
}
.legal-btn {
font-size: 10px;
padding: 8px 12px;
margin: 0;
background: transparent;
border: 1px solid #666;
color: #888;
box-shadow: none;
}
.legal-btn:hover { background: #333; color: white; border-color: white; }
/* Modals */
.modal-overlay {
display: none;
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.95);
z-index: 999;
align-items: center;
justify-content: center;
}
.modal-content {
background: #222;
border: 4px solid #fff;
padding: 30px;
width: 80%;
max-width: 600px;
max-height: 80%;
overflow-y: auto;
color: #ccc;
font-family: sans-serif;
text-align: left;
position: relative;
font-size: 16px;
line-height: 1.6;
}
.modal-content h2 { color: #ffcc00; font-family: 'Press Start 2P'; margin-top: 0; font-size: 20px; }
.close-modal {
position: absolute;
top: 10px; right: 10px;
background: #ff4444; border: 2px solid white;
width: 35px; height: 35px;
font-size: 16px;
line-height: 30px;
margin: 0; padding: 0;
box-shadow: none;
}
/* =========================================
10. PC / DESKTOP SPEZIAL
========================================= */
@media (min-width: 1024px) {
h1 { font-size: 48px; margin-bottom: 40px; }
button { font-size: 22px; padding: 20px 40px; }
input { width: 350px; font-size: 20px; padding: 15px; }
.info-box { max-width: 500px; }
.info-box p { font-size: 16px; }
.info-title { font-size: 14px; }
.hall-of-fame-box { max-height: 400px; }
.hof-entry { font-size: 14px; padding: 8px 0; }
.hall-of-fame-box h3 { font-size: 18px; margin-bottom: 15px; }
}
/* =========================================
11. MOBILE ANPASSUNG
========================================= */
@media (max-width: 700px) {
#startScreen {
flex-direction: column;
gap: 15px;
justify-content: flex-start;
overflow-y: auto;
}
.start-left, .start-right { max-width: 100%; width: 100%; }
.start-right { height: auto; min-height: 200px; margin-top: 20px; }
.hall-of-fame-box { max-height: 200px; }
h1 { font-size: 24px; margin: 15px 0; }
button { padding: 12px 20px; font-size: 14px; }
input { width: 200px; }
}
/* =========================================
12. ROTATE OVERLAY
========================================= */
#rotate-overlay {
display: none;
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: #222;
z-index: 9999;
color: white;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.icon { font-size: 60px; margin-bottom: 20px; }
/* Nur anzeigen, wenn Spiel läuft UND Portrait */
@media screen and (orientation: portrait) {
body.game-active #rotate-overlay { display: flex; }
body.game-active #game-container { display: none !important; }
}
/* =========================================
MOBILE LANDSCAPE FIX (Kritisch für Menüs!)
========================================= */
/* Diese Regel greift, wenn das Gerät flach ist (Handy quer) */
@media (max-height: 500px) {
/* 1. Haupt-Container: Alles zentrieren! */
#startScreen {
flex-direction: row; /* Nebeneinander lassen, da Bildschirm breit ist */
align-items: center; /* Vertikal mittig */
justify-content: center; /* Horizontal mittig */
gap: 20px; /* Abstand zwischen Menü und Leaderboard */
padding: 10px;
overflow-y: auto; /* Scrollen erlauben zur Sicherheit */
}
/* 2. Linke Seite (Menü) zentrieren */
.start-left {
width: 45%; /* Nimmt fast die Hälfte */
max-width: none;
align-items: center; /* Inhalte zentrieren */
text-align: center; /* Text zentrieren */
margin: 0; /* Ränder weg */
}
/* 3. Rechte Seite (Leaderboard) zentrieren */
.start-right {
width: 45%;
max-width: none;
height: auto;
margin: 0;
}
/* 4. Titel kleiner */
h1 {
font-size: 18px;
margin: 0 0 10px 0;
line-height: 1.2;
}
/* 5. Unwichtiges AUSBLENDEN */
.info-box { display: none; }
.legal-bar { margin-top: 5px; }
/* 6. Buttons & Input optimieren */
button {
padding: 8px 12px;
font-size: 10px;
margin: 5px;
}
/* 7. Leaderboard Box */
.hall-of-fame-box {
max-height: 180px; /* Damit es nicht den Screen sprengt */
}
.hall-of-fame-box h3 { font-size: 10px; margin-bottom: 5px; }
.hof-entry { padding: 2px 0; font-size: 8px; }
/* 8. Game Over Screen auch zentrieren */
#gameOverScreen {
justify-content: center;
align-items: center;
padding-top: 0;
}
#inputSection { margin: 5px 0; }
input { padding: 5px; font-size: 12px; width: 150px; margin-bottom: 5px; }
#leaderboard { max-height: 100px; padding: 5px; margin-top: 5px; }
}