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

body {
    font-family: 'Arial', sans-serif;
    background: #0A4A6E;
}

/* Fullscreen mode */
body.fullscreen {
    overflow: hidden;
    width: 100%;
    height: 100dvh;
}

body.fullscreen #game-container {
    height: 100dvh;
}

#game-container {
    width: 100%;
    min-height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* Ocean Background */
#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A4A6E 0%, #1E90FF 25%, #00CED1 50%, #0A6B8E 75%, #084A6D 100%);
    z-index: 0;
}

#background::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(32, 178, 170, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(30, 144, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 206, 209, 0.2) 0%, transparent 60%);
    animation: oceanWave 10s ease-in-out infinite;
}

@keyframes oceanWave {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.8; }
    50% { transform: scale(1.1) translateY(-10px); opacity: 1; }
}

/* Game Title */
#game-title {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 20px;
}

#game-title h1 {
    font-size: 4em;
    background: linear-gradient(45deg, #00CED1, #FFF, #1E90FF, #00CED1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: waterShine 2s linear infinite;
    text-shadow:
        3px 3px 0 #0A4A6E,
        5px 5px 10px rgba(30, 144, 255, 0.6);
    letter-spacing: 0.15em;
    font-weight: bold;
    transform: skewY(-1deg);
}

@keyframes waterShine {
    0% { background-position: 0% 50%; filter: brightness(1); }
    50% { background-position: 100% 50%; filter: brightness(1.4); }
    100% { background-position: 0% 50%; filter: brightness(1); }
}

.subtitle {
    color: #00CED1;
    font-size: 1.5em;
    letter-spacing: 0.3em;
    text-shadow:
        2px 2px 0 #0A4A6E,
        3px 3px 8px rgba(30, 144, 255, 0.8);
    font-weight: bold;
    font-style: italic;
}

/* Slot Machine */
#slot-machine {
    position: relative;
    z-index: 1;
    margin: 20px 0;
}

.slot-frame {
    background: linear-gradient(135deg, #1E90FF 0%, #0A6B8E 50%, #1E90FF 100%);
    border: 10px solid #00CED1;
    border-radius: 25px;
    padding: 30px;
    box-shadow:
        0 15px 60px rgba(30, 144, 255, 0.6),
        inset 0 0 40px rgba(0, 206, 209, 0.3),
        0 0 0 3px #20B2AA;
}

#reels-container {
    display: flex;
    gap: 10px;
    background: linear-gradient(180deg, #08394D 0%, #0A4A6E 100%);
    padding: 20px;
    border-radius: 15px;
    border: 5px solid #00CED1;
    box-shadow: inset 0 0 30px rgba(30, 144, 255, 0.4);
}

.reel {
    width: 120px;
    height: 360px;
    background: linear-gradient(180deg, #0A4A6E 0%, #08394D 50%, #0A4A6E 100%);
    border: 4px solid #1E90FF;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 0 20px rgba(0, 206, 209, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.5);
}

.symbol {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5em;
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.15) 0%, rgba(10, 74, 110, 0.1) 100%);
    border-bottom: 3px solid rgba(0, 206, 209, 0.3);
    transition: all 0.2s;
    user-select: none;
}

.symbol.winning {
    animation: fishSplash 0.6s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(0, 206, 209, 0.8) 0%, rgba(30, 144, 255, 0.7) 100%);
    box-shadow:
        0 0 30px rgba(0, 206, 209, 1),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes fishSplash {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
        filter: brightness(1.3) hue-rotate(10deg);
    }
}

.reel.spinning .symbol {
    animation: bubbleSpin 0.08s linear infinite;
}

@keyframes bubbleSpin {
    0% { filter: blur(0px); transform: translateY(0); }
    50% { filter: blur(4px); transform: translateY(-2px); }
    100% { filter: blur(0px); transform: translateY(0); }
}

.symbol.cascading {
    animation: swimDown 0.5s ease-in forwards;
}

@keyframes swimDown {
    0% {
        transform: translateY(-120px) rotate(-10deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

#paylines-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Control Panel */
#control-panel {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #1E90FF 0%, #0A6B8E 50%, #20B2AA 100%);
    border: 6px solid #00CED1;
    border-radius: 20px;
    padding: 25px;
    min-width: 640px;
    box-shadow:
        0 8px 40px rgba(30, 144, 255, 0.5),
        inset 0 3px 15px rgba(0, 206, 209, 0.3);
}

.info-display {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.label {
    color: #00CED1;
    font-size: 0.95em;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.value {
    color: #FFF;
    font-size: 2.1em;
    font-weight: bold;
    text-shadow:
        0 0 15px rgba(0, 206, 209, 1),
        2px 2px 6px rgba(0, 0, 0, 0.8),
        0 0 25px rgba(30, 144, 255, 0.6);
    min-width: 85px;
    text-align: center;
}

.win-value {
    color: #00CED1;
    text-shadow:
        0 0 20px rgba(0, 206, 209, 1),
        2px 2px 6px rgba(0, 0, 0, 0.9);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 16px 28px;
    font-size: 1.15em;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #00CED1 0%, #20B2AA 50%, #00CED1 100%);
    color: #0A4A6E;
    font-size: 1.6em;
    padding: 22px 55px;
    border: 5px solid #1E90FF;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
    box-shadow:
        0 8px 25px rgba(0, 206, 209, 0.6),
        inset 0 3px 8px rgba(255, 255, 255, 0.6);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #40E0E0 0%, #48D1CC 50%, #40E0E0 100%);
    box-shadow:
        0 0 35px rgba(0, 206, 209, 1),
        inset 0 3px 10px rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #1E90FF 0%, #0A6B8E 50%, #1E90FF 100%);
    color: #00CED1;
    border: 4px solid #084A6D;
    padding: 16px 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4169E1 0%, #1E90FF 50%, #4169E1 100%);
    box-shadow: 0 0 25px rgba(30, 144, 255, 0.8);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 74, 110, 0.93);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1E90FF 0%, #0A6B8E 50%, #20B2AA 100%);
    border: 6px solid #00CED1;
    border-radius: 25px;
    padding: 40px;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow:
        0 0 60px rgba(0, 206, 209, 0.7),
        inset 0 3px 25px rgba(30, 144, 255, 0.2);
}

.modal-content h2 {
    color: #00CED1;
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 15px;
    text-shadow:
        2px 2px 0 #0A4A6E,
        4px 4px 12px rgba(30, 144, 255, 0.8);
}

.paytable-note {
    text-align: center;
    color: #00CED1;
    font-size: 1.15em;
    margin-bottom: 20px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #1E90FF;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 22px;
    font-size: 2.8em;
    color: #00CED1;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

.close-btn:hover {
    color: #FFF;
    transform: rotate(90deg) scale(1.2);
}

.paytable-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.paytable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    border-radius: 12px;
    border: 3px solid #1E90FF;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.paytable-item.special {
    background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%);
    border-color: #1E90FF;
}

.symbol-display {
    font-size: 1.6em;
    color: #00CED1;
    font-weight: bold;
}

.payout {
    color: #00CED1;
    font-size: 1.4em;
    font-weight: bold;
}

.paytable-item.special .symbol-display,
.paytable-item.special .payout {
    color: #0A4A6E;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.6);
}

.cascade-info {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 15px;
    border: 3px solid #00CED1;
}

.cascade-info h3 {
    color: #00CED1;
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: center;
}

.cascade-info p {
    color: #FFF;
    line-height: 1.6;
    text-align: center;
}

/* Win Overlay */
#win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 144, 255, 0.9);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

#win-overlay.hidden {
    display: none;
}

.win-message {
    text-align: center;
    animation: catchAnim 0.7s ease-out;
}

.win-message h2 {
    font-size: 6em;
    background: linear-gradient(45deg, #00CED1, #FFF, #00CED1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: waterShine 1s linear infinite;
    text-shadow:
        0 0 30px rgba(0, 206, 209, 1),
        0 0 50px rgba(30, 144, 255, 0.8);
    margin-bottom: 25px;
}

.win-message .win-amount {
    font-size: 3.5em;
    color: #FFF;
    font-weight: bold;
    text-shadow:
        3px 3px 0 #0A4A6E,
        5px 5px 15px rgba(0, 206, 209, 0.8);
}

@keyframes catchAnim {
    0% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.25) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Cascade Counter */
#cascade-counter {
    position: fixed;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    z-index: 45;
}

#cascade-counter.hidden {
    display: none;
}

.cascade-badge {
    background: linear-gradient(135deg, #1E90FF 0%, #0A6B8E 100%);
    border: 5px solid #00CED1;
    border-radius: 15px;
    padding: 20px;
    box-shadow:
        0 0 35px rgba(0, 206, 209, 0.9),
        inset 0 2px 12px rgba(30, 144, 255, 0.3);
    animation: wavePulse 0.8s ease-in-out infinite;
}

.cascade-text {
    font-size: 1.8em;
    font-weight: bold;
    color: #00CED1;
    text-shadow:
        2px 2px 0 #000,
        3px 3px 6px rgba(30, 144, 255, 0.8);
}

@keyframes wavePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 35px rgba(0, 206, 209, 0.9); }
    50% { transform: scale(1.1); box-shadow: 0 0 50px rgba(0, 206, 209, 1); }
}

/* Responsive */
@media (max-width: 768px) {
    .slot-frame {
        padding: 15px;
    }

    #game-title h1 {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 1.1em;
    }

    .reel {
        width: 75px;
        height: 245px;
    }

    .symbol {
        height: 81px;
        font-size: 3em;
    }

    #control-panel {
        min-width: auto;
        width: 92%;
    }

    .controls {
        gap: 10px;
        flex-wrap: wrap;
    }

    .btn-primary {
        padding: 14px 28px;
        font-size: 1.2em;
    }

    .btn-secondary {
        padding: 12px 18px;
        font-size: 0.95em;
    }

    .value {
        min-width: 60px;
    }

    #cascade-counter {
        right: 12px;
    }

    .cascade-badge {
        padding: 12px;
    }

    .cascade-text {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    #game-title h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .slot-frame {
        padding: 10px;
        border-width: 4px;
        border-radius: 15px;
    }

    #reels-container {
        gap: 4px;
        padding: 8px;
    }

    .reel {
        width: 52px;
        height: 168px;
    }

    .symbol {
        height: 56px;
        font-size: 2em;
    }

    #control-panel {
        width: 96%;
        padding: 10px;
        border-width: 3px;
    }

    .info-display {
        gap: 8px;
    }

    .label {
        font-size: 0.75em;
    }

    .value {
        font-size: 1.4em;
    }

    .btn-primary {
        padding: 10px 18px;
        font-size: 1em;
    }

    .btn-secondary {
        padding: 6px 10px;
        font-size: 0.8em;
        border-width: 3px;
    }

    .controls {
        gap: 5px;
        flex-wrap: wrap;
    }

    .value {
        min-width: auto;
    }

    #game-title {
        margin-bottom: 8px;
    }

    #slot-machine {
        margin: 8px 0;
    }

    #game-container {
        padding: 8px 0;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #game-title {
        display: none;
    }

    #game-container {
        padding: 5px 0;
    }

    #slot-machine {
        margin: 5px 0;
    }

    .slot-frame {
        padding: 8px;
        border-width: 4px;
    }

    #reels-container {
        padding: 8px;
    }

    .reel {
        height: 135px;
    }

    .symbol {
        height: 45px;
        font-size: 2em;
    }

    #control-panel {
        padding: 10px;
        border-width: 3px;
    }

    .info-display {
        margin-bottom: 8px;
    }

    .value {
        font-size: 1.4em;
        min-width: auto;
    }

    .btn-primary {
        padding: 8px 20px;
        font-size: 1em;
        border-width: 3px;
    }

    .btn-secondary {
        padding: 8px 16px;
        font-size: 0.85em;
    }

    #cascade-counter {
        display: none;
    }
}
