* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
}

body {
    font-family: 'Press Start 2P', 'Microsoft YaHei', monospace;
    background: #181c2b;
    background-image: 
        linear-gradient(rgba(24, 28, 43, 0.95), rgba(24, 28, 43, 0.95)),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0.15) 4px
        );
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 360px;
}

.instructions {
    padding: 22px;
    background: #212838;
    font-size: 15px;
    color: #ffffff;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    line-height: 2;
}

.instructions h3 {
    margin-bottom: 14px;
    color: #ffcc00;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000;
}

.instructions ul {
    margin-left: 20px;
}

.size-panel {
    background: #212838;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.size-title {
    color: #ffcc00;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 2px;
}

.size-selector {
    display: flex;
    gap: 20px;
    justify-content: space-around;
    align-items: center;
}

.size-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-input-group label {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 0 #000;
}

.size-select {
    width: 80px;
    height: 48px;
    font-size: 18px;
    font-family: 'Press Start 2P', 'Microsoft YaHei', monospace;
    font-weight: bold;
    border: 4px solid #000;
    background: #2c3545;
    color: #ffffff;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    outline: none;
}

.size-select:hover {
    background: #1162b5;
    color: #ffffff;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 4px solid #000;
    cursor: pointer;
    font-family: 'Press Start 2P', 'Microsoft YaHei', monospace;
    box-shadow: 4px 4px 0 #000;
    text-shadow: 2px 2px 0 #000;
    transition: all 0.1s;
    font-weight: bold;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.btn-grid {
    background: #2c3545;
    color: #ffffff;
}

.btn-restart {
    background: #ffcc00;
    color: #000;
    text-shadow: none;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pond-stats {
    font-size: 13px;
    color: #ffffff;
    text-align: center;
    padding: 12px 18px;
    background: #212838;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    font-family: 'Press Start 2P', 'Microsoft YaHei', monospace;
    text-shadow: 2px 2px 0 #000;
    white-space: pre-wrap; 
}

.pond-container {
    position: relative;
    background: linear-gradient(to bottom, #06162d 0%, #0a3366 25%, #0b4b8f 70%, #1162b5 100%);
    border-top: 6px solid #3becff; 
    border-left: 8px solid #000;
    border-right: 8px solid #000;
    border-bottom: 8px solid #000;
    box-shadow: 8px 8px 0 #000;
    overflow: hidden;
}

.grid {
    display: grid;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
}

.cell {
    width: 100px;
    height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1; 
}

.grid.hide-lines .cell {
    border-color: transparent;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cell.blocked {
    background: #2c3545;
    border: 4px inset #47566e !important;
    box-shadow: inset 4px 4px 0px #161b24;
    cursor: not-allowed;
    z-index: 20; 
}

.fish {
    position: absolute;
    width: 48px;
    height: 32px;
    z-index: 10;
    user-select: none;
    cursor: pointer;
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.7));
}

.fish.main-target {
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.7)) drop-shadow(0 0 6px rgba(0, 255, 200, 0.8));
}

.fish.ambient {
    opacity: 1.0 !important; 
    z-index: 8;
}

.fish-body-wrap {
    width: 100%;
    height: 100%;
}

.fish-body-wrap.swimming {
    animation: tailWag 1.4s ease-in-out infinite alternate;
}

@keyframes tailWag {
    0% { transform: scaleY(0.98) skewY(-1deg) translateY(-1px); }
    100% { transform: scaleY(1.02) skewY(1deg) translateY(1px); }
}

.pixel-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    width: 4px;
    height: 4px;
    pointer-events: none;
    z-index: 2;
}

.question-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 400px;
}

.question-panel h2 {
    color: #ff6b6b;
    text-align: center;
    font-size: 20px;
    text-shadow: 2px 2px 0 #000;
}

.question-box {
    background: #212838;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 5px;
}

.question-text {
    font-size: 16px;
    color: #ffffff;
    line-height: 1.8;
    padding: 20px;
    background: #1c2635;
    border: 2px dashed #47566e;
    border-left: 8px solid #ff6b6b;
    margin-bottom: 15px;
    font-weight: bold;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 5px 5px 5px;
}

.option-btn {
    padding: 16px 20px;
    font-size: 15px;
    border: 4px solid #000;
    background: #232f44;
    cursor: pointer;
    transition: all 0.1s;
    text-align: left;
    color: #ffffff;
    font-family: 'Press Start 2P', 'Microsoft YaHei', monospace;
    box-shadow: 3px 3px 0 #000;
    font-weight: bold;
}

.option-btn:hover {
    border-color: #ff6b6b;
    background: #2c3c56;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
}

.option-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
}

.option-btn.correct {
    background: #1b5e20 !important;
    border-color: #4caf50 !important;
    color: #ffffff !important;
}

.option-btn.wrong {
    background: #b71c1c !important;
    border-color: #f44336 !important;
    color: #ffffff !important;
}

.result-message {
    text-align: center;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    border: 4px solid #000;
    box-shadow: 3px 3px 0 #000;
    margin-top: 15px;
    text-shadow: 1px 1px 0 #000;
}

.result-message.success { background: #1b5e20; color: #ffffff; }
.result-message.fail { background: #b71c1c; color: #ffffff; }

.no-question {
    text-align: center;
    color: #a0aec0;
    padding: 70px 20px;
    font-size: 15px;
    line-height: 2;
    background: #212838;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
}

.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #212838;
    padding: 45px 50px;
    border: 8px solid #000;
    box-shadow: 8px 8px 0 #000;
    z-index: 1000;
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.celebration-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #2c3545;
    color: #ffffff;
    border: 3px solid #000;
    font-size: 16px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0 #000;
    font-weight: bold;
}

.celebration-close:hover {
    background: #b71c1c;
    color: #ffffff;
}

.celebration h2 {
    font-size: 24px;
    color: #ffcc00;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #000;

}

.celebration p {
    font-size: 16px;
    color: #fff;
    line-height: 1.8;
}

@media (max-width: 1200px) {
    .container { flex-direction: column; align-items: center; }
    .control-panel, .question-panel { width: 100%; max-width: 440px; }
}