/* -------------------------------------------------
   GAME SCREEN
-------------------------------------------------- */

.game-area {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top, #050916 0%, #020309 45%, #000 100%);
}

/* WORLD – posouvací pozadí */

.world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.scroll-track {
  display: flex;
  width: 200%;                  /* důležité pro plynutí */
  height: 100%;
  filter: grayscale(1);
  transition: filter 0.3s ease-out, opacity 0.3s ease-out;
  animation: scrollLeft 18s linear infinite;
  pointer-events: none;
  opacity: 0;
  background: #000;
}

.scroll-track img {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  object-fit: cover;            /* vyplní plochu, zachovává feel "svět plyne" */
  object-position: center center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* ANIMACE – posun doleva o polovinu šířky */

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* jemné doladění pro extrémní poměry stran */

/* hodně vysoké displeje (např. hodně na výšku) */
@media (max-aspect-ratio: 3/4) {
  .scroll-track img {
    object-position: center 45%;
  }
}

/* ultraširoké monitory */
@media (min-aspect-ratio: 21/9) {
  .scroll-track img {
    object-position: 50% 40%;
  }
}

/* -------------------------------------------------
   HUD – nahoře jen MENU + waveform dole
-------------------------------------------------- */

.hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* skryjeme prvky, které v tomhle artovém módu nepoužíváme */
#restartBtn,
#muteBtn,
#scoreInfo,
#statusText {
  display: none !important;
}

/* tlačítko MENU – neon styl z .btn, jen menší */
#backToMenuInHud.btn {
  padding: 6px 16px;
  font-size: 12px;
}

/* -------------------------------------------------
   Timeline skladby – dole uprostřed jako stylizovaná waveform
-------------------------------------------------- */

#timeInfo {
  --progress: 0;
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 420px;
  height: 60px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(120, 200, 255, 0.35);
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.8),
    0 0 28px rgba(0, 200, 255, 0.38);
  color: #d6ecff;
  padding: 6px 16px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  z-index: 30;
}

/* řádek s waveform + tlačítkem */

.waveform-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 20px;
}

/* tlačítko play/pause */

.track-btn {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(120, 200, 255, 0.5);
  background: rgba(0, 0, 0, 0.6);
  color: #d6ecff;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.track-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(120, 200, 255, 0.5);
  transform: translateY(-1px);
}

/* waveform vedle tlačítka */

.waveform {
  position: absolute;
  left: 32px;
  right: 0;
  top: 0;
  bottom: 0;
  width: auto;
  height: 100%;
}

/* společný tvar */

.waveform-shape {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* šedé pozadí */

.waveform-bg .waveform-shape {
  stroke: rgba(155, 175, 205, 0.6);
  stroke-width: 1.2;
}

/* barevná část – roztahuje se podle --progress */

.waveform-fg {
  transform-origin: left center;
  transform: scaleX(var(--progress));
}

.waveform-fg .waveform-shape {
  stroke-width: 1.5;
  stroke: #00e2ff;
  filter: drop-shadow(0 0 4px rgba(0, 226, 255, 0.9))
          drop-shadow(0 0 8px rgba(0, 120, 255, 0.7));
}

/* název skladby */

.track-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* -------------------------------------------------
   HUD – spodní stats vypnuto
-------------------------------------------------- */

.hud-bottom {
  display: none;
}

.stats {
  display: none !important;
}

/* -------------------------------------------------
   OVERLAYS (výsledky apod.)
-------------------------------------------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(0, 200, 255, 0.16), transparent 55%),
    rgba(0, 0, 0, 0.85);
}

.overlay-hidden {
  display: none;
}

.overlay-panel {
  background: rgba(8, 10, 18, 0.96);
  padding: 24px 30px 22px;
  border-radius: 22px;
  max-width: 520px;
  width: 90%;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 1),
    0 0 70px rgba(0, 200, 255, 0.4);
  text-align: left;
  border: 1px solid rgba(120, 200, 255, 0.4);
}

.overlay-panel h1,
.overlay-panel h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #eaf8ff;
  text-shadow:
    0 0 10px rgba(0, 200, 255, 0.7),
    0 0 24px rgba(0, 80, 255, 0.7);
}

.overlay-panel p {
  margin: 4px 0;
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
}

.overlay-panel ul {
  text-align: left;
  font-size: 14px;
  margin: 10px 0 14px 0;
  padding-left: 18px;
  opacity: 0.9;
}

.overlay-panel small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.status-message {
  color: #7cf2ff;
  font-size: 13px;
  opacity: 0.9;
}

.image-status {
  font-size: 12px;
  margin-top: 6px;
}

.image-status.ok { color: #80ff80; }
.image-status.error { color: #ff8080; }

/* -------------------------------------------------
   Intro levelu – minimalistický artový úvod
-------------------------------------------------- */

.overlay-intro {
  background: #000;
}

.overlay-intro .overlay-panel {
  max-width: 640px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 32px 24px;
  text-align: center;
}

/* textové řádky – fade + lehký posun + rozostření */

.intro-panel .intro-line {
  font-size: 16px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px);
  filter: blur(3px);
  animation: introFade 1.3s ease-out forwards;
}

.intro-panel .intro-line-1 { animation-delay: 0.4s; }
.intro-panel .intro-line-2 { animation-delay: 1.4s; }
.intro-panel .intro-line-3 { animation-delay: 2.4s; }

@keyframes introFade {
  0% {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* tlačítko "Spustit level" – jemné, textové */

.intro-start {
  margin-top: 32px;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #f5f5f5;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: introFade 1.3s ease-out forwards;
  animation-delay: 3.4s;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
}

.intro-start:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* "Zpět do menu" – malý nenápadný text */

.intro-back {
  margin-top: 10px;
  display: inline-block;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: introFade 1.3s ease-out forwards;
  animation-delay: 3.9s;
}

.intro-back:hover {
  color: rgba(255, 255, 255, 0.9);
}

.overlay-intro .image-status {
  margin-top: 12px;
  font-size: 11px;
  opacity: 0.4;
}

/* -------------------------------------------------
   CUSTOM CURSOR – LIGHT ORB
   + ROZLIŠENÍ MYŠ vs. PRST
-------------------------------------------------- */

html,
body {
  /* kurzor řešíme níž podle pointeru; tady jen chování dotyku */
  touch-action: none;
}

#world {
  touch-action: none;
}

/* základní styl orb světýlka */

#cursorLight {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #88eaff 0%, #44aaff 25%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.8;
  transition: width 0.15s ease, height 0.15s ease, opacity 0.25s ease;
  filter: blur(3px);
  display: none; /* defaultně skryté, zapneme jen pro myš */
}

/* klik – zablesknutí */

#cursorLight.click {
  width: 34px;
  height: 34px;
  opacity: 1;
}

/* Všechno interaktivní má defaultní kurzor,
   konkrétní chování přepneme v media queries níž */

button,
a,
[role="button"],
.btn,
#menuScreen,
#gameScreen,
#world {
  cursor: auto;
}

/* Zařízení s FINE pointerem (myš, trackpad) → zobraz kurzor world-ORB */

@media (any-pointer: fine) {
  html,
  body {
    cursor: none;
  }

  button,
  a,
  [role="button"],
  .btn,
  #menuScreen,
  #gameScreen,
  #world {
    cursor: none !important;
  }

  #cursorLight {
    display: block;
  }
}

/* Zařízení s COARSE pointerem (prst) → orb vůbec nezobrazuj */

@media (any-pointer: coarse) {
  #cursorLight {
    display: none;
  }
}

/* -------------------------------------------------
   GAME UI – responzivní HUD a overlaye
-------------------------------------------------- */

/* tablety / menší notebooky */

@media (max-width: 1024px) {
  .hud-top {
    top: 10px;
    left: 10px;
  }

  #backToMenuInHud.btn {
    padding: 4px 12px;
    font-size: 11px;
  }

  #timeInfo {
    min-width: 0;
    width: 75vw;
    max-width: 420px;
    bottom: 12px;
    padding: 6px 14px 8px;
    font-size: 11px;
  }

  .waveform-wrap {
    height: 18px;
  }

  .track-btn {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .overlay-panel {
    width: 85vw;
    max-width: 520px;
    padding: 20px 20px 18px;
  }
}

/* mobily / úzké zobrazení – zen panel opravdu malý, nenápadný */

@media (max-width: 600px) {
  .hud-top {
    top: 8px;
    left: 8px;
  }

  #timeInfo {
    left: 50%;
    transform: translateX(-50%);
    min-width: 150px;
    max-width: 180px;
    width: auto;
    height: 30px;
    bottom: 8px;
    padding: 3px 6px 4px;
    font-size: 8.5px;
    border-radius: 999px;
    box-shadow:
      0 0 10px rgba(0, 0, 0, 0.6),
      0 0 16px rgba(0, 200, 255, 0.3);
  }

  .waveform-wrap {
    height: 9px;
    gap: 4px;
  }

  .track-btn {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    font-size: 7px;
    border-width: 1px;
    padding: 0;
  }

  .waveform {
    left: 20px;
  }

  .waveform-bg .waveform-shape {
    stroke-width: 0.9;
  }

  .waveform-fg .waveform-shape {
    stroke-width: 1.0;
  }

  .overlay-panel {
    width: 92vw;
    max-width: none;
    padding: 18px 16px 16px;
    border-radius: 16px;
  }

  .overlay-panel h1,
  .overlay-panel h2 {
    font-size: 16px;
  }

  .overlay-panel p,
  .overlay-panel li,
  .overlay-panel small {
    font-size: 13px;
  }

  .track-title {
    display: none; /* na mobilu šetříme místo */
  }
}

/* extra malé telefony */

@media (max-width: 400px) {
  #timeInfo {
    min-width: 140px;
    max-width: 170px;
    height: 28px;
    padding: 2px 5px 4px;
    font-size: 8px;
  }

  .waveform-wrap {
    height: 8px;
  }

  .track-btn {
    width: 13px;
    height: 13px;
    font-size: 7px;
  }

  .waveform {
    left: 18px;
  }
}

/* velké / ultraširoké monitory */

@media (min-width: 1800px) {
  .hud-top {
    top: 24px;
    left: 24px;
  }

  #timeInfo {
    transform: translateX(-50%) scale(1.08);
  }

  .overlay-panel {
    max-width: 640px;
  }
}


/* -------------------------------------------------
   Combo FLASH – na chvilku plně vybarví obrázek
-------------------------------------------------- */
#scrollTrack.flash-fullcolor {
  opacity: 1 !important;
  filter: grayscale(0) brightness(1.08) !important;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

/* -------------------------------------------------
   Combo FLASH – na chvilku plně vybarví obrázek
-------------------------------------------------- */
.scroll-track.flash-fullcolor {
  opacity: 1 !important;
  filter: grayscale(0) brightness(var(--flashStrength, 1.2)) !important;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

/* -------------------------------------------------
   COMBO POPUP – vizuální info o combu
-------------------------------------------------- */
.combo-popup {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(180, 240, 255, 0.85);
  color: #e6f7ff;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 40;
  box-shadow:
    0 0 18px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 180, 255, 0.6);
  animation: comboPopupAnim 0.9s ease-out forwards;
}

.combo-popup span {
  font-weight: 700;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(0, 220, 255, 0.9),
    0 0 16px rgba(0, 120, 255, 0.7);
}


@keyframes comboPopupAnim {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -22%) scale(1.03);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(1.0);
  }
}

/* -------------------------------------------------
   Lokální ripple – okno, které vytáhne barvu obrázku
-------------------------------------------------- */
.color-burst {
  position: absolute;
  width: 22vmin;
  height: 22vmin;
  border-radius: 50%;
  pointer-events: none;

  /* start v menší velikosti – animace to zvětší */
  transform: translate(-50%, -50%) scale(0.6);

  /* jemný světlý prstenec, ne vlastní barva */
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, 0)    0%,
      rgba(255, 255, 255, 0)   40%,
      rgba(255, 255, 255, 0.18) 60%,
      rgba(255, 255, 255, 0)   100%
    );

  /* “vytahuje” barvu pod kruhem */
  backdrop-filter:
    saturate(var(--burst-saturate, 1.9))
    brightness(var(--burst-bright, 1.1));

  mix-blend-mode: color-dodge;

  opacity: 1;
  animation: colorBurstRipple 0.65s ease-out forwards;

  /* KLÍČOVÉ – pod duší (z-index 5), ale nad pozadím (1) */
  z-index: 3;
}

@keyframes colorBurstRipple {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.95;
  }
  55% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.9);
    opacity: 0;
  }
}


/* -------------------------------------------------
   Výsledky – měna + uložení vizuálu
-------------------------------------------------- */

.currency-info{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  line-height: 1.3;
}

.result-actions{
  margin-top: 14px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
