/* miris.quest - The Quest Selection */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
}

body {
    background-color: #0A1A3E;
    color: #D0C0E8;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* === Starfield === */
.starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 40% 10%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 55% 55%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 85% 45%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 15% 70%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 50% 80%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 90% 75%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 35% 90%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 65% 85%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.3), transparent);
    animation: starDrift 20s linear infinite;
}

@keyframes starDrift {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

/* === Title Screen === */
.title-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(180deg, #1A0A2E 0%, #0A1A3E 100%);
    scroll-snap-align: start;
    overflow: hidden;
}

.title-content {
    text-align: center;
    z-index: 1;
    animation: bounceEnter 0.8s ease-out;
}

@keyframes bounceEnter {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-title {
    margin-bottom: 40px;
}

.title-miris {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(180deg, #FF00AA, #FFFFFF, #00FFCC);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255, 0, 170, 0.5));
}

.title-quest {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #FFD700;
    margin-top: 8px;
}

.select-text {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    color: #D0C0E8;
    animation: blinkText 1s step-end infinite;
    margin-bottom: 24px;
}

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

.start-prompt {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: #00FFCC;
    animation: pulseStart 1.5s ease-in-out infinite;
}

@keyframes pulseStart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* === World Map === */
.world-map {
    min-height: 60vh;
    position: relative;
    background: #0A1A3E;
    overflow: hidden;
}

.map-scroll {
    width: 100%;
    overflow-x: auto;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: #FF00AA #14102A;
}

.map-scroll::-webkit-scrollbar {
    height: 6px;
}

.map-scroll::-webkit-scrollbar-track {
    background: #14102A;
}

.map-scroll::-webkit-scrollbar-thumb {
    background: #FF00AA;
    border-radius: 3px;
}

.map-landscape {
    width: 200vw;
    height: 50vh;
    min-height: 350px;
    position: relative;
    background: linear-gradient(180deg, #0A1A3E 0%, #14102A 100%);
}

/* === Mountains === */
.mountain {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: solid transparent;
    border-right: solid transparent;
    border-bottom-style: solid;
    opacity: 0.5;
}

.m1 { left: 5%; border-left-width: 80px; border-right-width: 80px; border-bottom-width: 120px; border-bottom-color: #1A0A2E; }
.m2 { left: 20%; border-left-width: 120px; border-right-width: 100px; border-bottom-width: 160px; border-bottom-color: #14102A; }
.m3 { left: 40%; border-left-width: 90px; border-right-width: 110px; border-bottom-width: 140px; border-bottom-color: #1A0A2E; }
.m4 { left: 60%; border-left-width: 100px; border-right-width: 80px; border-bottom-width: 130px; border-bottom-color: #14102A; }
.m5 { left: 80%; border-left-width: 110px; border-right-width: 90px; border-bottom-width: 150px; border-bottom-color: #1A0A2E; }

/* === Quest Markers === */
.quest-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    animation: markerPulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.marker-magenta {
    background: radial-gradient(circle, #FF00AA, transparent 70%);
    box-shadow: 0 0 10px #FF00AA, 0 0 20px #FF00AA;
}

.marker-cyan {
    background: radial-gradient(circle, #00FFCC, transparent 70%);
    box-shadow: 0 0 10px #00FFCC, 0 0 20px #00FFCC;
}

.marker-gold {
    background: radial-gradient(circle, #FFD700, transparent 70%);
    box-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700;
}

.quest-marker:hover {
    transform: scale(1.5);
    animation: none;
}

.marker-tooltip {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #14102A;
    border: 1px solid #2A1A4A;
    padding: 8px 12px;
    min-width: 150px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.quest-marker:hover .marker-tooltip {
    opacity: 1;
}

.tooltip-corner {
    position: absolute;
    width: 8px;
    height: 8px;
}

.tooltip-corner.tl { top: -1px; left: -1px; border-top: 1.5px solid #FF00AA; border-left: 1.5px solid #FF00AA; }
.tooltip-corner.tr { top: -1px; right: -1px; border-top: 1.5px solid #FF00AA; border-right: 1.5px solid #FF00AA; }
.tooltip-corner.bl { bottom: -1px; left: -1px; border-bottom: 1.5px solid #FF00AA; border-left: 1.5px solid #FF00AA; }
.tooltip-corner.br { bottom: -1px; right: -1px; border-bottom: 1.5px solid #FF00AA; border-right: 1.5px solid #FF00AA; }

.tooltip-name {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: #D0C0E8;
    letter-spacing: 0.08em;
}

.tooltip-desc {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    color: #D0C0E8;
    opacity: 0.7;
}

/* === Quest Log === */
.quest-log {
    padding: 80px 24px;
    max-width: 720px;
    margin: 0 auto;
    background: #0A1A3E;
}

/* === Quest Card === */
.quest-card {
    position: relative;
    background: #14102A;
    border: 2px solid #2A1A4A;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.quest-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* RPG Corner Frames */
.card-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    z-index: 1;
}

.c-tl { top: -1px; left: -1px; border-top: 1.5px solid #FF00AA; border-left: 1.5px solid #FF00AA; }
.c-tr { top: -1px; right: -1px; border-top: 1.5px solid #FF00AA; border-right: 1.5px solid #FF00AA; }
.c-bl { bottom: -1px; left: -1px; border-bottom: 1.5px solid #FF00AA; border-left: 1.5px solid #FF00AA; }
.c-br { bottom: -1px; right: -1px; border-bottom: 1.5px solid #FF00AA; border-right: 1.5px solid #FF00AA; }

.card-header {
    background: #1A0A2E;
    padding: 12px 16px;
    border-bottom: 1px solid #2A1A4A;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-name {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: #FF00AA;
}

/* === Difficulty Stars === */
.difficulty {
    display: flex;
    gap: 4px;
}

.star {
    display: inline-block;
    width: 14px;
    height: 14px;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star.filled { background: #FFD700; }
.star.empty { background: #2A1A4A; }

.card-body {
    padding: 20px;
}

.quest-desc {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #D0C0E8;
    line-height: 1.65;
    margin-bottom: 16px;
}

.party-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: #00FFCC;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.party-list {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #D0C0E8;
    margin-bottom: 12px;
}

/* === Quest Status === */
.quest-status {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
}

.quest-status.active {
    background: rgba(0, 255, 204, 0.15);
    color: #00FFCC;
}

.quest-status.completed {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

.quest-status.upcoming {
    background: rgba(255, 0, 170, 0.15);
    color: #FF00AA;
}

/* === Save Point === */
.save-point {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(0deg, #1A0A2E 0%, #0A1A3E 100%);
    position: relative;
    padding: 80px 24px;
}

.save-icon {
    margin-bottom: 16px;
}

.floppy {
    width: 30px;
    height: 30px;
    background: #00FFCC;
    border-radius: 3px;
    position: relative;
    animation: floppySpin 2s linear infinite;
}

.floppy::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 8px;
    width: 14px;
    height: 10px;
    background: #0A1A3E;
    border-radius: 1px;
}

.floppy::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 5px;
    width: 20px;
    height: 12px;
    background: #14102A;
    border-radius: 2px;
}

@keyframes floppySpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.save-text {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    color: #00FFCC;
    margin-bottom: 32px;
    z-index: 1;
}

.inventory-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.inv-item {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #D0C0E8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.inv-item:hover {
    color: #00FFCC;
}

.inv-arrow {
    color: #FFD700;
    margin-right: 8px;
    font-size: 0.75rem;
}

/* === Responsive === */
@media (max-width: 600px) {
    .map-landscape {
        width: 300vw;
    }

    .card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
