/* ===========================================
   === OZZY TRIBUTE v4.0 – INTERAKTIVE FEATURES ===
   Hero, Timeline-Filter, Riff-Maschine, Erfolge, Konami
   =========================================== */

/* ---------- BASE ---------- */
html { overflow-x: clip; scroll-behavior: smooth; }

/* ---------- HERO ---------- */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    cursor: crosshair;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.hero-content {
    z-index: 10;
    text-align: center;
    pointer-events: none;
    padding: 0 1rem;
    transform: translate3d(var(--px, 0), var(--py, 0), 0);
    transition: transform 0.25s ease-out;
}

#hero .hero-title {
    transform: perspective(600px) rotateX(var(--rx, 10deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s ease-out;
}

.hero-hint {
    font-size: 0.85rem;
    letter-spacing: 0.08rem;
    color: rgba(255, 220, 200, 0.7);
    animation: heroHintPulse 2.8s ease-in-out infinite;
}

@keyframes heroHintPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

.hero-scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Metal Mania', cursive;
    font-size: 1.05rem;
    letter-spacing: 0.1rem;
    color: #ffb3b3;
    cursor: pointer;
}

.hero-scroll-cue:hover { color: #fff; }

.hero-scroll-cue__mouse {
    width: 26px;
    height: 42px;
    border: 2px solid currentColor;
    border-radius: 14px;
    position: relative;
}

.hero-scroll-cue__mouse::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 7px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: #ff2a2a;
    animation: scrollWheel 1.6s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}

/* ---------- NAV SCROLLSPY ---------- */
.header-nav a.is-current {
    background: rgba(255, 0, 0, 0.25);
    color: #ff4d4d;
    box-shadow: inset 0 -2px 0 #ff0000;
}

/* ---------- TIMELINE FILTER ---------- */
.timeline-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.2rem auto 0;
    max-width: 900px;
}

.filter-chip {
    min-height: 40px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.45);
    color: #ddd;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
}

.filter-chip:hover { border-color: #ff2a2a; transform: translateY(-2px); }

.filter-chip.is-active {
    background: linear-gradient(135deg, #ff0000, #8b0000);
    border-color: #ff6b6b;
    color: #fff;
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.45);
}

.timeline-v2-item {
    transition: opacity 0.45s ease, filter 0.45s ease, transform 0.6s ease-out !important;
}

.timeline-v2-item.is-dimmed {
    opacity: 0.18 !important;
    filter: grayscale(1) blur(1px);
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 50%;
    width: 8px;
    margin-left: -4px;
    height: 0;
    border-radius: 6px;
    background: linear-gradient(to bottom, #ffcc00, #ff4400 40%, #ff0000);
    box-shadow: 0 0 14px #ff4400, 0 0 30px rgba(255, 0, 0, 0.7);
    z-index: 3;
    pointer-events: none;
    transition: height 0.15s linear;
}

.timeline-progress::after {
    content: '🔥';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    filter: drop-shadow(0 0 6px #ff6600);
}

/* ---------- RIFF MACHINE ---------- */
.riff-machine {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 0, 0, 0.45);
    background: linear-gradient(160deg, rgba(20, 0, 0, 0.92), rgba(10, 10, 10, 0.95));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(255, 0, 0, 0.07);
}

.riff-visualizer {
    display: block;
    width: 100%;
    height: 110px;
    margin-bottom: 1rem;
    border-radius: 12px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 24px),
        rgba(0, 0, 0, 0.55);
    border: 1px solid #2a0a0a;
}

.riff-pads {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.6rem;
}

.riff-pad {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 92px;
    border-radius: 14px;
    border: 2px solid #3a0d0d;
    background: radial-gradient(circle at 50% 30%, #2d0b0b, #0d0303);
    color: #fff;
    touch-action: manipulation;
    transition: transform 0.08s, border-color 0.2s, box-shadow 0.2s;
}

.riff-pad:hover { border-color: #ff2a2a; }

.riff-pad__note {
    font-family: 'Metal Mania', cursive;
    font-size: 1.4rem;
    color: #ff4d4d;
}

.riff-pad--squeal .riff-pad__note { font-size: 1.05rem; color: #ffcc00; }

.riff-pad kbd { font-size: 0.7rem; opacity: 0.7; }

.riff-pad.is-hit {
    animation: padHit 0.35s ease-out;
}

@keyframes padHit {
    0% { transform: scale(0.92); border-color: #ffcc00; box-shadow: 0 0 34px #ff4400, inset 0 0 26px rgba(255, 120, 0, 0.6); }
    100% { transform: scale(1); }
}

.riff-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

.riff-ctrl {
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.riff-ctrl:disabled { opacity: 0.35; cursor: not-allowed; }

.riff-ctrl.is-recording {
    border-color: #ff0000;
    color: #ff4d4d;
    animation: recBlink 1s steps(2, start) infinite;
}

@keyframes recBlink {
    to { background: rgba(255, 0, 0, 0.18); }
}

.headbang-meter {
    margin-top: 1.2rem;
    text-align: left;
}

.headbang-meter__label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 0.35rem;
}

.headbang-meter__track {
    height: 12px;
    border-radius: 999px;
    background: #1a0606;
    border: 1px solid #3a0d0d;
    overflow: hidden;
}

.headbang-meter__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #8b0000, #ff2a2a 60%, #ffcc00);
    box-shadow: 0 0 12px #ff4400;
    transition: width 0.12s linear;
}

.riff-status {
    margin-top: 0.8rem;
    min-height: 1.6em;
    color: #ccc;
    font-size: 0.9rem;
}

/* ---------- ACHIEVEMENTS ---------- */
.achievements-btn { position: relative; }

.achievement-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
}

.achievement-count.has-unlocks { background: #ff0000; box-shadow: 0 0 10px #ff0000; }

.achievements-btn.is-bumped { animation: trophyBump 0.6s ease; }

@keyframes trophyBump {
    30% { transform: scale(1.35) rotate(-12deg); }
    60% { transform: scale(0.95) rotate(8deg); }
}

.achievements-panel {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.achievements-panel[hidden] { display: none; }

.achievements-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.achievements-panel__card {
    position: relative;
    width: min(640px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.6rem 1.4rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 0, 0, 0.5);
    background: linear-gradient(160deg, #1a0303, #0b0b0b);
    box-shadow: 0 25px 70px rgba(255, 0, 0, 0.25);
    text-align: left;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.achievements-panel.is-open .achievements-panel__card { opacity: 1; transform: none; }

.achievements-panel__card h2 { text-align: center; margin-bottom: 0.3rem; }

.achievements-panel__close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    border: 1px solid #444;
}

.achievements-panel__close:hover { background: #ff0000; }

.achievements-panel__progress { text-align: center; color: #ccc; margin-bottom: 0.5rem; }

.achievements-panel__hint { margin-top: 1rem; font-size: 0.8rem; color: #777; text-align: center; }

.achievement-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0.6;
}

.achievement.is-unlocked {
    opacity: 1;
    border-color: rgba(255, 204, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.08), rgba(255, 0, 0, 0.08));
}

.achievement__icon {
    font-size: 1.8rem;
    filter: grayscale(1);
}

.achievement.is-unlocked .achievement__icon { filter: drop-shadow(0 0 6px rgba(255, 170, 0, 0.8)); }

.achievement__body { display: flex; flex-direction: column; gap: 0.1rem; }
.achievement__body strong { color: #fff; font-size: 0.95rem; }
.achievement__body span { color: #aaa; font-size: 0.8rem; line-height: 1.3; }
.achievement__body .achievement__progress { color: #ff6b6b; font-weight: 700; }

.achievement-pop {
    position: fixed;
    left: 50%;
    bottom: 5.5rem;
    z-index: 100020;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 14px;
    border: 1px solid #ffcc00;
    background: linear-gradient(135deg, #2a0000, #120000);
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.45);
    color: #fff;
    text-align: left;
    transform: translateX(-50%);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.4s, transform 0.4s;
}

.achievement-pop.is-leaving { opacity: 0; transform: translate(-50%, 20px); }
.achievement-pop__icon { font-size: 2rem; }
.achievement-pop small { display: block; color: #ffcc00; letter-spacing: 0.12rem; text-transform: uppercase; font-size: 0.65rem; }
.achievement-pop strong { font-family: 'Metal Mania', cursive; font-size: 1.2rem; }

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, 40px) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- KONAMI BAT SWARM ---------- */
.swarm-bat {
    position: fixed;
    left: -60px;
    z-index: 100005;
    pointer-events: none;
    animation-name: swarmFly;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

@keyframes swarmFly {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30vw, -6vh) rotate(-10deg); }
    50% { transform: translate(55vw, 6vh) rotate(8deg); }
    75% { transform: translate(85vw, -4vh) rotate(-6deg); }
    100% { transform: translate(115vw, 0) rotate(0deg); }
}

/* ---------- LIGHT MODE ---------- */
body.light-mode .riff-machine,
body.light-mode .achievements-panel__card { background: #fafafa; color: #111; }
body.light-mode .riff-pad { background: radial-gradient(circle at 50% 30%, #fff, #eee); color: #111; border-color: #ddd; }
body.light-mode .filter-chip:not(.is-active) { background: #fff; color: #222; border-color: #ccc; }
body.light-mode .achievement__body strong { color: #111; }
body.light-mode .riff-machine .ghost-btn { color: #111; border-color: #bbb; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .timeline-progress { left: 20px; margin-left: 4px; }
    .riff-pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .riff-pad--squeal { grid-column: span 1; }
    .riff-pad kbd { display: none; }
    .hero-scroll-cue { bottom: 1.2rem; }
}

@media (max-width: 480px) {
    .riff-machine { padding: 1rem; }
    .riff-pad { min-height: 76px; }
    .riff-pad__note { font-size: 1.15rem; }
    .achievement-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-content, #hero .hero-title { transform: none !important; transition: none; }
    .hero-hint, .hero-scroll-cue__mouse::after, .riff-ctrl.is-recording { animation: none; }
    .riff-pad.is-hit { animation: none; border-color: #ffcc00; }
    .achievement-pop { animation: none; }
}
