/* ===============================================
   Common Styles
   =============================================== */

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

body {
    /* Deep gradient matching the intro blue */
    background: radial-gradient(ellipse at bottom, #08111a 0%, #0d1b2a 40%, #162a42 100%);
    min-height: 100vh;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 500;
    position: relative;
    overflow-x: hidden;
}

/* Underwater bubble effect */
.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s infinite ease-in-out;
    animation-fill-mode: backwards;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* UI Container */
.container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 20px;
    color: #87ceeb;
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.5);
}

.header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #4fb3d9, #87ceeb, #5f9ea0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1em;
    opacity: 0.8;
}

.btn {
    background: rgba(135, 206, 235, 0.08);
    color: #c8e6f5;
    border: 1px solid rgba(135, 206, 235, 0.2);
    padding: 11px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(135, 206, 235, 0.06), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    background: rgba(135, 206, 235, 0.15);
    border-color: rgba(135, 206, 235, 0.4);
    color: #e0f4ff;
    box-shadow: 0 4px 20px rgba(79, 179, 217, 0.2),
        0 0 15px rgba(135, 206, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0) scale(0.98);
    background: rgba(135, 206, 235, 0.2);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn i {
    font-size: 13px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.btn:hover i {
    opacity: 1;
}

/* Footer */
.footer {
    background: rgba(8, 17, 26, 0.85);
    /* Darker */
    color: #87ceeb;
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(135, 206, 235, 0.1);
    width: 100%;
    margin-top: 40px;
    box-sizing: border-box;
}

.footer p {
    margin: 5px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.footer a {
    color: #4fb3d9;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #87ceeb;
}

.footer .btn {
    color: #c8e6f5;
    padding: 12px 30px;
    font-size: 15px;
}

/* ===============================================
   Styles Specific to index.html
   =============================================== */
.global-controls {
    text-align: center;
    padding-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    gap: 20px;
    min-height: 600px;
}

.drawing-panel {
    background: rgba(13, 27, 42, 0.6);
    /* Deeper */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(135, 206, 235, 0.1);
    border-radius: 20px;
    padding: 20px;
    width: 350px;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 15;
}

.canvas-hint-icon {
    position: absolute;
    top: calc(50% + 10px);
    left: 50%;
    transform: translate(-50%, -50%) scaleX(-1);
    font-size: 150px;
    color: rgba(135, 206, 235, 0.05);
    /* More subtle */
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.canvas-hint-icon.hidden {
    opacity: 0;
}

.drawing-panel h3 {
    color: #87ceeb;
    margin-bottom: 5px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drawing-hint {
    text-align: center;
    color: #87ceeb;
    opacity: 0.6;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.guide-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.guide-toggle-label {
    font-size: 13px;
    color: #87ceeb;
    opacity: 0.7;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2a5470;
}

input:checked+.slider:before {
    transform: translateX(18px);
}


#drawingCanvas {
    border: 2px solid rgba(135, 206, 235, 0.2);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    cursor: crosshair;
    display: block;
    margin: 0 auto 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* New wrapper for aquarium and UI */
.aquarium-panel {
    flex: 1;
    position: relative;
    min-height: 500px;
}

.aquarium-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.aquarium {
    position: relative;
    width: 100%;
    height: 100%;
    /* Deep color tone matching the intro */
    background: linear-gradient(to bottom, rgba(13, 27, 42, 0.9) 0%, rgba(22, 42, 66, 0.7) 60%, rgba(30, 60, 80, 0.5) 100%);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
    cursor: grab;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

#lightRaysContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.light-ray {
    position: absolute;
    top: 0;
    height: 100%;
    /* Light slightly cooler and more mysterious */
    background: linear-gradient(to bottom, rgba(135, 206, 235, 0.08) 0%, rgba(135, 206, 235, 0.1) 40%, rgba(135, 206, 235, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 5%, transparent 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 5%, transparent 100%);
    animation-name: subtle-fade, drift-and-pulse-width;
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
    animation-iteration-count: infinite;
}

@keyframes subtle-fade {
    0% {
        opacity: 0.2;
    }

    25% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.25;
    }

    75% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.2;
    }
}

@keyframes drift-and-pulse-width {
    0% {
        transform: translateX(0%) scaleX(0.9);
    }

    50% {
        transform: translateX(5%) scaleX(1.1);
    }

    100% {
        transform: translateX(0%) scaleX(0.9);
    }
}

.aquarium:active {
    cursor: grabbing;
}

.zoom-controls,
.zoom-info,
.pan-hint {
    transition: opacity 0.4s ease-in-out;
    pointer-events: auto;
}

.zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 20;
    background: rgba(13, 27, 42, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(135, 206, 235, 0.15);
}

.zoom-btn {
    background: rgba(135, 206, 235, 0.08);
    color: #c8e6f5;
    border: 1px solid rgba(135, 206, 235, 0.15);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(135, 206, 235, 0.15);
    border-color: rgba(135, 206, 235, 0.35);
    box-shadow: 0 4px 16px rgba(79, 179, 217, 0.15),
        0 0 10px rgba(135, 206, 235, 0.08);
    transform: translateY(-1px);
}

.zoom-btn:active {
    transform: translateY(0) scale(0.95);
}

.zoom-info {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #87ceeb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 20;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(135, 206, 235, 0.1);
}

.pan-hint {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #87ceeb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 20;
    backdrop-filter: blur(5px);
    opacity: 0.7;
    border: 1px solid rgba(135, 206, 235, 0.1);
}

.ui-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.creature {
    position: absolute;
    filter: drop-shadow(0 0 10px currentColor);
    transition: opacity 0.5s ease;
    will-change: transform, opacity;
    left: 0;
    top: 0;
    z-index: 5;
}

.creature-visuals {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.creature-visuals svg {
    width: 100%;
    height: 100%;
}

.creature-visuals path {
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    0% {
        filter: brightness(1) saturate(1);
    }

    100% {
        filter: brightness(1.2) saturate(1.3);
    }
}

.creature[data-role="smallFish"] .creature-visuals path {
    transform-origin: 82% 50%;
    animation: glow 3s ease-in-out infinite alternate, small-fish-tail 1.5s ease-in-out infinite;
}

.creature[data-role="mediumFish"] .creature-visuals path {
    transform-origin: 85% 50%;
    animation: glow 3s ease-in-out infinite alternate, medium-fish-tail 2s ease-in-out infinite;
}

.creature[data-role="predator"] .creature-visuals path {
    transform-origin: 88% 50%;
    animation: glow 3s ease-in-out infinite alternate, predator-tail 2.8s ease-in-out infinite;
}

.creature[data-role="gentleGiant"] .creature-visuals path {
    transform-origin: 90% 50%;
    animation: glow 3s ease-in-out infinite alternate, gentle-giant-tail 3.5s ease-in-out infinite;
}

.creature[data-role="mediumSchool"] .creature-visuals path {
    transform-origin: 86% 50%;
    animation: glow 3s ease-in-out infinite alternate, medium-school-tail 1.8s ease-in-out infinite;
}

.creature[data-role="activeJellyfish"] .creature-visuals path {
    transform-origin: 80% 50%;
    animation: glow 3s ease-in-out infinite alternate, jellyfish-tail 2.2s ease-in-out infinite;
}

@keyframes small-fish-tail {
    0% {
        transform: skewX(0deg);
    }

    25% {
        transform: skewX(-12deg);
    }

    50% {
        transform: skewX(0deg);
    }

    75% {
        transform: skewX(10deg);
    }

    100% {
        transform: skewX(0deg);
    }
}

@keyframes medium-fish-tail {
    0% {
        transform: skewX(0deg);
    }

    25% {
        transform: skewX(-14deg);
    }

    50% {
        transform: skewX(0deg);
    }

    75% {
        transform: skewX(12deg);
    }

    100% {
        transform: skewX(0deg);
    }
}

@keyframes medium-school-tail {
    0% {
        transform: skewX(0deg);
    }

    20% {
        transform: skewX(-13deg);
    }

    40% {
        transform: skewX(5deg);
    }

    60% {
        transform: skewX(-8deg);
    }

    80% {
        transform: skewX(11deg);
    }

    100% {
        transform: skewX(0deg);
    }
}

@keyframes predator-tail {
    0% {
        transform: skewX(0deg);
    }

    20% {
        transform: skewX(-16deg);
    }

    40% {
        transform: skewX(6deg);
    }

    60% {
        transform: skewX(-10deg);
    }

    80% {
        transform: skewX(14deg);
    }

    100% {
        transform: skewX(0deg);
    }
}

@keyframes gentle-giant-tail {
    0% {
        transform: skewX(0deg);
    }

    33% {
        transform: skewX(-10deg);
    }

    66% {
        transform: skewX(8deg);
    }

    100% {
        transform: skewX(0deg);
    }
}

@keyframes jellyfish-tail {
    0% {
        transform: scaleY(1);
    }

    25% {
        transform: scaleY(1.04);
    }

    50% {
        transform: scaleY(0.96);
    }

    75% {
        transform: scaleY(1.03);
    }

    100% {
        transform: scaleY(1);
    }
}

.plankton {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    will-change: transform, opacity;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 3;
}

.plankton.p-far {
    background-color: rgba(220, 235, 255, 0.4);
}

.plankton.p-mid {
    background-color: rgba(220, 235, 255, 0.6);
}

.plankton.p-near {
    background-color: rgba(220, 235, 255, 0.8);
}


.footer .art-credit {
    max-width: 700px;
    margin: 0 auto 20px auto;
    font-style: italic;
    opacity: 0.5;
    /* Keep subtle */
    line-height: 1.7;
    border-bottom: 1px solid rgba(135, 206, 235, 0.1);
    padding-bottom: 20px;
    font-size: 0.85em;
    /* Slightly smaller */
    color: #5f8a9e;
    /* Subdued color */
}

.footer .button-container-footer {
    margin-bottom: 25px;
}


/* ===============================================
   Responsive Design
   =============================================== */

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.7em;
    }

    .main-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 10px;
        align-items: center;
    }

    .drawing-panel {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .aquarium-panel {
        min-height: 400px;
        width: 100%;
    }

    .aquarium {
        width: 1000px;
    }

    .zoom-controls {
        top: 10px;
        right: 10px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .zoom-info {
        bottom: 10px;
        right: 10px;
    }

    .pan-hint {
        bottom: 10px;
        left: 10px;
    }

    .footer .art-credit {
        padding: 15px;
        margin-bottom: 15px;
    }

    .canvas-hint-icon {
        font-size: 120px;
    }

}


/* ===============================================
   Introduction Sequence
   =============================================== */

/* Initial hiding of main content */
.fade-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.fade-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Intro overlay */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Unified background */
    background: radial-gradient(ellipse at bottom, rgba(13, 27, 42, 0.98) 0%, rgba(30, 58, 95, 0.98) 100%);
    color: #e0f4ff;
    transition: opacity 0.8s ease-in-out;
}

.intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-text-wrapper {
    text-align: center;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-weight: 500;
    letter-spacing: 0.2em;
    line-height: 2.5;
    z-index: 10001;
}

.intro-line {
    font-size: 1.4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    text-shadow: 0 0 15px rgba(135, 206, 235, 0.6);
}

@media (max-width: 768px) {
    .intro-line {
        font-size: 1.1rem;
        line-height: 2.2;
    }
}

.intro-spacer {
    height: 30px;
}

.intro-line.active {
    opacity: 1;
    transform: translateY(0);
}

/* Skip button */
.skip-btn {
    position: absolute;
    bottom: 30px;
    background: transparent;
    border: 1px solid rgba(135, 206, 235, 0.3);
    color: rgba(135, 206, 235, 0.6);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 1s;
    font-family: sans-serif;
    letter-spacing: 1px;
    z-index: 10001;
}

.skip-btn:hover {
    background: rgba(135, 206, 235, 0.1);
    color: #87ceeb;
    border-color: #87ceeb;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

body.is-intro-mode .bubbles {
    z-index: 10000;
    filter: blur(1px);
}

/* ===============================================
   About Modal (New)
   =============================================== */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 20000;
    /* Above intro and UI */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    /* Use flex for centering */
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: rgba(18, 32, 50, 0.95);
    margin: auto;
    padding: 30px;
    border: 1px solid rgba(135, 206, 235, 0.3);
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    color: #e0f4ff;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: #87ceeb;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 0.8;
}

.close-modal:hover {
    color: #fff;
}

.about-inner {
    font-size: 0.9rem;
    /* Smaller font size */
    line-height: 1.8;
}

.about-inner h2 {
    color: #87ceeb;
    border-bottom: 1px solid rgba(135, 206, 235, 0.2);
    padding-bottom: 10px;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 700;
}

.about-inner h2:first-of-type {
    margin-top: 0;
}

.about-inner h3 {
    color: #87ceeb;
    opacity: 0.9;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    border-left: 3px solid #5f9ea0;
    padding-left: 10px;
}

.about-inner p {
    margin-bottom: 15px;
    opacity: 0.9;
}

/* ===============================================
   Social Features Styles
   =============================================== */

/* Footer social buttons */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Social button common */
.btn-social {
    padding: 12px 24px;
    font-size: 14px;
}

.btn-accent {
    background: rgba(79, 179, 217, 0.15);
    border-color: rgba(79, 179, 217, 0.35);
}

.btn-accent:hover {
    background: rgba(79, 179, 217, 0.25);
    border-color: rgba(79, 179, 217, 0.5);
    box-shadow: 0 4px 24px rgba(79, 179, 217, 0.25),
        0 0 20px rgba(79, 179, 217, 0.15);
}

.btn-danger {
    background: rgba(199, 0, 57, 0.1);
    border-color: rgba(199, 0, 57, 0.25);
    color: #f0a0a0;
}

.btn-danger:hover {
    background: rgba(199, 0, 57, 0.2);
    border-color: rgba(199, 0, 57, 0.4);
    color: #ffbdbd;
    box-shadow: 0 4px 20px rgba(199, 0, 57, 0.15),
        0 0 15px rgba(199, 0, 57, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Modal note */
.modal-note {
    font-size: 0.8rem;
    opacity: 0.5;
    font-style: italic;
}

/* Pool info text */
.pool-info {
    font-size: 0.85rem;
    opacity: 0.6;
    text-align: center;
    min-height: 1.2em;
}

/* Modal action buttons */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Sharing section divider */
.shared-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(135, 206, 235, 0.1);
}

.shared-section h3 {
    color: #87ceeb;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.shared-desc {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 12px;
}

/* Sharing status display */
.shared-status {
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.5em;
    margin-top: 15px;
}

.shared-status.connected {
    color: #40e0d0;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Room code display */
.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

.room-code {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #87ceeb;
    text-shadow: 0 0 15px rgba(135, 206, 235, 0.4);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(135, 206, 235, 0.2);
}

/* Room code input */
.room-code-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.room-code-input {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    width: 180px;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(135, 206, 235, 0.25);
    background: rgba(0, 0, 0, 0.3);
    color: #87ceeb;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.room-code-input::placeholder {
    color: rgba(135, 206, 235, 0.25);
    letter-spacing: 0.3em;
}

.room-code-input:focus {
    border-color: rgba(135, 206, 235, 0.5);
    box-shadow: 0 0 15px rgba(135, 206, 235, 0.1);
}

/* ===============================================
   Shared Creature Aura Effect
   =============================================== */

.creature-shared {
    filter: drop-shadow(0 0 20px rgba(135, 206, 255, 0.8)) drop-shadow(0 0 40px rgba(135, 206, 255, 0.4)) brightness(1.3) !important;
    animation: sharedGlow 3s ease-out forwards !important;
}

@keyframes sharedGlow {
    0% {
        filter: drop-shadow(0 0 25px rgba(135, 206, 255, 0.9)) drop-shadow(0 0 50px rgba(135, 206, 255, 0.5)) brightness(1.4);
    }

    100% {
        filter: drop-shadow(0 0 10px currentColor) brightness(1);
    }
}

/* ===============================================
   Toast Notifications
   =============================================== */

.social-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(13, 27, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #c8e6f5;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid rgba(135, 206, 235, 0.2);
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 30000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.social-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.social-toast.toast-error {
    border-color: rgba(199, 0, 57, 0.3);
    color: #f0a0a0;
}

/* ===============================================
   Social Features Responsive
   =============================================== */

@media (max-width: 768px) {
    .social-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .social-buttons .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .btn-social {
        padding: 10px 18px;
        font-size: 13px;
    }

    .room-code {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
        padding: 8px 16px;
    }

    .room-code-input {
        font-size: 1.2rem;
        width: 150px;
        padding: 8px 12px;
    }

    .room-code-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .modal-actions {
        flex-direction: column;
        align-items: center;
    }

    .modal-actions .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }

    .social-toast {
        bottom: 20px;
        font-size: 13px;
        padding: 10px 18px;
    }
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::before {
    display: none;
}

/* ===============================================
   Creature Selection Mode
   =============================================== */

/* Aquarium in selection mode */
.aquarium.selection-mode {
    cursor: pointer !important;
}

/* Selectable creature highlight */
.selectable-creature {
    cursor: pointer !important;
    z-index: 100 !important;
    animation: selectablePulse 1.5s ease-in-out infinite !important;
    filter: drop-shadow(0 0 18px currentColor) drop-shadow(0 0 35px rgba(135, 206, 255, 0.5)) brightness(1.3) !important;
}

@keyframes selectablePulse {

    0%,
    100% {
        filter: drop-shadow(0 0 15px currentColor) drop-shadow(0 0 30px rgba(135, 206, 255, 0.3)) brightness(1.2);
    }

    50% {
        filter: drop-shadow(0 0 25px currentColor) drop-shadow(0 0 50px rgba(135, 206, 255, 0.6)) brightness(1.5);
    }
}

/* Glow effect when genes are deposited */
.creature-donated {
    animation: donatedFlash 2s ease-out forwards !important;
}

@keyframes donatedFlash {
    0% {
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 60px rgba(255, 215, 0, 0.5)) brightness(1.8);
    }

    100% {
        filter: drop-shadow(0 0 10px currentColor) brightness(1);
    }
}

/* Selection guide (top bar) */
.selection-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 25000;
    background: rgba(13, 27, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(135, 206, 235, 0.3);
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.selection-guide.show {
    transform: translateY(0);
}

.selection-guide-text {
    color: #87ceeb;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.4);
    animation: guideTextPulse 2s ease-in-out infinite;
}

.selection-guide-text i {
    margin-right: 6px;
}

@keyframes guideTextPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.selection-guide-cancel {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .selection-guide {
        padding: 10px 14px;
        gap: 10px;
    }

    .selection-guide-text {
        font-size: 13px;
    }
}

/* ===============================================
   Synthesis Overlay
   =============================================== */

.synthesis-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 28000;
    background: rgba(5, 12, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.synthesis-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.synthesis-content {
    text-align: center;
    color: #c8e6f5;
    font-family: 'Zen Maru Gothic', sans-serif;
}

.synthesis-dna-icon {
    font-size: 48px;
    color: #4fb3d9;
    margin-bottom: 24px;
    animation: dnaRotate 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(79, 179, 217, 0.6);
}

@keyframes dnaRotate {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: rotateY(180deg) scale(1.15);
        opacity: 1;
    }

    100% {
        transform: rotateY(360deg) scale(1);
        opacity: 0.8;
    }
}

.synthesis-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #87ceeb;
    text-shadow: 0 0 15px rgba(135, 206, 235, 0.5);
    margin-bottom: 24px;
    transition: opacity 0.3s ease;
    min-height: 1.5em;
}

.synthesis-progress {
    width: 180px;
    height: 3px;
    background: rgba(135, 206, 235, 0.15);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.synthesis-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #4fb3d9, transparent);
    animation: progressSlide 1.5s ease-in-out infinite;
}

@keyframes progressSlide {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

/* Scanning effect while reading */
.creature-scanning {
    animation: scanEffect 0.8s ease-in-out infinite !important;
}

@keyframes scanEffect {

    0%,
    100% {
        filter: drop-shadow(0 0 15px currentColor) brightness(1.2) hue-rotate(0deg);
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(79, 179, 217, 0.9)) brightness(1.6) hue-rotate(20deg);
    }
}

@media (max-width: 768px) {
    .synthesis-dna-icon {
        font-size: 36px;
    }

    .synthesis-text {
        font-size: 14px;
    }
}