/* =======================================================
   RESET
   ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    font-family: Arial, sans-serif;
	cursor: url("Characters/char.webp") 16 16, auto;
}


/* =======================================================
   KARTE — CONTAINER / WRAPPER / BILD
   ======================================================= */
#map-container {
    position: relative;
    aspect-ratio: 1535 / 1024;
    width: min(100vw, 100dvh * 1535 / 1024);
    height: min(100dvh, 100vw * 1024 / 1535);
    overflow: hidden;
    margin: auto;
}

#map-wrapper {
    position: relative;

    width: 100%;
    height: 100%;
}

#map-image {
    width: 100%;
    height: 100%;

    object-fit: contain;
    image-rendering: auto;

    display: block;
    background: black;

    transition:
        opacity 0.45s ease,
        filter 0.45s ease,
        transform 0.45s ease;
}

#points-container {
    position: absolute;
    inset: 0;
}


/* =======================================================
   KARTENPUNKTE — BASIS
   ======================================================= */
.map-point {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 4px solid black;
	transform: translate(-50%, -50%) rotate(var(--point-angle, 0deg));
    transition: transform 0.2s ease;
    animation: pulse 1.5s infinite;
    opacity: 50%;
    z-index: 5;
	/*cursor: url("Characters/text_tp.webp") 16 16, auto;*/
    /*transform: translate(-50%, -50%);*/
}

.map-point:hover {
    /*transform: translate(-50%, -50%) scale(1.15);*/
	transform: translate(-50%, -50%) rotate(var(--point-angle, 0deg)) scale(1.15);
    opacity: 95%;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255,255,255,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255,255,255,0);
    }
}

/* Punkt-Varianten (Farbe je nach Typ) */
.map-point-level {
	cursor: url("Characters/hand.webp") 16 16, auto;
    background: rgb(251,206,0);
}

.map-point-travel {
	width: 30px;
    height: 26px;
 
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='10,15 45,50 10,85 25,85 60,50 25,15' fill='white' stroke='black' stroke-width='8' stroke-linejoin='round'/%3E%3Cpolygon points='45,15 80,50 45,85 60,85 95,50 60,15' fill='white' stroke='black' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
 
    border: none;
    border-radius: 0;
	opacity: 90%;
	
	cursor: url("Characters/schritte.webp") 16 16, auto;
}

.map-point-story {
    background: rgb(255,255,255);
	cursor: url("Characters/hand.webp") 16 16, auto;
}

.map-point-storylevel {
    background: rgb(251,206,0);
	cursor: url("Characters/hand.webp") 16 16, auto;
}

.map-point-bonus {
    background: rgb(216,0,0);
	cursor: url("Characters/hand.webp") 16 16, auto;
    /*transform: translate(-50%, -50%) scale(0.5);*/
}

.map-point-backpipe {
    background: transparent;
    border: none;
    animation: none;
	width: 100% !important;
	height: 100% !important;
	top: 50% !important;
	left: 50% !important;
	border-radius: 0% !important;
    opacity: 0; /* unsichtbar, bleibt aber klickbar */
}

@media (hover: hover) {
    .map-point-backpipe:hover {
        cursor: none;
		opacity: 0% !important;
		transform: translate(-50%, -50%) rotate(var(--point-angle, 0deg)) scale(1) !important;
    }
}

#backpipe-cursor {
    position: fixed;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 9999;
    display: none;
    animation: backpipe-cursor-bounce 0.8s ease-in-out infinite;
}

@keyframes backpipe-cursor-bounce {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50%      { transform: translate(-50%, -50%) translateY(8px); }
}

.map-point-pipe {
    background: transparent;
    border: none;
    animation: none;
    opacity: 0; /* unsichtbar, bleibt aber klickbar */
}

@media (hover: hover) {
    .map-point-pipe:hover {
        cursor: none;
    }
}

#pipe-cursor {
    position: fixed;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 9999;
    display: none;
    animation: pipe-cursor-bounce 0.8s ease-in-out infinite;
}

@keyframes pipe-cursor-bounce {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50%      { transform: translate(-50%, -50%) translateY(8px); }
}

.map-point-secret {
    background: transparent;
    border: none;
    animation: none;
    opacity: 0; /* unsichtbar, bleibt aber klickbar */
    width: 4%;
    height: 5%;
}

.map-point-character {
    aspect-ratio: 1 / 1;

    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;

    border: none;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    opacity: 15%;
	
	cursor: url("Characters/texthand.webp") 16 16, auto;
	/*cursor: help;*/
}

.map-point-character:hover {  
    opacity: 99% !important;

}

.map-point-whisper {
    background: transparent;
    border: none;
    animation: none;
    opacity: 0; /* unsichtbar, aber hörbar */
    width: 4%;
    height: 5%;
}

/* =======================================================
   TEXTBOX (DIALOG-OVERLAY)
   ======================================================= */
#textbox-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0,0,0,0.55);

    display: flex;
    justify-content: center;
    align-items: flex-end;

    padding: 40px;
    z-index: 10;
}

#textbox {
	position: relative;
    width: 60%;
	max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);

    background: #121212;
    border: 2px solid #444;
    border-radius: 24px;

    padding: 28px;
    color: white;

    box-shadow: 0 0 30px rgba(0,0,0,0.5);
	
	display: flex;
    flex-direction: column;
    overflow: hidden;
	
	user-select: none;
    -webkit-user-select: none;   /* Safari */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;   
}

#textbox-text {
	overflow-anchor: none;
	
    font-size: clamp(0.5rem, 1.8dvh, 3.5rem);
    line-height: 1.6;
    color: white;
	
	flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 10px;
}

#textbox button {
    margin-top: 12px;

    background: white;
    color: black;

    border: none;
    border-radius: 12px;

    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;

    cursor: pointer;
    transition: opacity 0.2s ease;
}

#textbox button:hover {
    opacity: 0.85;
}

.btn-wip,
.btn-wip:hover {
  opacity: 0.45;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: none;
}

#complete-level.btn-wip,
#complete-level.btn-wip:hover {
  opacity: 0.45;
  filter: grayscale(1);
  cursor: not-allowed;
}

#textbox-text::-webkit-scrollbar {
    width: 8px;
}

#textbox-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

#textbox-text::-webkit-scrollbar-track {
    background: transparent;
}

#level-number-badge {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 1.4rem;
    color: white;
    z-index: 1;
}


/* =======================================================
   STERNSKALA
   ======================================================= */
#level-number-badge {
    position: absolute;
    top: 12px;
    right: 24px;
    z-index: 1;

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}

#level-number-badge .star {
    position: relative;
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.1rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.3);
}

#level-number-badge .star .fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    overflow: hidden;
    white-space: nowrap;
    color: gold;
}

#level-number-badge .star.empty {
    color: rgba(255, 255, 255, 0.3);
}

#level-number-badge .star .fill.overflow {
    color: #4fd6ff;
}

/* =======================================================
   KARTENWECHSEL — ÜBERGANGSEFFEKT
   ======================================================= */
#map-transition {
    position: absolute;
    inset: 0;

    pointer-events: none;
    overflow: hidden;
    z-index: 50;

    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}

.cloud-transition {
    position: absolute;
    inset: -15%;

    opacity: 0;

    background:
        radial-gradient(circle at 12% 28%, rgba(255,255,255,0.95) 0%, transparent 20%),
        radial-gradient(circle at 78% 22%, rgba(255,255,255,0.9) 0%, transparent 24%),
        radial-gradient(circle at 32% 75%, rgba(255,255,255,0.92) 0%, transparent 22%),
        radial-gradient(circle at 65% 68%, rgba(255,255,255,0.85) 0%, transparent 25%),
        radial-gradient(circle at 50% 45%, rgba(255,255,255,0.75) 0%, transparent 30%),
        rgba(255,255,255,0.18);

    filter: blur(32px);
    transform: scale(1.12) translateX(0px);

    animation: fogTransition 0.9s ease-in-out forwards;
}

@keyframes fogTransition {
    0% {
        opacity: 0;
        transform: scale(1.18) translateX(-40px);
    }
    25% {
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.05) translateX(40px);
    }
}

/* =======================================================
	Morph-Übergang direkt auf dem Kartenbild */
   ======================================================= */
.map-morph-out {
    opacity: 0.2;
    filter: blur(18px);
    transform: scale(1.04);
}

.map-morph-in {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
}


/* =======================================================
   BUTTONS
   ======================================================= */
#skip-intro {
    display: none;
	width: 30%;
    /*margin-left: 57%;*/
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#skip-intro:hover {
	cursor: url("Characters/schritte.webp") 16 16, auto;
}

#complete-level {
    display: none;
	width: 30%;
    /*margin-left: 69%;*/
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#complete-level:hover {
	cursor: url("Characters/flag.webp") 16 16, auto;
}

#close-textbox {
    display: flex;
	width: 30%;
    /*margin-left: 69%;*/
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#close-textbox:hover {
	cursor: url("Characters/text.webp") 16 16, auto;
}

#textbox-buttons {
    display: flex;
    width: 100%;

    justify-content: space-between;
    align-items: center;

    gap: 12px;
    flex-shrink: 0;
}

/* =======================================================
   Logo
   ======================================================= */

.bcaText {
    position: fixed;
    top: 12px;
    left: 12px;
    height: 7%;
    z-index: 50;
    pointer-events: none;
}

/* =======================================================
   Welt-Switch
   ======================================================= */
#wave-buttons {
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.wave-button1,
.wave-button2 {
    height: 30px;
    cursor: pointer;
    display: block;
}

/* =======================================================
   Mainmenu-Buttons
   ======================================================= */
#footer-buttons {
    position: fixed;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 50;
}

#footer-bottom-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

#impressum-button,
#SecretCode-button,
#Makers-button {
    background: rgba(255, 255, 255, 0.6);
    color: #000;
    padding: 12px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
	
	width: 100px; 
	text-align: center;
    box-sizing: border-box;
}

#impressum-button:hover,
#SecretCode-button:hover,
#Makers-button:hover {
    background: rgba(255, 255, 255, 0.85);
}

/* =======================================================
   Pop-Ups
   ======================================================= */
#info-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

#info-popup-box {
    position: relative;
    background: #fff;
    color: #111;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 10px;
}

#info-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

/* =======================================================
   Sound Invisible desktop
   ======================================================= */
#mobile-audio-unlock {
    display: none;
}

/* =======================================================
   Password
   ======================================================= */
.npc-password { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.npc-password input { flex: 1; min-width: 0; max-width: 260px; font: inherit; padding: 6px 10px; border: 2px solid #000; border-radius: 8px; }
.npc-password button { font: inherit; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
#npc-password-feedback { text-align: center; min-height: 1.2em; margin-top: 8px; }