/* =========================
   🎮 BASE / RESET
========================= */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    font-family: Arial, sans-serif;
    color: #e6e0ff;

    background: radial-gradient(circle at center, #0a0a12, #000 80%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;

    background:
        radial-gradient(circle at 50% 30%, rgba(109,96,157,0.15), transparent),
        radial-gradient(circle at center, #0a0a12, #000 80%);
    pointer-events: none;
}

#gameWrapper {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;
}

#game {
    position: relative;
    touch-action: none;
    width: 800px;
    height: 800px;

    overflow: hidden;

    border-radius: 12px;

    border: 1px solid rgba(109, 96, 157, 0.6);

    box-shadow:
        0 0 20px rgba(109,96,157,0.5),
        0 0 60px rgba(109,96,157,0.2),
        inset 0 0 30px rgba(109,96,157,0.1);
}

#game::before {
    content: "";
    position: absolute;
    inset: -2px;

    border-radius: 14px;

    box-shadow:
        0 0 25px rgba(109,96,157,0.6),
        0 0 60px rgba(109,96,157,0.3);

    pointer-events: none;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
    #game {
        border-radius: 8px;
    }

    #score {
        font-size: 14px;
    }

    #musicToggle {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .overlay-screen h1 {
        font-size: 32px;
    }

    .overlay-screen p {
        font-size: 14px;
    }
}
/* =========================
   📊 UI
========================= */
#ui {
    top: 20px;
    left: 20px;

    font-size: 18px;
    letter-spacing: 1px;

    color: #b8aaff;
    text-shadow: 0 0 10px #6D609D;

    opacity: 0.9;
}

#score {
    position: absolute;
    top: 12px;
    left: 15px;

    font-size: 16px;
    color: #cbb6ff;

    z-index: 10;
}

#musicToggle {
    position: absolute;
    top: 12px;
    right: 15px;

    width: 40px;
    height: 40px;

    border-radius: 10px;
    border: 1px solid #6D609D;

    background: rgba(0,0,0,0.5);
    color: #e6e0ff;

    font-size: 16px;

    cursor: pointer;

    z-index: 10;
}

#musicToggle:hover {
    background: #6D609D;
    color: black;

    box-shadow: 0 0 15px #6D609D;
}

.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);

    z-index: 9999;
    
    background: rgba(10, 10, 20, 0.95);
    color: #cbb6ff;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(180, 140, 255, 0.2);

    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(5px);
}

/* =========================
   🚀 START SCREEN
========================= */
.diamond {
    margin-right: 10px;
    filter: drop-shadow(0 0 10px #6D609D);
}

#startScreen h1 {
    font-size: 56px;
    margin-bottom: 10px;

    color: #e6e0ff;

    text-shadow:
        0 0 20px #6D609D,
        0 0 40px rgba(109,96,157,0.6);
}

#startScreen .subtitle {
    color: #b8aaff;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* Controls Box */
#startScreen .controls {
    margin-bottom: 30px;
    padding: 15px 25px;

    border-radius: 12px;
    border: 1px solid rgba(109,96,157,0.4);

    background: rgba(20, 20, 40, 0.4);

    box-shadow: 0 0 20px rgba(109,96,157,0.2);
}

#startScreen .controls p {
    margin: 6px 0;
    color: #d6ccff;
    font-size: 14px;
}

/* Start Hint */
#startScreen .start-hint {
    margin-top: 20px;

    color: #6D609D;
    font-size: 16px;

    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* =========================
    PAUSE
========================= */
#pauseScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#pauseScreen > * {
    backdrop-filter: blur(6px);
}

/* Titel */
#pauseScreen h1 {
    font-size: 56px;
    color: #e6e0ff;

    text-shadow:
        0 0 20px #6D609D,
        0 0 40px rgba(109,96,157,0.6);

    margin-bottom: 30px;
}

#pauseScreen button,
#pauseScreen a {
    display: inline-block;

    margin: 10px;
    padding: 14px 30px;

    border-radius: 10px;
    border: 1px solid #6D609D;

    background: transparent;
    color: #e6e0ff;

    text-decoration: none;
    font-size: 16px;

    transition: all 0.25s ease;

    cursor: pointer;
}

/* Hover */
#pauseScreen button:hover,
#pauseScreen a:hover {
    background: #6D609D;
    color: black;

    box-shadow: 0 0 20px #6D609D;

    transform: scale(1.05);
}

/* =========================
   🎯 PLAYER
========================= */

#player {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    top: 0;

    background: radial-gradient(circle, #b8aaff, #6D609D);

    box-shadow:
        0 0 10px #6D609D,
        0 0 25px #6D609D,
        0 0 50px rgba(109,96,157,0.6);

    animation: playerPulse 1.5s ease-in-out infinite;
}

@keyframes playerPulse {
    0% { box-shadow: 0 0 10px #6D609D; }
    50% { box-shadow: 0 0 30px #b8aaff; }
    100% { box-shadow: 0 0 10px #6D609D; }
}


/* =========================
   ✨ PLAYER TRAIL
========================= */

.trail-line {
    position: absolute;

    height: 8px;
    border-radius: 8px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(184,170,255,0.9),
        rgba(109,96,157,0.8),
        transparent
    );

    opacity: 0.8;

    filter: blur(6px);

    pointer-events: none;

    transition: opacity 0.15s linear;
}

/* =========================
   🟥 OBSTACLES
========================= */

.obstacle {
    position: absolute;

    background: linear-gradient(135deg, #ff004c, #8a0030);

    box-shadow:
        0 0 15px rgba(255,0,76,0.8),
        0 0 30px rgba(255,0,76,0.4);

    animation: obstacleGlow 1.5s ease-in-out infinite;
}

@keyframes obstacleGlow {
    0% { box-shadow: 0 0 10px rgba(255,0,76,0.5); }
    50% { box-shadow: 0 0 30px rgba(255,0,76,1); }
    100% { box-shadow: 0 0 10px rgba(255,0,76,0.5); }
}

.obstacle[data-type="wide"] {
    opacity: 0.85;
}

.obstacle[data-type="big"] {
    box-shadow: 0 0 25px rgba(255,0,76,0.9);
}
/* =========================
   💎 ORBS
========================= */

.orb {
    border-radius: 50%;

    background: radial-gradient(circle, #ffffff, #6D609D);

    position: absolute;

    box-shadow:
        0 0 10px #b8aaff,
        0 0 25px rgba(184,170,255,0.8);

    animation: orbPulse 1s ease-in-out infinite;
}

@keyframes orbPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* =========================
   🎬 OVERLAY SCREENS
========================= */
.overlay-screen {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);

    z-index: 50;
}

.overlay-screen h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.overlay-screen p {
    color: #b8aaff;
    opacity: 0.8;
}

#startScreen {
    display: flex;
}

/* =========================
   💀 GAME OVER SCREEN
========================= */
#gameOver {
    position: fixed;
    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);

    text-align: center;
}

/* Container Feel */
#gameOver h1 {
    font-size: 48px;
    margin-bottom: 10px;

    color: #fff;

    text-shadow:
        0 0 20px rgba(255,0,76,0.8),
        0 0 40px rgba(255,0,76,0.4);
}

#gameOver p {
    margin-bottom: 20px;
    color: #b8aaff;
}


/* =========================
   🔘 BUTTONS (DEIN STYLE)
========================= */
#gameOver button,
#gameOver a {
    display: inline-block;

    margin: 10px;
    padding: 12px 28px;

    border-radius: 8px;
    border: 1px solid #6D609D;

    color: #e6e0ff;
    text-decoration: none;

    background: transparent;

    transition: 0.25s ease;
}

#gameOver button:hover,
#gameOver a:hover {
    background: #6D609D;
    color: black;

    box-shadow: 0 0 20px #6D609D;

    transform: scale(1.05);
}

.save-btn {
    border: 1px solid gold;
    box-shadow: 0 0 20px gold;
}

/* ==============================
    Animations
============================== */

@keyframes shake {
  0%   { transform: translate(0px, 0px); }
  25%  { transform: translate(6px, -4px); }
  50%  { transform: translate(-6px, 4px); }
  75%  { transform: translate(4px, -3px); }
  100% { transform: translate(0px, 0px); }
}

.shake {
  animation: shake 0.25s ease;
}

.flash {
    animation: flashEffect 0.15s ease;
}

@keyframes flashEffect {
    0% {
        filter: brightness(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(2.5);
        transform: scale(1.2);
    }
    100% {
        filter: brightness(1);
        transform: scale(1);
    }
}