html,
body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #fff;
    font-family: Arial, sans-serif;
    height: auto;
    overflow-x: hidden;
    overflow-y: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

:root {
    --top-nav-height: 10vh;
    --bottom-nav-height: 20vh;
}

#main-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
    overflow-x: hidden;
    overflow-y: hidden;
}

.top-dashboard {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1vh 1vw;
    height: 10vh;
    width: 100%;
    gap: 1vw;
    background: black;
    z-index: 200;
    box-sizing: border-box;
    position: relative;
}

/* 🔥 Button Styling */

.button {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 0 2.5vh;
    margin: 0;
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(1rem, 2.2vh, 3vh);
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
    position: relative;
    animation: casinoShake 2s infinite ease-in-out alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* ✨ Hover Effect: Stop shaking & add full golden gust */

.button:hover {
    transform: translateY(-0.6vh);
    animation: none;
    animation: goldenGust 0.75s linear forwards;
}

/* 🎯 Click Effect: Pressed down slightly */
.button:active {
    transform: translateY(0.4vh);
}

.top-spacer {
    flex: 2.5;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #121212;
    border-radius: 10px;
    padding: 0 2.5vh;
    box-sizing: border-box;
}

.balance-display {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.4rem, 3.2vh, 4vh);
    font-weight: bold;
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Volatilty button */

.volatility-container {
    flex: 1;
    height: 100%;
    padding: 0 2.5vh;
    margin: 0;
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(1rem, 2.2vh, 3vh);
    text-align: center;
    text-transform: uppercase;
    width: 100%;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
    position: relative;
    animation: casinoShake 2s infinite ease-in-out alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #000, #222);
    border: 2px solid gold;
    color: white;
    box-sizing: border-box;
}

/* ✨ Hover Effect */
.volatility-container:hover {
    transform: translateY(-0.6vh);
    animation: none;
    box-shadow: 0 0 10px gold;
}

/* 🎯 Click Effect */
.volatility-container:active {
    transform: translateY(0.4vh);
}

/* 🌊 Watermark Levels */
.water-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    opacity: 0.7;
    transition: height 0.4s ease-in-out, background 0.4s ease-in-out;
}

/* 💬 Centered Text */
.volatility-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1rem, 2vh, 2.6vh);
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    background: rgb(0, 0, 0);
    padding: 5px 15px;
    border-radius: 5px;
    z-index: 10;
}

/* ⮌ Pulsating Return Icon */
.return-icon {
    position: absolute;
    top: 5px;
    right: 10px;
    width: 6vh;
    height: 6vh;
    font-size: 4vh;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    background: black;
    z-index: 10;
}

/* Hover animation for return icon */
.return-icon:hover {
    animation: pulse 0.7s infinite alternate ease-in-out;
}

/* Background video */

#video-background-container {
    position: absolute;
    top: var(--top-nav-height, 10vh);
    left: 0;
    width: 100%;
    height: calc(100% - var(--top-nav-height, 10vh) - var(--bottom-nav-height, 20vh));
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

#background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Space between top dashboard and chart container */

.chart-margin-spacer-top {
    height: 10vh;
    width: 100%;
    flex-shrink: 0;
}

/* chart container */

#chart-container {
    flex: 1 0 auto;
    width: 80%;
    height: 50vh;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-inline: auto;
    border-radius: 10px;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 70%),
        linear-gradient(rgba(26, 26, 26, 0.6), rgba(26, 26, 26, 0.6));
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(255, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 255, 0.6);
}

/* Promo inside chart container */

/* Full overlay layer */
.promo-celebration {
    position: absolute;
    inset: 0;
    /* fills the chart container */
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 5;
    box-sizing: border-box;
    /* padding: 2.5vmin;  <-- remove this to avoid double-padding */
}

/* Inner stack so we can animate the whole block */
.promo-burst {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 24px #ffd700;
    animation: promo-pop 420ms ease-out,
        promo-fade 1.8s 420ms ease-out forwards;
    position: relative;
    z-index: 1;
}

/* Huge, responsive amount line */
.promo-amount {
    font-weight: 900;
    letter-spacing: 0.02em;
    /* responsive to both orientations */
    /* font-size: clamp(24px, 8vmin, 72px); */
    font-size: clamp(24px, 8vmin, 84px);
    line-height: 1.05;
}

/* Smaller label line */
.promo-label {
    opacity: 0.95;
    /* font-size: clamp(14px, 3.2vmin, 24px); */
    font-size: clamp(14px, 3.2vmin, 28px);
}

.promo-line {
    font-weight: 900;
    letter-spacing: 0.02em;
    font-size: 48px;
    /* default; JS will override to something huge */
    line-height: 1.05;
    white-space: nowrap;
}

/* Subtle expanding ring */
.promo-burst::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 40vmin;
    height: 40vmin;
    max-width: 80%;
    max-height: 80%;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 40px rgba(255, 215, 0, 0.25);
    animation: ring-ping 1.2s ease-out forwards;
    z-index: 0;
}

/* Screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    /* legacy */
    clip-path: inset(50%);
    /* modern */
    white-space: nowrap;
    border: 0;
}

/* Keyframes */
@keyframes promo-pop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    70% {
        transform: scale(1.06);
        opacity: 1;
    }

    100% {
        transform: scale(1.0);
        opacity: 1;
    }
}

@keyframes promo-fade {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes ring-ping {
    0% {
        transform: scale(0.6);
        opacity: 0.45;
    }

    70% {
        transform: scale(1.08);
        opacity: 0.25;
    }

    100% {
        transform: scale(1.12);
        opacity: 0;
    }
}

/* Candlesticks */

.candle {
    background: transparent;
    overflow: hidden;
}

.candle-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: scaleY(0);
    transform-origin: bottom;
    will-change: transform, opacity;
    pointer-events: none;
    border-radius: inherit;
}

.candle-fill.green {
    background: linear-gradient(to right, #00ff00, #009900);
    box-shadow: 0 0 15px #00ff00, 0 0 30px #008000;
    border: 1px solid #00ff00;
    animation: pulseGlowGreen 1.5s infinite alternate;
}

.candle-fill.red {
    background: linear-gradient(to right, #ff0000, #990000);
    box-shadow: 0 0 15px #ff0000, 0 0 30px #800000;
    border: 1px solid #ff0000;
    animation: pulseGlowRed 1.5s infinite alternate;
}

#candlestick-chart {
    position: relative;
    width: 95%;
    height: 95%;
    display: block;
    clip-path: inset(5% 0 5% 0);
}

.candle {
    position: absolute;
    border-radius: 5px;
    transition: transform 0.1s ease-in-out;
}

.green {
    background: linear-gradient(to right, #00ff00, #009900);
    box-shadow: 0px 0px 15px #00ff00, 0px 0px 30px #008000;
    border: 1px solid #00ff00;
    animation: pulseGlowGreen 1.5s infinite alternate;
}

.red {
    background: linear-gradient(to right, #ff0000, #990000);
    box-shadow: 0px 0px 15px #ff0000, 0px 0px 30px #800000;
    border: 1px solid #ff0000;
    animation: pulseGlowRed 1.5s infinite alternate;
}

.whisker {
    position: absolute;
    width: 6px;
    height: 100%;
    background: white;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0px 0px 8px rgba(255, 255, 255, 0.7);
    animation: whiskerGlow 1.5s infinite alternate, whiskerFlicker 0.2s infinite;
}

/* outer neon not clipped by the fill's overflow */
.candle[data-original-color="green"] {
    filter: drop-shadow(0 0 8px #00ff00) drop-shadow(0 0 18px #00cc00);
}

.candle[data-original-color="red"] {
    filter: drop-shadow(0 0 8px #ff3b3b) drop-shadow(0 0 18px #ff6b6b);
}

@keyframes pulseGlowGreen {
    0% {
        box-shadow: 0 0 10px #00ff00, 0 0 20px #009900;
    }

    100% {
        box-shadow: 0 0 20px #00ff00, 0 0 35px #00cc00;
    }
}

@keyframes whiskerGlow {
    0% {
        box-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow: 0px 0px 15px rgba(255, 255, 255, 1);
    }

    100% {
        box-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5);
    }
}

@keyframes whiskerFlicker {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* God Candles */

#god-chart {
    position: absolute;
    top: 5%;
    bottom: 5%;
    left: 0;
    width: 100%;
    height: 90%;
    z-index: 999;
    pointer-events: auto;
    padding: 0;
}

.god-candle {
    position: absolute;
    border-radius: 5px;
    transform: translate(calc(-50% + var(--hover-pop-x, 0px)), var(--hover-pop-y, 0px)) scale(var(--hover-scale)) scaleY(var(--grow-scale, 1));
    transition: transform 0.3s ease-in-out, height 0.5s ease-in-out, opacity 0.3s ease;
    animation: candleGrow 0.6s ease-out forwards;
    animation-fill-mode: forwards;
}

.god-candle .whisker {
    position: absolute;
    width: 6px;
    background: white;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0px 0px 8px rgba(255, 255, 255, 0.7);
    animation: whiskerGlow 1.5s infinite alternate, whiskerFlicker 0.2s infinite;
    pointer-events: none;
    z-index: 1;
}

.god-candle .whisker.top {
    bottom: 100%;
    margin-bottom: 4px;
}

.god-candle .whisker.bottom {
    top: 100%;
    margin-top: 4px;
}

.god-candle.vine-body {
    background-size: cover;
    background-blend-mode: normal;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #fffef5;
    border: 2px solid gold;
}

.god-candle.god-glow {
    animation: pulseGodGlow 1.5s infinite alternate ease-in-out, candleGrow 0.6s ease-out forwards;
    --glow-color: gold;
}

.god-candle.god-flash {
    filter: brightness(1.8);
    transition: filter 0.15s ease-in-out;
}

.god-candle.orange {
    background: linear-gradient(to top, #FFA500, #FF8C00);
    border: 1px solid #FF8C00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
}

.god-candle-glow {
    animation: pulseGodGlow 1.5s infinite alternate ease-in-out !important;
    box-shadow: 0 0 15px gold, 0 0 30px orange !important;
    border: 2px solid gold !important;
}

@keyframes candleGrow {
    0% {
        height: 0;
        opacity: 0;
        --grow-scale: 0.1;
    }

    50% {
        opacity: 1;
        --grow-scale: 1.05;
    }

    100% {
        opacity: 1;
        --grow-scale: 1;
    }
}

@keyframes pulseGodGlow {
    0% {
        box-shadow: 0 0 15px var(--glow-color), 0 0 30px var(--glow-color);
    }

    100% {
        box-shadow: 0 0 30px var(--glow-color), 0 0 60px var(--glow-color);
    }
}

.key {
    font-size: 2.5vw;
    padding: 8px 14px;
    border-radius: 5px;
    border: 2px solid #666;
    background: linear-gradient(180deg, #444, #222);
    box-shadow: 0px 3px 0px #333, 0px 4px 5px rgba(0, 0, 0, 0.4);
    font-family: monospace;
    text-transform: uppercase;
}

.invest-button-container.instruction-mode {
    height: clamp(18vh, 35vh, 40vh);
    aspect-ratio: 1 / 1;
    max-width: 100%;
    border-radius: 50%;
    position: relative;
    overflow: visible;
    animation: divineGlow 2s infinite ease-in-out;
    transition: transform 0.3s ease-in-out;
}

/* SKIP/RETURN buttons */

#skip-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.skip-button,
.return-button {
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.skip-button {
    background-color: #00BFFF;
    width: 72px;
    height: 72px;
    animation: glowing-skip 1.5s infinite ease-in-out;
}

.skip-button svg {
    width: 60px;
    height: 60px;
    fill: white;
    filter: drop-shadow(0 0 6px white);
    transition: transform 0.2s ease, filter 0.3s ease;
}

.return-button {
    background: transparent;
    width: 108px;
    height: 108px;
}

.return-button svg {
    width: 100%;
    height: 100%;
    fill: white;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    transition: transform 0.2s ease, filter 0.3s ease;
}

.return-button:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px gold);
}

/* 🔁 Pulsing animation */
@keyframes glowing-skip {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px white);
    }

    50% {
        transform: scale(1.12);
        filter: drop-shadow(0 0 14px white);
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px white);
    }
}

/* God candle tooltip */

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px gold;
    max-width: 250px;
    line-height: 1.4;
    transition: opacity 0.2s ease;
    white-space: pre-line;
}

#god-return-button {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 9999;
}

/* Store */

#store-special {
    flex: 5;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
}

#store-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#store-container {
    display: flex;
    /* This is the replacement */
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    /* Prevents chart overlap */
}

.close-button {
    font-size: 45px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    animation: flashGlow 1s infinite alternate;
    text-shadow: 0 0 10px white;
    padding: 0;
}

#store-all-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    /* This is the replacement */
}

#store-header {
    flex: 0 0 auto;
    padding: 10px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    /* This is the replacement */
}

#store-buttons {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
    box-sizing: border-box;

}

.store-button {
    font-size: clamp(1.2rem, 2.5vh, 2rem);
    padding: 1.2em;
    flex: none;
    min-height: 50px;
    max-height: 120px;
    background-color: black;
    color: gold;
    border: 2px solid gold;
    border-radius: 12px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
    animation: subtlePulse 2s infinite ease-in-out;
}

.store-button:hover {
    background-color: #222;
}

.price-face,
.hover-amount {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.8rem;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.price-face {
    opacity: 1;
}

.hover-amount {
    opacity: 0;
}

.store-button:hover .price-face {
    opacity: 0;
}

.store-button:hover .hover-amount {
    opacity: 1;
}

#store-tabs {
    /* This is the replacement!!! */
    flex-shrink: 0;
    height: 8vh;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    gap: 10px;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-evenly;
}

.store-tab {
    flex: 1 1 auto;
    /* ✅ Grow/shrink evenly */
    min-width: 160px;
    /* ✅ Good for desktop */
    max-width: 100%;
    /* ✅ Avoid overflow */
    padding: 10px 20px;
    white-space: nowrap;
    font-size: 1.2rem;
    border-radius: 12px;
    text-align: center;
    background: white;
    color: black;
    font-weight: bold;
    animation: subtlePulse 2s infinite ease-in-out;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    /* 🔥 Ensures full-height for alignment */
}

.store-tab:hover {
    background: gold;
    transform: scale(1.05);
}

.store-tab.active {
    background: gold;
    color: black;
}

.free-spin-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    text-align: center;
    padding: 10px;
    background-color: transparent;
    border: 2px solid gold;
    border-radius: 12px;
    overflow-x: auto;
    box-sizing: border-box;
    gap: 10px;
}

.bet-header {
    font-weight: bold;
    font-size: 1.2rem;
    color: gold;
}

.row-header {
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
}

.grid-cell {
    font-size: 1rem;
    color: white;
}

#store-top-buttons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10;
}

#store-return-button,
#store-close-button {
    display: flex;
    align-items: center;
    height: 100%;
}

#store-close-button {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.8vh 1.5vw;
    /* Push inward to avoid collisions */
    z-index: 9999;
}

.close-button {
    font-size: 40px;
    /* Slightly smaller than 45px */
    padding: 0;
    margin: 0;
}

.return-button,
.close-button {
    font-size: 45px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    animation: flashGlow 1s infinite alternate;
    text-shadow: 0 0 10px white;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#store-special table {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    overflow: hidden;
}

#store-special th,
#store-special td {
    border: 1px solid gray;
    padding: 10px;
    font-size: 18px;
}

#store-special th {
    background-color: gold;
    color: black;
    font-weight: bold;
}

#store-special td {
    background-color: #111;
}

/* Treasure */

.treasure-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 20px;
    flex: 1;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    justify-items: center;
    align-items: center;
}

.treasure-svg {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1 / 1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: pulseWhite 1.5s infinite;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.floating-coin-popup {
    position: fixed;
    /* font-size: 2rem; */
    font-weight: bold;
    color: #39ff14;
    text-shadow: 0 0 4px white, 0 0 10px #39ff14, 0 0 20px #00ff99;
    animation: coinFloatUp 2.5s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    transform: translate(-50%, 0);
    transition: transform 0.4s ease-in-out;
}

.floating-coin-popup--sm {
    font-size: 1.4rem;
}

.floating-coin-popup--md {
    font-size: 2rem;
}

/* same as original */
.floating-coin-popup--lg {
    font-size: 3rem;
}

.empty-svg {
    background: none !important;
    pointer-events: none;
}

.treasure-timer-final {
    font-size: 12vh;
    font-weight: bold;
    color: white;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    animation: timerAppear 0.6s ease-out, pulseWhite 1.5s infinite;
}

.treasure-timer-value {
    font-size: 12vh;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px white;
    animation: pulseTextShadow 1.5s infinite ease-in-out;

}

@keyframes subtlePulse {
    0% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.015) rotate(-0.3deg);
    }

    50% {
        transform: scale(1) rotate(0deg);
    }

    75% {
        transform: scale(1.015) rotate(0.3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes flashGlow {
    from {
        opacity: 0.6;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 10px gold;
    }

    to {
        box-shadow: 0 0 25px white;
    }
}

@keyframes pulseOnce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulseWhite {
    0% {
        filter: drop-shadow(0 0 5px white);
    }

    50% {
        filter: drop-shadow(0 0 12px white);
    }

    100% {
        filter: drop-shadow(0 0 5px white);
    }
}

@keyframes coinFloatUp {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
        scale: 1;
    }

    30% {
        transform: translate(-50%, -30px) scale(1.2);
    }

    70% {
        transform: translate(-50%, -100px) scale(1);
    }

    100% {
        transform: translate(-50%, -180px);
        opacity: 0;
        scale: 0.8;
    }
}

@keyframes timerAppear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseTextShadow {
    0% {
        text-shadow: 0 0 1px #aaa;
    }

    50% {
        text-shadow: 0 0 4px #fff, 0 0 2px #aaa;
    }

    100% {
        text-shadow: 0 0 1px #aaa;
    }
}

.bottom-dashboard {
    width: 100%;
    height: 20vh;
    background: black;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 10vh 10vh;
    box-sizing: border-box;
    z-index: 200;
    padding: 0;
    position: relative;
}

.bottom-left {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-rows: 50% 50%;
    padding: 1vh 1vw;
    box-sizing: border-box;
}

.bottom-center {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1vh 0;
    box-sizing: border-box;
}

.bottom-right {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-rows: 50% 50%;
    padding: 1vh 1vw;
    box-sizing: border-box;
}

.invest-button-container {
    height: 100%;
    max-height: 19.5vh;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: visible;
    padding: 0;
}

.bet-button-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    animation: hypnoticSpin 4s linear infinite;
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
    z-index: 1;
}

.invest-button-container:hover .bet-button-img {
    animation: hypnoticSpin 4s linear infinite, surfacePulseGlow 1.5s infinite ease-in-out;
    transform: scale(1.05);
}

.invest-button-container:active .bet-button-img {
    transform: scale(0.92);
    animation: none;
    filter: brightness(1.5) drop-shadow(0 0 12px red);
}

.bottom-spacer {
    padding: 0 2.5vh;
    box-sizing: border-box;
    width: 100%;
    background: #121212;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-display {
    height: 100%;
    width: 100%;
    font-size: clamp(1.4rem, 3.2vh, 4vh);
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
}

.flash-green {
    background: linear-gradient(to right, #00ff00, #009900) !important;
    box-shadow: 0px 0px 15px #00ff00, 0px 0px 30px #008000 !important;
    border: 1px solid #00ff00 !important;
    animation: pulseGlowGreen 1.5s infinite alternate !important;
}

/* ✅ Betsicle - Gold Background, Black Font */

.chart-margin-spacer-bottom {
    height: 10vh;
    width: 100%;
    flex-shrink: 0;
    transition: height 0.3s ease;
}

.chart-margin-spacer-bottom.collapsed {
    height: 0;
}

.bet-selection-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 0;
    transition: height 0.3s ease;
    width: 100%;
    background: transparent;
}

.bet-selection-wrapper.active {
    height: 10vh;
    width: 100%;
    overflow-x: auto;
    z-index: 190;
}

.bet-selection-bar {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: flex-start;
    width: max-content;
    min-width: 100%;
    max-width: none;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    opacity: 0;
    font-size: clamp(1rem, 2.2vh, 2.4vh);
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
    background: black;
    z-index: 191;
}

.bet-selection-bar.active {
    height: 10vh;
    opacity: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 1vh 2vw;
}

#betsButton {
    transform: translateY(-2px);
    transition: all 0.1s ease-in-out;
    font-size: clamp(0.8rem, 1.6vw, 1.4rem);
    font-weight: bold;
    padding: 0.5vh 1.6vh;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-align: center;
    width: clamp(90px, 22vw, 140px);
    box-sizing: border-box;
    line-height: 1.1;
}

/* 2-line wave container */
.bets-wave-block{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  line-height:1.05;   /* tight but readable */
}

/* each row is its own wave line */
.bets-wave-row{
  display:inline-flex;
  align-items:baseline;
  gap:0.02em;
}

/* each character */
.bets-wave-row .ch{
  display:inline-block;
  will-change: transform;
  animation: betsWave var(--wave-dur, 1.8s) ease-in-out infinite; /* duration is a var now */
}

/* space placeholder (keeps spacing even when split into rows) */
.bets-wave-row .sp{
  width:0.38em;
  animation:none;
}

/* ensures visible gap in single-line mode; no animation on space */
.bets-wave-row .sp{
  display:inline-block;
  width:0.42em;     /* tweak 0.36–0.48em to taste */
  animation:none;
}

/* the keyframes now read the amplitude from a var */
@keyframes betsWave{
  0%,100%{ transform: translateY(0); }
  40%    { transform: translateY(var(--wave-amp, -0.25em)); } /* amplitude is a var */
}

@media (prefers-reduced-motion: reduce){
  .bets-wave-row .ch{ animation:none; }
}

.bet-option,
.free-spin-option {
    padding: 0.7vh 2.2vh;
    border-radius: 3vh;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    transform: translateY(-2px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(80px, 10vw, 140px);
    font-size: inherit;
    height: auto;
    line-height: inherit;
    box-sizing: border-box;
}

.bet-option {
    font-size: inherit;
    font-weight: bold;
}

.free-spin-option {
    position: relative;
    display: inline-block;
    min-width: clamp(80px, 10vw, 140px);
    height: clamp(5vh, 9vh, 10vh);
    border-radius: 9999px;
    font-size: inherit;
    font-weight: bold;
    background: transparent;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
}

.bet-option.selected {
    box-shadow: none;
    transform: translateY(2px);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    z-index: 1;
    transition: background 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mini-spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.2vh 1vh;
    font-size: clamp(0.8rem, 1.6vh, 1rem);
    font-weight: bold;
    border-radius: 9999px;
    background: black;
    color: white;
    white-space: nowrap;
    border: 2px solid gold;
    z-index: 2;
    text-align: center;
    pointer-events: none;
}


@keyframes hypnoticSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes surfacePulseGlow {
    0% {
        filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
    }

    50% {
        filter: brightness(1.3) drop-shadow(0 0 15px gold);
    }

    100% {
        filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
    }
}

/* 🎰 Subtle Casino Button Shake */

@keyframes casinoShake {
    0% {
        transform: translateX(0px) rotate(0deg);
    }

    25% {
        transform: translateX(-0.5px) rotate(-0.5deg);
    }

    50% {
        transform: translateX(0.5px) rotate(0.5deg);
    }

    75% {
        transform: translateX(-0.5px) rotate(-0.5deg);
    }

    100% {
        transform: translateX(0px) rotate(0deg);
    }
}

/* ✨ Full Golden Gust Effect – Now Right to Left */
@keyframes goldenGust {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes pulseGlowRed {
    0% {
        box-shadow: 0px 0px 12px rgba(255, 0, 0, 0.7);
    }

    50% {
        box-shadow: 0px 0px 25px rgba(255, 0, 0, 1);
    }

    100% {
        box-shadow: 0px 0px 12px rgba(255, 0, 0, 0.7);
    }
}








@media screen and (orientation: landscape) and (max-width: 812px) {

    html,
    body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #main-layout {
        min-height: calc(var(--vh, 1vh) * 100);
        min-height: 100vh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #chart-container {
        height: 50vh;
    }

    #store-buttons {
        gap: 10px;
        padding: 10px;
    }

    .store-button {
        font-size: clamp(1.1rem, 2.2vh, 1.6rem);
        padding: 1em;
    }

    #store-tabs {
        justify-content: flex-start;
        padding: 8px 12px;
        height: 8vh;
        overflow-y: hidden;
    }

    .store-tab {
        min-width: 120px;
        max-width: 180px;
        font-size: 1.05rem;
        padding: 8px 16px;
        flex: 0 0 auto;
    }

    #god-chart {
        padding: 0 2vw;
    }

    .god-candle {
        transform: scale(1.1);
    }

    .tooltip {
        font-size: 1.2rem;
        max-width: 250px;
    }

    .treasure-timer-final {
        font-size: 9vh;
        height: auto;
        padding-bottom: 3vh;
    }

    .treasure-timer-value {
        font-size: 9vh;
    }

    /* 🎯 Skip Button Adjustments */
    #skip-button {
        bottom: 12px;
        right: 12px;
    }

    .skip-button {
        width: 60px;
        height: 60px;
    }

    .skip-button svg {
        width: 48px;
        height: 48px;
    }

    /* 🎯 Return Button Adjustments */
    .return-button {
        width: 84px;
        height: 84px;
    }

    .return-button svg {
        width: 100%;
        height: 100%;
    }

    /* 🎯 God Return Button Adjustments */
    #god-return-button {
        top: 20px;
        left: 20px;
    }

    /* 🎯 Close "X" Button */
    #store-close-button {
        padding: 1vh 2vw;
    }

    .close-button {
        font-size: 38px;
    }

    #betsButton {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mini-spin-button {
        font-size: clamp(0.6rem, 1.2vh, 0.9rem);
        padding: 0.2vh 0.8vh;
        right: 4px;
        bottom: 4px;
    }

}

@media screen and (orientation: portrait) and (max-width: 768px) {

    html,
    body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    :root {
        --top-nav-height: 20vh;
        --bottom-nav-height: 20vh;
    }

    #main-layout {
        min-height: calc(var(--vh, 1vh) * 100);
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #chart-container {
        height: 40vh;
    }

    #store-buttons {
        gap: 8px;
        padding: 8px;
    }

    .store-button {
        font-size: clamp(1rem, 2vh, 1.4rem);
        padding: 0.9em;
    }

    #store-tabs {
        justify-content: flex-start;
        padding: 8px 12px;
    }

    .store-tab {
        min-width: 100px;
        max-width: 160px;
        font-size: 1rem;
        padding: 8px 16px;
        flex: 0 0 auto;
    }

    /* 🔹 Top Dashboard: 2 clean rows — 100% contained in 20vh */
    .top-dashboard {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: 10vh 10vh;
        height: 20vh;
        padding: 0 1vw;
        box-sizing: border-box;
    }

    #portfolio {
        grid-column: 1;
        grid-row: 1;
        padding: 1vh;
        box-sizing: border-box;
    }

    .top-spacer {
        grid-column: 2;
        grid-row: 1 / span 2;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 0 1vw;
    }

    #godCandles {
        grid-column: 3;
        grid-row: 1;
        padding: 1vh;
        box-sizing: border-box;
    }

    #store {
        grid-column: 1;
        grid-row: 2;
        padding: 1vh;
        box-sizing: border-box;
    }

    #volatility {
        grid-column: 3;
        grid-row: 2;
        padding: 1vh;
        box-sizing: border-box;
    }

    .volatility-container {
        height: 100%;
        width: 100%;
    }

    /* 🔹 Video background (under chart container only) */
    #video-background-container {
        top: 20vh;
        height: 60vh;
    }

    #god-chart {
        top: 2.5%;
        height: 95%;
        /* slightly taller for portrait space */
        padding: 0 5vw;
    }

    .god-candle {
        transform: scale(0.9);
        /* reduce global candle scale */
    }

    .tooltip {
        font-size: 1rem;
        max-width: 200px;
    }

    .treasure-timer-final {
        font-size: 8vh;
        /* shrink from 12vh */
        height: auto;
        padding-bottom: 4vh;
        /* add spacing from store tabs */
    }

    .treasure-timer-value {
        font-size: 8vh;
        /* match parent */
    }

    /* 🎯 Skip Button Adjustments */
    #skip-button {
        bottom: 12px;
        right: 12px;
    }

    .skip-button {
        width: 52px;
        height: 52px;
    }

    .skip-button svg {
        width: 42px;
        height: 42px;
    }

    /* 🎯 Return Button Adjustments */
    .return-button {
        width: 72px;
        height: 72px;
    }

    .return-button svg {
        width: 100%;
        height: 100%;
    }

    /* 🎯 God Return Button Adjustments */
    #god-return-button {
        top: 16px;
        left: 16px;
    }

    /* 🎯 Close "X" Button */
    #store-close-button {
        padding: 1.2vh 2vw;
    }

    .close-button {
        font-size: 34px;
    }

    #betsButton {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mini-spin-button {
        font-size: clamp(0.6rem, 1.2vh, 0.9rem);
        padding: 0.2vh 0.8vh;
        right: 4px;
        bottom: 4px;
    }

}
