/* ================================
		   BASIS
		================================ */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #ffffff; /* Außen weiß */
	font-family: Poppins, sans-serif;
}
/* ================================
		   GAME-CONTAINER & CANVAS
		================================ */
#game-container {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	width: 90vw;
	max-width: 100vw;
	max-height: 100vh;
	height: 80vh;
	margin: 5vh auto;
}
canvas {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	aspect-ratio: 16 / 9;
	background: lightblue; /* gelb */
}
/* =========================================
🏔️ Startbildschirm Layout
========================================= */
#start-screen {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	gap: 20px;
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	color: white;
	z-index: 100;
}
/* Sponsor + Startbutton nebeneinander */
.start-row {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 20px; /* Abstand zwischen Sponsor und Button */
	margin-top: 10px;
}
/* ================================
   🟡 Start- & GameOver Layout nebeneinander
   ================================ */

/* Gleiche Struktur für Start- und GameOver-Bereich */
.start-row, .gameover-row {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 25px; /* Abstand zwischen Sponsor und Button */
	margin-top: 15px;
}
/* Sponsor & Button gleich ausrichten */
.start-row .sponsor-box, .gameover-row .sponsor-box {
	margin: 0;
}
.start-row button, .gameover-row button {
	margin: 0;
}
/* Start-Button */
#start-btn {
	background: #ffed00;
	border: none;
	border-radius: 10px;
	padding: 12px 24px;
	font-size: 18px;
	font-weight: bold;
	color: #black;
	cursor: pointer;
	transition: transform 0.1s ease, background 0.2s ease;
}
#start-btn:hover {
	background: #ffe066;
	transform: scale(1.05);
}
#start-btn:active {
	transform: scale(0.98);
}
/* Start-Button */
#restart-btn {
	background: #ffed00;
	border: none;
	border-radius: 10px;
	padding: 12px 24px;
	font-size: 18px;
	font-weight: bold;
	color: #black;
	cursor: pointer;
	transition: transform 0.1s ease, background 0.2s ease;
}
#restart-btn:hover {
	background: #ffe066;
	transform: scale(1.05);
}
#restart-btn:active {
	transform: scale(0.98);
}
/* ================================
		   UI ELEMENTE
		================================ */
#ui {
	position: absolute;
	top: 1.5%;
	left: 2%;
	color: #000;
	font-weight: 600;
	z-index: 10;
	font-size: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
/* Münz-Counter sichtbar mit Rahmen */
#score {
	background: rgba(255, 255, 255, 1); /* leicht transparentes Weiß */
	border: 1.5px solid rgba(0, 0, 0, 0.2); /* dezenter Rahmen */
	border-radius: 8px;
	padding: 0.3rem 0.8rem;
	margin-left: 80px;
	display: flex;
	align-items: center;
	gap: 6px;
}
/* Geschwindigkeitsanzeige ausblenden */
#speed {
	display: none !important;
}
#lives {
	position: absolute;
	top: 1.5%;
	right: 2%;
	z-index: 20;
}
#lives img {
	width: 45px;       /* feste mittlere Größe */
	height: auto;
	display: block;
}
#music-btn {
	position: absolute;
	top: 15px;
	left: 15px; /* <– fixiert ihn links oben */
	z-index: 1000; /* über allem, aber unter Countdown */
	background: rgba(0, 0, 0, 0.4);
	border: none;
	border-radius: 8px;
	padding: 8px;
	color: black;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
#music-btn svg {
	pointer-events: none;
	width: 24px;
	height: 24px;
}
#slash-icon {
	position: absolute;
	display: none;
}
#music-btn.off #slash-icon {
	display: block;
}
/* --- Musik-Icon (rahmenlos, transparent) --- */
.music-toggle {
	-webkit-appearance: none;
	appearance: none;
	background: transparent !important;
	border: none !important;
	padding: 0;
	margin: 0;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	color: #000; /* Icon-Farbe (schwarz) */
}
/* Entferne eventuelle Fokus-Rahmen (optional) */
.music-toggle:focus {
	outline: none;
}
/* SVG-Note */
.music-toggle #music-icon {
	width: 24px;
	height: 24px;
	pointer-events: none; /* Klicks auf Button weiterleiten */
	display: block;
	color: inherit;
}
/* Slash: absolut über der Note, zentriert und standardmäßig versteckt */
.music-toggle #slash-icon {
	position: absolute;
	width: 60%;   /* Breite des Slash relativ zum Button */
	height: 60%;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-25deg);
	pointer-events: none;
	color: red;   /* Slash-Farbe */
	display: none; /* nur sichtbar wenn .off gesetzt */
}
/* Wenn Musik aus -> Slash zeigen */
.music-toggle.off #slash-icon {
	display: block;
}
/* Optional: leichter Hover-Effekt (kein Hintergrund) */
.music-toggle:hover {
	transform: translateY(-1px);
}
/* Falls #ui oder #ui div eine halbtransparente weiße Box setzt,
		   stell sicher, dass die button-hintergründe nicht davon betroffen sind:
		   (nur wenn nötig) */
#ui button.music-toggle {
	background: transparent !important;
}
/* ================================
		   START & GAME OVER
		================================ */
#start-screen, #game-over {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.80);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	z-index: 20;
}
#start-screen.hidden, #game-over.hidden {
	display: none;
}
#start-screen h1, #game-over h2 {
	color: #000;
	margin-bottom: 10px;
	font-size: 2.4rem;
}
#start-screen p, #game-over p {
	color: #444;
	margin-bottom: 10px;
	font-size: 1rem;
}
button {
	background: #ffed00;
	color: #000;
	border: none;
	border-radius: 8px;
	padding: 10px 20px;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.3s ease;
	margin-top: 10px;
}
button:hover {
	background: #e5d500;
}
.sponsor-box {
	width: 180px;
	height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 15px auto;
}

/* ================================
		   RESPONSIVE DESIGN
		================================ */

		/* 🖥️ Desktop */
@media (min-width: 1025px) {
#game-container {
	width: 90vw;
	max-width: 1200px;
	height: 80vh;
	margin: 5vh auto;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
}

/* 💻 Tablet quer (601–1024px): echtes Vollbild */
@media (max-width: 1024px) and (min-width: 601px) {
html, body {
	background: lightblue; /* Gelb über gesamten Bildschirm */
}
#game-container {
	width: 100vw !important;
	height: 100vh !important;
	max-width: none !important;
	margin: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: lightblue;
}
canvas {
	width: 100vw;
	height: 100vh;
	aspect-ratio: auto;
}
#ui {
	font-size: 0.9rem;
}
#start-screen h1, #game-over h2 {
	font-size: 1.8rem;
}
button {
	font-size: 0.9rem;
	padding: 8px 16px;
}
}

/* 📱 Handy */
@media (max-width: 600px) {
html, body {
	background: lightblue;
}
#game-container {
	width: 100vw !important;
	height: 100vh !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	background: lightblue;
}
canvas {
	width: 100vw;
	height: 100vh;
	aspect-ratio: auto;
}
#ui {
	font-size: 0.8rem;
}
#start-screen h1, #game-over h2 {
	font-size: 1.4rem;
}
#start-screen p, #game-over p {
	font-size: 0.8rem;
}
button {
	font-size: 0.8rem;
	padding: 6px 12px;
}
.sponsor-box {
	width: 180px;
	height: 70px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 15px auto;
}
}
/* ================================
		   ROTATE-WARNUNG
		================================ */
#rotate-warning {
	display: none;
	position: absolute;
	inset: 0;
	justify-content: center;
	align-items: center;
	background: rgba(0,0,0,0.7);
	color: white;
	font-size: 1.3rem;
	z-index: 999;
}

@media screen and (orientation: portrait) {
#rotate-warning {
	display: flex;
}
}
/* =========================================
   🕹️ Fester virtueller Joystick (leicht nach innen versetzt)
   ========================================= */
#joystick-base {
	position: fixed;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35); /* etwas weniger transparent */
	border: 2px solid rgba(255, 255, 255, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 50;
	touch-action: none;
	right: 100px;   /* 👈 weiter nach links versetzt (vorher 20px) */
	bottom: 25px;   /* leicht über unterem Rand */
}
#joystick-knob {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	border: 2px solid rgba(255, 255, 255, 0.9);
	transition: transform 0.05s linear;
	pointer-events: none;
}
/* ================================
   ℹ️ Info-Button (oben rechts)
================================ */
.info-button {
	position: absolute;
	top: 1.5%;
	right: 2%;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #ffed00; /* Gelb */
	color: #000;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.3rem;
	cursor: pointer;
	z-index: 1000;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.info-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}
/* Das "i"-Symbol */
.info-symbol {
	font-family: Arial, sans-serif;
	font-weight: 700;
	pointer-events: none;
}
/* ================================
   🧾 Info-Overlay
================================ */
#info-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
}
#info-overlay.hidden {
	display: none;
}
#info-box {
	background: white;
	color: black;
	padding: 30px;
	border-radius: 12px;
	width: 85%;
	max-width: 400px;
	text-align: left;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}
#info-box h2 {
	text-align: center;
	margin-bottom: 10px;
	font-size: 1.5rem;
}
#info-box ul {
	margin: 10px 0 0 18px;
	padding: 0;
	line-height: 1.4;
}
#close-info-btn {
	display: block;
	margin: 20px auto 0 auto;
	background: #ffed00;
	color: black;
	border: none;
	border-radius: 8px;
	padding: 8px 18px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.3s;
}
#close-info-btn:hover {
	background: #e5d500;
}
/*NEU HIGHSCORE */
	
/* Highscore-Liste Game Over */
.gameover-highscores {
	margin: 15px auto 20px auto; /* mittig */
	padding: 12px 16px;
	width: 90%;
	max-width: 500px;
	text-align: center;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	font-size: 16px;
	color: #333;
}
.gameover-highscores strong {
	display: block;
	margin-bottom: 10px;
	font-size: 18px;
}
#highscore-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
#highscore-list li {
	padding: 8px 10px;
	border-bottom: 1px solid #ddd;
	font-weight: 500;
	display: flex;
	justify-content: space-between;
}
#highscore-list li:last-child {
	border-bottom: none;
}
/* Eigener Score, falls nicht in Top 5 */
#highscore-list li.self-score {
	background: #e6f7ff; /* dezente Hervorhebung */
	font-weight: 600;
	margin-top: 6px;
	border-radius: 6px;
}
/* Profil-Button Hover-Animation */
#profile-btn {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#profile-btn:hover {
	transform: scale(1.1); /* leicht vergrößern */
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* sanfter Schatten */
}
.hidden {
	display: none;
}



#score {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 3px solid #FFED00;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 20px;
    backdrop-filter: blur(10px);
}

#score img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: coin-spin 3s linear infinite;
}

@keyframes coin-spin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

#speed {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
    color: #FFED00;
    padding: 10px 25px;
    border-radius: 20px;
    border: 2px solid #FFED00;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255,237,0,0.3);
    backdrop-filter: blur(10px);
}


/* ========================================
      
      .gameover-highscores strong {
        font-size: 0.75rem !important;
        margin-bottom: 3px !important;
      }
      
      #highscore-list {
        font-size: 0.65rem !important;
      }
      
      #highscore-list li {
        padding: 2px 4px !important;
        margin: 0.5px 0 !important;
        font-size: 0.65rem !important;
      }
      
      /* Logo minimal */
      .gameover-row .sponsor-box {
        max-width: 70px !important;
        padding: 4px 5px !important;
      }
      
      /* Restart Button kompakt */
      #restart-btn {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
      }
      
      /* Game Over Row kompakter */
      .gameover-row {
        gap: 8px !important;
      }
    }
    /* ========================================
       ?? LANDSCAPE MODUS
    ======================================== */
    @media (max-height: 600px) and (orientation: landscape) {
      /* Highscore im Landscape */
      .gameover-highscores {
        padding: 4px 6px !important;
        margin: 4px auto !important;
        max-width: 90% !important;
        font-size: 11px !important;
      }
      
      .gameover-highscores strong {
        font-size: 0.7rem !important;
        margin-bottom: 3px !important;
      }
      
      #highscore-list {
        font-size: 0.6rem !important;
      }
      
      #highscore-list li {
        padding: 2px 4px !important;
        margin: 0.5px 0 !important;
        font-size: 0.6rem !important;
      }
      
      /* Logo im Landscape Modus */
      .gameover-row .sponsor-box {
        max-width: 70px !important;
        padding: 4px 5px !important;
      }
      
      #restart-btn {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
      }
    }