:root {
    --deep-ocean: #0a1628;
    --mid-ocean: #0d2847;
    --surface: #1a4a6e;
    --light-rays: rgba(64, 224, 208, 0.1);
    --coral-pink: #ff6b9d;
    --coral-orange: #ff8c42;
    --seaweed-green: #2dd4bf;
    --bubble-blue: #7dd3fc;
    --sand: #fcd34d;
    --pearl: #fef3c7;
    --danger: #ef4444;
}

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

body {
    font-family: 'Patrick Hand', cursive;
    background: var(--deep-ocean);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--pearl);
}

.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 50% 0%, var(--surface) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(45, 212, 191, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 60%, rgba(255, 107, 157, 0.1) 0%, transparent 35%),
        linear-gradient(180deg, var(--mid-ocean) 0%, var(--deep-ocean) 100%);
    z-index: -2;
}

.light-rays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(170deg, var(--light-rays) 0%, transparent 40%),
        linear-gradient(190deg, var(--light-rays) 0%, transparent 35%);
    z-index: -1;
    animation: shimmer 8s ease-in-out infinite;
}

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

.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -50px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), rgba(125, 211, 252, 0.2));
    border-radius: 50%;
    animation: rise linear infinite;
}

@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 15px 0;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--coral-pink), var(--coral-orange), var(--sand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 30px rgba(255, 107, 157, 0.4);
    margin-bottom: 5px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--bubble-blue);
    opacity: 0.9;
}

.score-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 8px 20px;
    text-align: center;
    min-width: 100px;
}

.score-item.timer {
    border-color: var(--coral-orange);
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.2), rgba(255, 140, 66, 0.1));
}

.score-item.timer.warning {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.1));
    animation: pulse 0.5s ease-in-out infinite;
}

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

.score-label {
    font-size: 0.75rem;
    color: var(--seaweed-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-item.timer .score-label { color: var(--coral-orange); }
.score-item.timer.warning .score-label { color: var(--danger); }

.score-value {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: var(--sand);
}

.score-item.timer .score-value { color: var(--coral-orange); }
.score-item.timer.warning .score-value { color: var(--danger); }

/* Aquarium iframe container */
.aquarium-container {
    position: relative;
    height: 350px;
    border-radius: 30px;
    border: 3px solid rgba(45, 212, 191, 0.3);
    margin: 15px 0;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(45, 212, 191, 0.2),
        inset 0 0 100px rgba(0, 0, 0, 0.3);
}

#aquariumFrame {
    width: 100%;
    height: 100%;
    border: none;
}

.editor-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.15);
    padding: 15px 20px;
    margin: 15px 0;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.editor-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: var(--coral-pink);
}

.editor-buttons { display: flex; gap: 10px; }

.btn {
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start {
    background: linear-gradient(135deg, var(--seaweed-green), #059669);
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(45, 212, 191, 0.4);
}

.word-input-section { margin-bottom: 10px; }

.word-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#wordInput {
    flex: 1;
    padding: 10px 18px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    border: 2px solid var(--seaweed-green);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    outline: none;
    transition: all 0.3s;
}

#wordInput:focus {
    border-color: var(--coral-pink);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
}

#wordInput::placeholder { color: #9ca3af; }

.selected-word-display {
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
    color: var(--sand);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 12px;
    border: 2px solid var(--sand);
    min-width: 120px;
    text-align: center;
}

.selected-word-display.matched {
    border-color: var(--seaweed-green);
    color: var(--seaweed-green);
    background: rgba(45, 212, 191, 0.2);
}

.selected-word-display.no-match {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

#editor {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    border-radius: 12px;
    padding: 15px 18px;
    font-size: 1.15rem;
    line-height: 1.7;
    border: 2px solid rgba(45, 212, 191, 0.3);
    user-select: none;
    cursor: default;
}

#editor .highlight {
    background: linear-gradient(135deg, var(--coral-pink), var(--coral-orange));
    color: white;
    padding: 2px 6px;
    border-radius: 5px;
    animation: highlightPulse 1s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 157, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 107, 157, 0.8); }
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
    white-space: nowrap;
}

.legend-item.negative {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.legend-fish { font-size: 1.4rem; }

.legend-points {
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
}

.legend-points.positive { color: var(--seaweed-green); }
.legend-points.negative { color: var(--danger); }

.combo {
    position: fixed;
    top: 20px;
    right: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--sand);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s;
    text-shadow: 0 0 20px rgba(252, 211, 77, 0.8);
    z-index: 1000;
}

.combo.show { opacity: 1; transform: scale(1); }

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.game-over.show { opacity: 1; pointer-events: all; }

.game-over h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--coral-pink), var(--coral-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.game-over .final-score {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--sand);
    margin-bottom: 30px;
}

.game-over .stats { display: flex; gap: 40px; margin-bottom: 40px; }
.game-over .stat { text-align: center; }

.game-over .stat-value {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: var(--seaweed-green);
}

.game-over .stat-label {
    font-size: 1rem;
    color: var(--bubble-blue);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .aquarium-container { height: 280px; }
    .score-panel { gap: 15px; }
    .score-item { padding: 10px 15px; min-width: 100px; }
    .score-value { font-size: 1.5rem; }
    .word-input-wrapper { flex-direction: column; }
}
