/* DolphinDragon — play.mcgrinsey.com
   Safe-Area-Doktrin: oben links (bis ca. 220px) leben die beiden Orbs,
   dort liegt NICHTS vom Spiel. HUD-Zahlen oben rechts, untere Ecken
   bleiben fuer Touch frei (nur der Boost-Knopf unten rechts). */

:root { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #071a26;
  font-family: var(--mcg-sans, "Poppins", sans-serif);
  color: #e6f4fa;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ===== HUD oben rechts ===== */
#hud {
  position: fixed; top: 12px; right: 14px; z-index: 20;
  text-align: right; pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
#hud-score {
  font-family: var(--mcg-mono, monospace);
  font-size: clamp(26px, 4.5vw, 40px); font-weight: 700;
  color: #ffd97a; line-height: 1;
}
#hud-time {
  font-family: var(--mcg-mono, monospace);
  font-size: clamp(15px, 2.4vw, 20px); color: #bfe6f5; margin-top: 4px;
}
#hud-combo {
  display: inline-block; margin-top: 6px; padding: 2px 10px;
  border-radius: 999px; background: rgba(89,247,226,.16);
  border: 1px solid rgba(89,247,226,.5);
  font-family: var(--mcg-mono, monospace); font-size: 15px; color: #59f7e2;
}
#hud-pyra {
  display: inline-block; margin-top: 6px; margin-left: 6px; padding: 2px 10px;
  border-radius: 999px; background: rgba(255,207,94,.18);
  border: 1px solid rgba(255,207,94,.65);
  font-family: var(--mcg-mono, monospace); font-size: 15px; color: #ffd97a;
}
#hud-player { margin-top: 6px; font-size: 12px; color: #9fc6d8; }
#hud-mode {
  margin-top: 6px; font-family: var(--mcg-mono, monospace);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9fc6d8;
}
#hud-lives { margin-top: 4px; font-size: 16px; letter-spacing: 3px; color: #ff6b6b; }
#hud-warn {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  z-index: 22; pointer-events: none;
  padding: 6px 16px; border-radius: 999px;
  background: rgba(120, 20, 20, .55); border: 1px solid rgba(255,120,80,.7);
  color: #ffd0b8; font-family: var(--mcg-mono, monospace); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
}
#mode-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mode-chip {
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(89,247,226,.28); background: rgba(10,24,34,.55);
  color: #9fc6d8; font-family: var(--mcg-sans, sans-serif); font-size: 14px;
}
.mode-chip.an { border-color: #59f7e2; color: #59f7e2; background: rgba(89,247,226,.16); }

/* Score + Zeit brauchen den Platz oben rechts. Das Arcade-Altersfeld
   haengt sonst auf der Punktzahl (SDK-Default top:64). */
#arcade-alter { top: 140px !important; }

/* Hoehen/Tiefen-Anzeige unten mittig */
#hud-alt {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 20; pointer-events: none;
  font-family: var(--mcg-mono, monospace); font-size: 13px;
  color: #9fc6d8; text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

/* Ring-Kompass */
#ring-arrow {
  position: fixed; left: 50%; bottom: 46px; z-index: 20;
  transform: translateX(-50%) rotate(0deg);
  font-size: 26px; color: #ffd97a; pointer-events: none;
  text-shadow: 0 0 12px rgba(255,174,0,.8);
  transition: color .3s;
}
#ring-arrow.sea { color: #59f7e2; text-shadow: 0 0 12px rgba(25,201,201,.8); }

/* Boost (Touch) unten rechts */
#boost-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 25;
  width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid rgba(255,217,122,.65);
  background: radial-gradient(circle at 35% 30%, rgba(255,217,122,.28), rgba(20,32,44,.75));
  color: #ffd97a; font-family: var(--mcg-sans, sans-serif);
  font-size: 15px; font-weight: 700; letter-spacing: .06em;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
#boost-btn:active { background: radial-gradient(circle at 35% 30%, rgba(255,217,122,.55), rgba(20,32,44,.8)); }
@media (hover: hover) and (pointer: fine) { #boost-btn { display: none !important; } }

/* Ende-Knopf der Infinite-Modi: oben mittig, unauffaellig, bis man ihn braucht */
#hud-end {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 25;
  padding: 6px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,217,122,.45); background: rgba(10,24,34,.55);
  color: #ffd97a; font-family: var(--mcg-mono, monospace); font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
}
#hud-end:hover { background: rgba(255,217,122,.18); }

/* ===== Overlays ===== */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(7,26,38,.55), rgba(4,14,22,.88));
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.overlay h1 {
  margin: 0; font-size: clamp(38px, 9vw, 76px); font-weight: 800;
  letter-spacing: .01em; color: #cfe8ee; line-height: 1.05;
  text-shadow: 0 4px 30px rgba(89,247,226,.35);
}
.overlay h1 span { color: #59f7e2; }
.overlay h2 { margin: 0; font-size: clamp(26px, 6vw, 44px); color: #cfe8ee; }
#menu-sub { margin: 0; max-width: 560px; color: #bfe6f5; font-size: clamp(14px, 2.6vw, 17px); }
#menu-controls {
  display: grid; grid-template-columns: auto auto; gap: 4px 16px;
  font-size: 13.5px; color: #9fc6d8; text-align: left;
  background: rgba(10,24,34,.6); border: 1px solid rgba(89,247,226,.18);
  border-radius: 12px; padding: 12px 18px;
}
#menu-controls b { color: #e6f4fa; font-weight: 600; font-family: var(--mcg-mono, monospace); }
.big-btn {
  padding: 14px 44px; border-radius: 999px; border: 2px solid #59f7e2;
  background: linear-gradient(180deg, rgba(89,247,226,.22), rgba(89,247,226,.06));
  color: #59f7e2; font-family: var(--mcg-sans, sans-serif);
  font-size: 19px; font-weight: 700; letter-spacing: .05em; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.big-btn:hover { background: rgba(89,247,226,.3); color: #071a26; }
.tiny { font-size: 12px; color: #7ca3b5; margin: 0; }

#over-score {
  font-family: var(--mcg-mono, monospace);
  font-size: clamp(44px, 10vw, 80px); font-weight: 700; color: #ffd97a;
  text-shadow: 0 0 30px rgba(255,174,0,.4); line-height: 1;
}
#over-stats { font-size: 15px; color: #bfe6f5; }

#nogpu p { max-width: 460px; color: #bfe6f5; line-height: 1.55; }

/* Eintauch-Blitz */
#splash-flash {
  position: fixed; inset: 0; z-index: 15; pointer-events: none;
  background: rgba(220,231,234,.55); opacity: 0;
}
#splash-flash.zisch { animation: zisch .45s ease-out; }
@keyframes zisch { 0% { opacity: .8; } 100% { opacity: 0; } }

/* ===== Game-Orb (gold) + Look-Menue =====
   z-index ueber den Overlays (40): der Orb muss auch auf dem Start- und
   Ende-Bild erreichbar sein, dort will man den Soundtrack umschalten. */
#dd-orb {
  position: fixed; left: 70px; top: 12px; z-index: 45;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(255, 205, 100, 0.75);
  background: radial-gradient(circle at 32% 28%, rgba(255, 217, 122, 0.4), rgba(30, 24, 10, 0.78));
  font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 174, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}
#dd-orb:hover { box-shadow: 0 0 20px rgba(255, 174, 0, 0.6); }
#dd-menu {
  position: fixed; left: 70px; top: 66px; z-index: 45;
  min-width: 190px; padding: 12px;
  max-height: calc(100vh - 80px); overflow-y: auto;   /* drei Abschnitte: auf flachen Schirmen scrollt das Menue */
  border-radius: 14px; border: 1px solid rgba(255, 205, 100, 0.4);
  background: rgba(14, 18, 26, 0.92); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 6px;
}
.dd-menu-title {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #ffd97a; margin-bottom: 2px;
}
.dd-look {
  padding: 8px 12px; border-radius: 9px; text-align: left;
  border: 1px solid rgba(159, 198, 216, 0.25);
  background: rgba(20, 32, 44, 0.6); color: #cfe8ee;
  font-family: var(--mcg-sans, sans-serif); font-size: 14px; cursor: pointer;
}
.dd-look:hover { border-color: rgba(89, 247, 226, 0.5); }
.dd-look.active {
  border-color: #59f7e2; color: #59f7e2;
  background: rgba(89, 247, 226, 0.12);
}
.dd-look:disabled { opacity: .45; cursor: default; }
.dd-menu-hint { font-size: 11px; color: #7ca3b5; margin-top: 2px; }
/* laufender Soundtrack-Titel im Orb (musik.js meldet jeden Wechsel) */
.dd-musik-titel { color: #59f7e2; font-family: var(--mcg-mono, monospace); }
.dd-musik-titel:empty { display: none; }

/* Nerd-Stats: klein, halbtransparent, unter den Orbs links. */
#dd-stats {
  position: fixed; left: 12px; bottom: 88px; z-index: 20;
  min-width: 228px; max-width: min(340px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 210, 90, 0.28);
  background: rgba(6, 12, 18, 0.55);
  backdrop-filter: blur(5px);
  color: #d5e6ec;
  font-family: var(--mcg-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 11px; line-height: 1.45;
  pointer-events: none;
}
#dd-stats b { color: #ffd97a; font-weight: 600; letter-spacing: 0.06em; }
