/* ========================================
   SAKSHI: VALENTINE SAGA – PREMIUM STYLES
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Quicksand:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&display=swap');

:root {
    --pink-primary: #ff6b9d;
    --pink-light: #ff9ff3;
    --pink-deep: #c44569;
    --pink-soft: #f8a5c2;
    --purple-dark: #1a0a2e;
    --purple-mid: #2d1b4e;
    --purple-light: #6c5ce7;
    --gold: #f1c40f;
    --gold-warm: #f39c12;
    --red: #e74c3c;
    --bg-dark: #0a0008;
    --glass-bg: rgba(20, 5, 25, 0.55);
    --glass-border: rgba(255, 107, 157, 0.25);
    --glass-highlight: rgba(255, 255, 255, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: var(--bg-dark);
    font-family: 'Quicksand', sans-serif;
    cursor: default;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
}

/* ── OVERLAYS ── */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: rgba(10, 0, 8, 0.85);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    animation: overlayIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.overlay.active {
    display: flex;
}

@keyframes overlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(18px);
    }
}

/* ── TITLE SCREEN ── */
#titleScreen {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 107, 157, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(20, 5, 25, 0.9) 0%, rgba(10, 0, 8, 0.95) 100%);
}

.title-content {
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 2;
    animation: titleContentIn 1s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes titleContentIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.title-hearts {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    animation: heartPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(255, 107, 157, 0.6));
}

@keyframes heartPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(255, 107, 157, 0.6));
    }

    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 24px rgba(255, 107, 157, 0.9));
    }
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 5.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9ff3 25%, #f368e0 50%, #c44569 75%, #ff6b9d 100%);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s ease infinite;
    filter: drop-shadow(0 0 40px rgba(255, 107, 157, 0.35)) drop-shadow(0 4px 20px rgba(196, 69, 105, 0.3));
    letter-spacing: 0.18em;
    line-height: 1.1;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.game-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--pink-soft);
    margin: 0.4rem 0;
    letter-spacing: 0.35em;
    font-weight: 400;
    text-shadow: 0 0 20px rgba(248, 165, 194, 0.3);
    animation: subtitleGlow 3s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
    from {
        text-shadow: 0 0 20px rgba(248, 165, 194, 0.2);
    }

    to {
        text-shadow: 0 0 35px rgba(248, 165, 194, 0.5);
    }
}

.title-divider {
    width: 180px;
    height: 2px;
    margin: 0.8rem auto 0.5rem;
    background: linear-gradient(90deg, transparent, var(--pink-primary), transparent);
    border-radius: 2px;
    animation: dividerPulse 3s ease-in-out infinite alternate;
}

@keyframes dividerPulse {
    from {
        opacity: 0.4;
        width: 140px;
    }

    to {
        opacity: 1;
        width: 200px;
    }
}

.tagline {
    font-size: 0.85rem;
    color: var(--pink-deep);
    margin-bottom: 2.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(196, 69, 105, 0.3);
}

.version-badge {
    display: inline-block;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.15em;
    margin-top: 1.5rem;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

/* ── BUTTONS ── */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
}

.menu-btn {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.85rem 2.8rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--pink-soft);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    letter-spacing: 0.12em;
    min-width: 230px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 159, 243, 0.15), transparent);
    transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.menu-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: linear-gradient(180deg, var(--glass-highlight), transparent);
    pointer-events: none;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: rgba(255, 107, 157, 0.18);
    border-color: rgba(255, 107, 157, 0.6);
    color: #fff;
    transform: translateY(-3px);
    box-shadow:
        0 8px 32px rgba(255, 107, 157, 0.25),
        0 0 20px rgba(255, 107, 157, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.menu-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2);
}

.menu-btn.primary {
    background: linear-gradient(135deg, #ff6b9d, #e84393, #c44569);
    border: 1px solid rgba(255, 159, 243, 0.3);
    color: #fff;
    box-shadow:
        0 4px 20px rgba(255, 107, 157, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, #ff9ff3, #ff6b9d, #e84393);
    transform: translateY(-4px);
    box-shadow:
        0 8px 35px rgba(255, 107, 157, 0.5),
        0 0 30px rgba(255, 107, 157, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ── CONTROLS ── */
.controls-content {
    text-align: center;
    color: #fff;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    box-shadow:
        0 16px 64px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 var(--glass-highlight);
    max-width: 560px;
    animation: cardIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.controls-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.3));
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.control-item {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.3rem 0;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(108, 92, 231, 0.35);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pink-light);
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.15);
    transition: all 0.3s ease;
}

.control-item:hover .key {
    background: rgba(108, 92, 231, 0.25);
    border-color: rgba(108, 92, 231, 0.5);
    box-shadow: 0 2px 12px rgba(108, 92, 231, 0.3);
}

/* ── DIALOGUE ── */
.dialogue-overlay {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 1.8rem;
    z-index: 200;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 107, 157, 0.06),
        inset 0 1px 0 var(--glass-highlight);
    animation: dialogueIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes dialogueIn {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.dialogue-portrait {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 157, 0.5);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.12), transparent);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.15);
    animation: portraitGlow 2.5s ease-in-out infinite alternate;
}

@keyframes portraitGlow {
    from {
        box-shadow: 0 0 15px rgba(255, 107, 157, 0.1);
    }

    to {
        box-shadow: 0 0 25px rgba(255, 107, 157, 0.25);
    }
}

.dialogue-text-area {
    flex: 1;
}

.dialogue-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    background: linear-gradient(90deg, var(--pink-primary), var(--pink-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    letter-spacing: 0.12em;
}

.dialogue-text {
    font-size: 0.95rem;
    color: rgba(232, 213, 222, 0.95);
    line-height: 1.7;
    min-height: 2rem;
}

.dialogue-continue {
    font-size: 0.72rem;
    color: var(--pink-deep);
    margin-top: 0.5rem;
    animation: blink 1.5s ease infinite;
    letter-spacing: 0.05em;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}

/* ── GLASS CARD PANELS ── */
.pause-content,
.gameover-content,
.levelcomplete-content,
.ending-content {
    text-align: center;
    color: #fff;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 3.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(255, 107, 157, 0.05),
        inset 0 1px 0 var(--glass-highlight);
    animation: cardIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
    min-width: 340px;
}

.pause-content h2,
.gameover-content h2,
.levelcomplete-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.3));
}

.gameover-text {
    font-size: 1.1rem;
    color: var(--pink-soft);
    margin-bottom: 2rem;
    font-style: italic;
    text-shadow: 0 0 15px rgba(248, 165, 194, 0.2);
}

.shard-earned {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    animation: heartPulse 1.5s ease infinite;
    filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.5));
}

.screen-sparkle {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
    animation: sparkleFloat 3s ease-in-out infinite alternate;
}

@keyframes sparkleFloat {
    from {
        opacity: 0.25;
        transform: translateY(0);
    }

    to {
        opacity: 0.5;
        transform: translateY(-5px);
    }
}

/* ── CUTSCENE ── */
#cutsceneOverlay {
    background: rgba(10, 0, 8, 0.95);
    flex-direction: column;
}

.cutscene-text {
    text-align: center;
    color: #f8e8ef;
    font-size: 1.5rem;
    line-height: 2.4;
    max-width: 700px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.06em;
    text-shadow: 0 0 30px rgba(248, 165, 194, 0.2);
    animation: cutsceneTextIn 0.8s ease both;
    transition: opacity 0.6s ease;
}

@keyframes cutsceneTextIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cutscene-letterbox-top,
.cutscene-letterbox-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    height: 60px;
    background: #000;
    z-index: 101;
}

.cutscene-letterbox-top {
    top: 0;
}

.cutscene-letterbox-bottom {
    bottom: 0;
}

.cutscene-skip {
    position: fixed;
    bottom: 25px;
    right: 35px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* ── ENDING ── */
.ending-content {
    max-width: 600px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.ending-text {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    line-height: 2.5;
    color: var(--pink-soft);
    text-align: center;
    text-shadow: 0 0 30px rgba(248, 165, 194, 0.3);
}

#btnMeetQueen {
    margin-top: 2rem;
    font-size: 1.2rem;
    padding: 1rem 3rem;
    animation: cardIn 0.6s ease both;
}

#endingScreen {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255, 107, 157, 0.08) 0%, transparent 60%),
        rgba(10, 0, 8, 0.97);
}

/* ── LOADING ── */
.loading-content {
    text-align: center;
    color: var(--pink-soft);
}

.loading-heart {
    font-size: 3.5rem;
    animation: loadingPulse 1s ease infinite;
    filter: drop-shadow(0 0 25px rgba(255, 107, 157, 0.6));
}

@keyframes loadingPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(255, 107, 157, 0.6));
    }

    50% {
        transform: scale(1.25);
        filter: drop-shadow(0 0 40px rgba(255, 107, 157, 0.9));
    }
}

.loading-content p {
    margin-top: 1rem;
    letter-spacing: 0.3em;
    font-size: 0.85rem;
    text-transform: uppercase;
    animation: blink 2s ease infinite;
}

/* ── FLOATING PETALS ── */
.floating-petals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(ellipse, var(--pink-primary), var(--pink-deep));
    border-radius: 50% 0 50% 50%;
    opacity: 0.5;
    animation: petalFall linear infinite;
    filter: blur(0.5px);
}

@keyframes petalFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }

    .game-subtitle {
        font-size: 1.2rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .controls-content {
        padding: 1.5rem 2rem;
    }

    .dialogue-overlay {
        width: 92%;
    }

    .pause-content,
    .gameover-content,
    .levelcomplete-content {
        padding: 1.8rem 2rem;
        min-width: auto;
    }
}

/* ── HUD CONTROLS ── */
.hud-controls {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 90;
    display: flex;
    gap: 15px;
}

.hud-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 107, 157, 0.5);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.8);
}

.hud-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.4), rgba(255, 107, 157, 0.2));
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 25px rgba(255, 107, 157, 0.6), 0 0 10px rgba(255, 107, 157, 0.4);
    border-color: #ff9ff3;
}

.hud-btn:active {
    transform: scale(0.95);
}

/* ── PAUSE MENU SPECIFIC ── */
.pause-content {
    background: rgba(20, 5, 25, 0.85);
    padding: 3rem 4rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(255, 107, 157, 0.1);
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: pauseIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pause-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #ff9ff3, #feca57);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 159, 243, 0.4);
    letter-spacing: 0.1em;
}

@keyframes pauseIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── LOVE LETTER ── */
#loveLetterOverlay {
    background: rgba(10, 0, 8, 0.9);
}

.love-letter-container {
    position: relative;
    width: 600px;
    max-height: 85vh;
    background: #fdf6e3;
    padding: 60px 50px 80px;
    border-radius: 5px;
    box-shadow:
        0 0 50px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(160, 116, 50, 0.2);
    transform: rotate(-2deg);
    animation: letterIn 1s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
}

@keyframes letterIn {
    from {
        transform: translateY(100vh) rotate(-10deg);
    }

    to {
        transform: translateY(0) rotate(-2deg);
    }
}

.paper-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(transparent, transparent 29px, rgba(0, 0, 0, 0.1) 30px);
    pointer-events: none;
    border-radius: 5px;
}

.letter-content {
    font-family: 'Dancing Script', cursive, serif;
    /* Ideally load this font */
    font-size: 1.8rem;
    color: #4a3b32;
    line-height: 1.6;
    white-space: pre-wrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
}

/* Scrollbar styling to match the letter aesthetic */
.letter-content::-webkit-scrollbar {
    width: 6px;
}

.letter-content::-webkit-scrollbar-track {
    background: rgba(160, 116, 50, 0.1);
    border-radius: 3px;
}

.letter-content::-webkit-scrollbar-thumb {
    background: rgba(160, 116, 50, 0.3);
    border-radius: 3px;
}

.letter-content::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 116, 50, 0.5);
}

#btnCloseLetter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* ── CONTROLS GUIDE (Always visible, non-intrusive) ── */
.controls-guide-overlay {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 90;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.controls-guide-overlay.visible {
    opacity: 0.35;
}

.controls-guide-overlay.visible:hover {
    opacity: 0.95;
}

.controls-guide-card {
    background: rgba(10, 2, 15, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 157, 0.15);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    transition: all 0.3s ease;
}

.controls-guide-title {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    text-align: center;
    margin: 0 0 0.4rem;
    color: rgba(255, 159, 243, 0.8);
    letter-spacing: 0.1em;
}

.controls-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.8rem;
}

.cg-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cg-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--pink-light);
    min-width: 32px;
    text-align: center;
}

.cg-label {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
}

.controls-guide-hint {
    display: none;
}

/* ── CREDITS SCREEN ── */
#creditsScreen {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 107, 157, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 159, 243, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #0a0008 0%, #1a0a14 40%, #0d0520 100%);
}

.credits-content {
    text-align: center;
    color: white;
    position: relative;
    padding: 2rem;
    max-width: 600px;
    overflow: hidden;
}

/* Floating hearts/roses background */
.credits-floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.credits-float-heart {
    position: absolute;
    bottom: -50px;
    left: var(--x);
    font-size: 1.8rem;
    animation: creditsFloat 8s ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes creditsFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg) scale(1);
        opacity: 0;
    }
}

/* Sparkle decorative lines */
.credits-sparkle-line {
    font-size: 0.9rem;
    color: rgba(255, 159, 243, 0.4);
    letter-spacing: 0.5em;
    margin: 0.8rem 0;
    animation: creditFadeIn 2s ease both;
    animation-delay: 0.3s;
}

/* Title */
.credits-title {
    font-family: 'Cinzel', serif;
    font-size: 4.5rem;
    margin: 0.3rem 0 0;
    background: linear-gradient(135deg, #ff9ff3 0%, #ff6b9d 30%, #feca57 60%, #ff9ff3 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: creditFadeIn 1.5s ease both, creditsTitleShimmer 6s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.5));
    letter-spacing: 0.15em;
}

@keyframes creditsTitleShimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.credits-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: rgba(255, 159, 243, 0.7);
    letter-spacing: 0.4em;
    margin: 0.2rem 0 0.5rem;
    animation: creditFadeIn 2s ease both;
    animation-delay: 0.5s;
    text-transform: uppercase;
}

/* Divider */
.credits-divider {
    width: 200px;
    height: 1px;
    margin: 1.5rem auto;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 157, 0.6), rgba(255, 159, 243, 0.4), transparent);
    animation: creditFadeIn 2.5s ease both;
    animation-delay: 1s;
}

/* Role text */
.credits-role {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: creditFadeIn 2s ease both;
    animation-delay: 1.2s;
}

/* Creator name */
.credits-name {
    font-size: 5rem;
    font-family: 'Dancing Script', cursive, serif;
    background: linear-gradient(135deg, #e74c3c, #ff6b9d, #ff9ff3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0.3rem 0 1rem;
    animation: creditScaleIn 2s cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: 1.5s;
    filter: drop-shadow(0 0 25px rgba(231, 76, 60, 0.4));
    line-height: 1.2;
}

/* Dedication */
.credits-dedication {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    color: rgba(248, 165, 194, 0.8);
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 1.5rem;
    animation: creditFadeIn 2s ease both;
    animation-delay: 2s;
}

/* Heart row */
.credits-heart-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
    animation: creditFadeIn 2s ease both;
    animation-delay: 2.3s;
}

.credits-heart-beat {
    font-size: 2.5rem;
    display: inline-block;
    animation: creditsHeartPulse 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.6));
}

@keyframes creditsHeartPulse {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.15);
    }
}

/* Message */
.credits-message {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 2;
    margin: 1.5rem 0;
    animation: creditFadeIn 2s ease both;
    animation-delay: 2.8s;
}

/* Final line */
.credits-final-line {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    background: linear-gradient(90deg, rgba(255, 159, 243, 0.6), rgba(255, 107, 157, 1), rgba(255, 159, 243, 0.6));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3em;
    margin: 1rem 0 2rem;
    animation: creditFadeIn 2s ease both, creditGlow 3s ease-in-out infinite alternate;
    animation-delay: 3.2s;
}

@keyframes creditGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.3));
    }

    to {
        filter: drop-shadow(0 0 25px rgba(255, 107, 157, 0.7));
    }
}

/* Return button */
.credits-btn {
    animation: creditFadeIn 1.5s ease both !important;
    animation-delay: 3.8s !important;
}

@keyframes creditFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes creditScaleIn {
    from {
        transform: scale(0.3);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}