@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Inter:wght@300;400&family=Rubik:wght@700&family=Special+Elite&display=swap');

:root {
    --paper-color: #f4f1ea;
}

body {
    background: radial-gradient(circle at top, #0f172a 0%, #000000 100%);
    background-attachment: fixed;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 2rem;
    text-align: center;
}

h1 {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    color: #fff3c0;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

h2 {
    font-family: 'Rubik', sans-serif;
    color: #fff3c0;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

p {
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 1.1rem;
    margin: 0 auto 3rem auto;
    max-width: 800px;
}

a {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid #aaaaaa;
    padding: 1rem 2rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

a:hover {
    background-color: #aaaaaa;
    color: #000000;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 2rem auto;
    border: 1px solid #444444;
    background-color: #222222;
}

.input-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

input[type="text"] {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #aaaaaa;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    margin-right: 1rem;
    width: 60%;
    max-width: 400px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #ffffff;
}

button {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #aaaaaa;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #aaaaaa;
    color: #000000;
}

.paper-note {
    background-color: var(--paper-color);
    color: #2b2b2b;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.6);
    transform: rotate(-0.5deg);
    border-left: 3px solid #e0d9c5;
    position: relative;
    margin: 2rem auto;
    font-family: 'Special Elite', cursive;
    text-align: left;
}

.paper-note::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 100% 1.5em;
    pointer-events: none;
}

.paper-note p {
    color: #2b2b2b;
    margin: 0 0 15px 0;
    line-height: 1.6;
    text-shadow: 0.5px 0.5px 0px rgba(0, 0, 0, 0.1);
}

.footnote {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 40px;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto 2rem auto;
}

.image-container img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

.image-container svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.interactive-area {
    fill: transparent;
    cursor: url('/magnifying-glass.svg') 12 12, zoom-in;
    transition: fill 0.3s, opacity 0.3s;
}

.interactive-area:hover {
    fill: rgba(255, 255, 255, 0.3);
}

.interactive-area:active {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% {
        fill: rgba(255, 255, 255, 0.8);
    }

    100% {
        fill: rgba(255, 255, 255, 0.3);
    }
}

/* Character Overlay & UI */
.interactive-area.no-highlight {
    fill: transparent !important;
}

.interactive-area.no-highlight:hover {
    fill: transparent !important;
}

.interactive-area.no-highlight:active {
    animation: none !important;
}

#overlay-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

#character-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.speech-bubble {
    position: absolute;
    background: #fff;
    border: 3px solid #000;
    border-radius: 15px;
    padding: 15px 20px;
    font-family: 'Special Elite', cursive;
    color: #000;
    max-width: 250px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    font-size: 1.1rem;
}

.cat-bubble {
    transform: translate(-50%, -100%);
    margin-top: -20px;
}

.cat-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    margin-left: -10px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.cat-bubble::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    margin-left: -11px;
    border-width: 11px 11px 0;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

#fish-head-container {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translate(100%, -50%);
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    animation: slideInFish 0.8s forwards ease-out;
    z-index: 10000;
}

@keyframes slideInFish {
    to {
        transform: translate(0, -50%);
    }
}

@keyframes slideOutFish {
    from {
        transform: translate(0, -50%);
    }

    to {
        transform: translate(100%, -50%);
    }
}

#fish-head-container img {
    height: 50vh;
    width: auto;
    border: none;
    background: transparent;
    margin: 0;
}

.fish-bubble {
    position: relative;
    margin: 0;
}

.fish-bubble::after {
    content: '';
    position: absolute;
    right: -10px;
    left: auto;
    top: 50%;
    margin-top: -10px;
    border-width: 10px 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

.fish-bubble::before {
    content: '';
    position: absolute;
    right: -14px;
    left: auto;
    top: 50%;
    margin-top: -11px;
    border-width: 11px 0 11px 11px;
    border-style: solid;
    border-color: transparent transparent transparent #000;
}

#info-overlay-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    text-align: center;
    width: 80%;
    max-width: 800px;
    pointer-events: none;
    animation: fadeInInfo 0.3s ease-out;
}

#info-overlay-box p {
    margin: 0;
    pointer-events: auto;
    background-color: rgba(15, 23, 42, 0.9);
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    display: inline-block;
    backdrop-filter: blur(8px);
}

@keyframes fadeInInfo {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Portrait Mode Fix for Fish Sliding In */
@media (orientation: portrait) {
    #fish-head-container {
        top: auto;
        bottom: 0;
        transform: translate(0, 100%);
        flex-direction: column-reverse;
        align-items: flex-end;
    }

    #fish-head-container img {
        height: 35vh;
        max-width: 80vw;
        object-fit: contain;
    }

    .fish-bubble {
        margin-right: 15px;
        margin-bottom: 10px;
        max-width: 70vw;
    }

    .fish-bubble::after {
        right: 30px;
        top: auto;
        bottom: -10px;
        margin-top: 0;
        border-width: 10px 10px 0 10px;
        border-color: #fff transparent transparent transparent;
    }

    .fish-bubble::before {
        right: 27px;
        top: auto;
        bottom: -13px;
        margin-top: 0;
        border-width: 13px 13px 0 13px;
        border-color: #000 transparent transparent transparent;
    }

    @keyframes slideInFish {
        to {
            transform: translate(0, 0);
        }
    }

    @keyframes slideOutFish {
        from {
            transform: translate(0, 0);
        }
        to {
            transform: translate(0, 100%);
        }
    }
}