:root {
    --bg0: #070A12;
    --bg1: #0B1020;

    --panel: rgba(14, 22, 48, .72);
    --panel2: rgba(9, 14, 34, .55);
    --stroke: rgba(42, 58, 100, .75);

    --text: #EAF0FF;
    --muted: #AAB6DA;
    --good: #35D07F;
    --bad: #FF4D6D;
    --gold: #FFC857;

    --shadow: 0 12px 30px rgba(0, 0, 0, .45);
    --radius: 18px;
    --radius2: 14px;

    --pad: clamp(10px, 2.4vw, 16px);
    --gap: clamp(8px, 2vw, 12px);

    /* give more room on small phones */
    --hGame: clamp(250px, 46vh, 540px);
    --btnH: clamp(46px, 7vh, 66px);
    --chipH: clamp(32px, 5.6vh, 42px);

    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
    box-sizing: border-box;
}

html,

body {
    height: 100%;
    width: 100%;
    max-width: 800px;
    justify-self: center;
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background-image: url("logo.svg");
    background-color: #030e1d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app {
    min-height: 100%;
    display: flex;
    background: linear-gradient(180deg, var(--bg0), var(--bg1));
    flex-direction: column;
   }

/* Top controls */
.topbar {
    display: flex;
    flex-direction: row;
    align-items:center;
    justify-content: space-between;
    background-image: url('../app/menu_back.png');
    }

    .gamelogo {
    display: flex;
    position: relative;
    height: 45px;
    left: 5px;
    }

    .balance {
    display: flex;
    gap: 8px;
    }

    .balancecounter {
    display: flex;
    padding: 5px 5px;
    font-size: clamp(20px, 2.2vw, 14px);
    font-family: Arial, Helvetica, sans-serif;
    position: relative;
    right: 10px;
    }

    .coin {
      display: flex;
      width: 35px;
      height: 35px;
      position: relative;
      right: 15px;
    }

    .gamemenu {
      display: flex;
      width: 24px;
      height: 24px;
      position: relative;
      right: 10px;
      top: 3px;
    }

/* Coefficient row */    
.coefficient {
      height: 56px; ;
      padding: 16px 8px 8px;
      background-image: url('../app/coeff_back.png');
      border-bottom: 2px solid #d89b3b;
    }

    .coef-row {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 6px;
    }

    .coef-pill {
      min-height: 28px;
      border-radius: 10px;
      border: 1px solid #c68b36;
      display: grid;
      place-items: center;
      font-size: 14px;
      font-family: Arial, Helvetica, sans-serif;
      color: #fff1cf;
      background: linear-gradient(180deg, #4a220c 0%, #794017 50%, #45200b 100%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    }

/* Game canvas */
.main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    }

    .gameArea {
    height: var(--hGame);
    min-height: 230px;
    max-height: 410px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 500px at 70% 10%, rgba(110, 170, 255, .22), transparent 58%),
        radial-gradient(700px 450px at 20% 30%, rgba(255, 200, 87, .10), transparent 60%),
        linear-gradient(180deg, rgba(10, 16, 40, .92), rgba(6, 9, 20, .92));
        z-index: 0;
       }

    .pillars {
        width: 100%;
        position: absolute;
        display: flex;
        justify-content: space-between;
        margin-top: -42px;
        z-index: 5;
       
    }


    .altitude {
        position: absolute;
        left: 12px;
        top: 12px;
        z-index: 5;
        user-select: none;
        }

        .badge {
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(9, 14, 34, .62);
        border: 1px solid rgba(42, 58, 100, .85);
        backdrop-filter: blur(8px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, .22);
        min-width: 124px;
        }

        .badgeLabel {
        font-size: 12px;
        color: var(--muted);
        letter-spacing: .2px;
        }

        .badgeValue {
        margin-top: 2px;
        font-size: 20px;
        font-weight: 950;
        display: flex;
        align-items: baseline;
        gap: 6px;
        }

         .badgeValue span {
        color: var(--muted);
        font-weight: 700;
        font-size: 12px;
        }

    .multWrap {
        position: absolute;
        left: 50%;
        top: 20px;
        transform: translateX(-50%);
        z-index: 5;
        text-align: center;
        user-select: none;
        pointer-events: none;
        width: min(92%, 520px);
        }

        .mult {
        font-size: clamp(44px, 6vw, 64px);
        font-weight: 980;
        letter-spacing: .3px;
        text-shadow: 2px 2px rgba(0, 0, 0, .45);
        -webkit-text-fill-color: var(--gold);
        -webkit-text-stroke: 2px rgb(110, 37, 0);
        -webkit-font-smoothing: antialiased;
        line-height: 1.05;
        }

        .mult small {
        font-size: .55em;
        font-weight: 950;
        color: var(--gold);
        }

        .roundState {
        margin-top: 4px;
        font-size: 12px;
        color: var(--muted);
        letter-spacing: .25px;
        }

@keyframes floaty {

    0%,
    100% {
        transform: translateY(0);
        opacity: .95;
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Countdown progress bar */
    .countdown {
      position: absolute;
      display: flex;
      flex-direction: column;
      align-items: center;
      left: 50%;
      bottom: 10px;
      transform: translateX(-50%);
      z-index: 7;
      text-align: center;
      width: min(90%, 400px);
    }

    .countdown[hidden] {
    display: none;
    }

    .countdownText {
      font-size: clamp(14px, 3.5vw, 18px);
      color: var(--text);
      font-weight: 700;
      margin-bottom: 8px;
      text-shadow: 0 4px 12px rgba(0, 0, 0, .5);
      background: rgba(9, 14, 34, .85);
      padding: 8px 16px;
      border-radius: 999px;
      border: 1px solid rgba(42, 58, 100, .85);
      display: inline-block;
    }

    .countdownText strong {
      color: var(--gold);
      font-size: 1.3em;
    }

    .progressBar {
      width: 90%;
      height: clamp(8px, 2vh, 14px);
      border-radius: 999px;
      background: rgba(9, 14, 34, .75);
      border: 1px solid rgba(42, 58, 100, .85);
      overflow: hidden;
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4);
    }

    .progressFill {
      width: 100%;
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, 
        rgba(255, 200, 87, .95) 0%, 
        rgba(255, 141, 64, .95) 50%, 
        rgba(255, 77, 109, .95) 100%);
      transition: width 0.1s linear;
      box-shadow: 0 0 20px rgba(255, 200, 87, .5);
    }



/* Toast (events as floating text) */
.toast {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    width: min(92%, 520px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toastItem {
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(9, 14, 34, .78);
    border: 1px solid rgba(42, 58, 100, .85);
    backdrop-filter: blur(10px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, .35);
    color: var(--text);
    font-weight: 900;
    letter-spacing: .15px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px) scale(.98);
    animation: toastInOut 2.2s ease forwards;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toastItem.bet {
    border-color: rgba(255, 200, 87, .45);
    color: var(--gold);
}

.toastItem.cashout {
    border-color: rgba(53, 208, 127, .45);
    color: var(--good);
}

.toastItem.crash {
    border-color: rgba(255, 77, 109, .45);
    color: var(--bad);
}

@keyframes toastInOut {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    12% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    78% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px) scale(.985);
    }
}

/* Bet controls */
.betGrid {
    justify-items: center;
    background-image: url('../app/bet_back.png');
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 20px;

}

@media (max-width: 760px) {
    .betGrid {
        grid-template-columns: 1fr;
    }
}

.betCard {
    width: 352px;
    height:142px ;
    background-image: url('../app/bet_plask.png');
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    
}

.autobetoption {
    display: flex;
    justify-content: space-around;
    min-width: 0;
}

.toggle_autobet {
    display: flex;
    align-items: center;
    position:relative;
    gap: 5px;
    right: 6px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff1cf;
    user-select: none;
}

.toggle_autowithdraw {
    display: flex;
    align-items: center;
    position:relative;
    gap: 5px;
    padding-right: 10px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff1cf;
    user-select: none;
}


.switch {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    cursor: pointer;
}

.knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #cbd7ff);
    box-shadow: 0 10px 16px rgba(0, 0, 0, .35);
    
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .15s ease, transform .15s ease;
}


.switch.on {
    background: rgba(53, 208, 127, .25);
    border-color: rgba(53, 208, 127, .55);
}

.switch.on .knob {
    opacity: 1;
    transform: scale(1);
}

.auto_coefpill {
      min-height: 28px;
      border-radius: 10px;
      border: 1px solid #c68b36;
      display: grid;
      padding-left: 20px;
      padding-right: 20px;
      place-items: center;
      font-size: 14px;
      font-family: Arial, Helvetica, sans-serif;
      color: #fff1cf;
      background: linear-gradient(180deg, #4a220c 0%, #794017 50%, #45200b 100%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    }

.betrowbottom {
    display: flex;
    justify-content: space-between;
    
}

.betsettings {
    height: 67px;
    width:160px; 
    background-image: url('../app/bet_settings.png');
}

.betinput {
    display: flex;
    align-items: center;
    position: relative;
    padding: 6px;
    gap: 8px;
}

.amount {
    width: 80px;
    text-align: center;
    background: transparent;
    border: none; 
    outline: none;
    font-size: 16px;
    font-weight: 980;
    color: #fff1cf;
    -webkit-text-stroke: 1px rgb(36, 36, 36);
    
}

.stepBtn {
    background: transparent;
    border: none;
    color: #fff1cf;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    -webkit-text-stroke: 1px rgb(36, 36, 36);
}

.chips {
    display: grid;
    gap: 3px;
    padding-left: 5px;
    padding-right: 5px;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip {
    min-width: 0;
    width: 36px;
    height: 25px;
    border-radius: 6px;
    background-image: url('../app/bet_smallbtn.png');
    font-weight: 980;
    font-size: 14px;
    color: white;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
   
}

.chip:active {
    transform: translateY(1px) scale(.99);
}

.chip:hover {
    border-color: rgba(255, 121, 121, 0.8);
}

.betbuttonarea {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.betbutton {
    width: 154px;
    height: 65px;
    background-image: url('../app/bet_bigbtn_golden.png');
    font-weight: 1000;
    font-size: clamp(16px, 3.2vw, 20px);
    border-radius: 15px;
    letter-spacing: .3px;
    cursor: pointer;
    transition: transform .08s ease, filter .12s ease;
    user-select: none;
}

.betbutton:active {
    transform: translateY(1px) scale(.995);
}

.betbutton.cashout {
    background-image: url('../app/bet_bigbtn_green.png');
}

.betamount{
    display: flex;
    position: relative;
}

/* single shared info row under both bet blocks */
.globalInfo {
    height: 58px;
    width: 100%;
    padding: 20px;
    margin-top: -10px;
    background-image: url('../app/bottom_back.png');
    font-size: 12px;
    color: #fff1cf;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    
}

.globalInfo b {
    color: var(--text);
}

.globalInfo .left,
.globalInfo .right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

