/* ══════════════════════════════════════
   CHICKEN ROAD — Exact Clone Styles
   + TENSION SYSTEM VISUALS
   ══════════════════════════════════════ */
*{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#071824;
  --panel:#0e2231;
  --panel2:#142d3e;
  --input:#071824;
  --border:rgba(255,255,255,.06);
  --yellow:#22c55e;
  --green:#22C55E;
  --red:#EF4444;
  --white:#F8FAFC;
  --muted:#94A3B8;
  --font:'Outfit',system-ui,sans-serif;
  --mono:'JetBrains Mono',monospace;
  --r:10px;
}
html,body{height:100%;overflow:hidden}
body{background:var(--bg);color:var(--white);font-family:var(--font);
     user-select:none;-webkit-tap-highlight-color:transparent}
#app{display:flex;flex-direction:column;height:100%}

/* ─── HEADER ─── */
#header{display:flex;justify-content:space-between;align-items:center;
        padding:8px 14px;background:var(--panel);z-index:20;position:relative;height:56px;}
.logo{display:flex;align-items:center;font-weight:900;font-size:18px;font-style:italic;letter-spacing:-.5px}
.l-a{color:var(--white)}.l-num{color:var(--red);margin:0 2px;font-size:20px}.l-b{color:var(--white)}
.hdr-r{display:flex;align-items:center;justify-content:flex-end;gap:10px;height:100%}

/* ─── BALANCE BADGE (to the right) ─── */
.balance-badge {
    display: flex;
    align-items: center;
    background: var(--panel2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 3px 3px 3px 14px;
    height: 38px;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
;animation: balanceFloatSimple 3s ease-in-out infinite;}
.balance-badge:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.6);
    transform: scale(1.04);
}
.wallet-pill-left {
    display: flex;
    align-items: center;
    padding-right: 10px;
}
.balance-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--yellow);
}
.wallet-pill-right {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
}
.wallet-rupee-coin {
    height: 18px;
    width: auto;
}
@keyframes floatingCoin {
    0%,100% {transform: translateY(0);}
    50% {transform: translateY(-2px);}
}

.hdr-icon{display:flex;align-items:center;justify-content:center;background:none;border:none;
          color:var(--white);width:32px;height:32px;cursor:pointer;opacity:.7}

/* ─── LOADING OVERLAY ─── */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: #071824;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
.loading-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #94a3b8;
    text-transform: uppercase;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TICKER ─── */
#ticker{display:flex;align-items:center;background:var(--panel);padding:3px 14px;
        font-size:11px;font-weight:600;gap:8px;border-top:1px solid var(--border)}
.tk-label{color:var(--muted);white-space:nowrap}
.tk-dot{width:7px;height:7px;background:var(--green);border-radius:50%;
        box-shadow:0 0 6px rgba(76,217,100,.5)}
.tk-online{color:var(--muted);white-space:nowrap}
.tk-scroll{flex:1;overflow:hidden;position:relative}
.tk-track{display:flex;gap:16px;white-space:nowrap;animation:scroll 40s linear infinite}
@keyframes scroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
.tk-item{display:inline-flex;align-items:center;gap:6px;font-size:12px}
.tk-flag{font-size:14px}.tk-name{color:var(--muted)}.tk-win{color:var(--green);font-weight:700}

/* ─── VIEWPORT ─── */
#viewport{flex:1;position:relative;overflow:hidden;background:#0e2231;
          transition:box-shadow .5s}
#gc{display:block;width:100%;height:100%;transform:translateZ(0);will-change:transform;touch-action:none}

/* Tension glow */
#viewport.glow-1{box-shadow:inset 0 0 60px rgba(76,217,100,.15)}
#viewport.glow-2{box-shadow:inset 0 0 80px rgba(245,158,11,.2)}
#viewport.glow-3{box-shadow:inset 0 0 100px rgba(239,68,68,.25)}
#viewport.glow-4{box-shadow:inset 0 0 140px rgba(239,68,68,.4)}

/* ─── VERTICAL CONTROLS (IMAGE MATCH) ─── */
.vertical-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
    padding: 16px;
    background: #1c1c28; /* Slightly lighter dark for the box */
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ctrl-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Row 1: Bet Input */
.ctrl-bet {
    background: #232334;
    border-radius: 16px;
    padding: 6px;
    align-items: stretch;
}
.ctrl-btn-small {
    background: rgba(255,255,255,0.05);
    border: none;
    color: #94A3B8;
    font-weight: 800;
    font-size: 11px;
    padding: 0 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}
.ctrl-btn-small:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ctrl-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}
.ctrl-input-label {
    font-size: 10px;
    color: #64748B;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -2px;
}
#bet-input {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    width: 100%;
    outline: none;
    font-family: var(--mono);
}

/* Row 2: Chips */
.ctrl-chips {
    justify-content: space-between;
}
.ctrl-chip {
    flex: 1;
    background: #232334;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    color: #E2E8F0;
    padding: 12px 0;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: 0.2s;
}
.ctrl-chip:hover { transform: translateY(-2px); background: #2e2e42; }
.coin-icon { font-size: 14px; opacity: 0.8; }

/* Row 3: Select */
.ctrl-select-wrap {
    width: 100%;
    position: relative;
    background: #232334;
    border-radius: 14px;
    overflow: hidden;
}
#diff-select {
    width: 100%;
    background: none;
    border: none;
    color: #94A3B8;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    appearance: none;
}
.select-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748B;
    font-size: 12px;
}

/* Row 4: Action */
.btn-play-large {
    flex: 1; /* Split row */
    background: #22C55E;
    color: #000;
    border: none;
    border-radius: 20px;
    font-size: 20px;
    font-weight: 900;
    padding: 14px 10px;
    height: 72px; /* Fixed height for consistency */
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(34,197,94,0.4);
    transition: 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-play-large:active { transform: scale(0.96); }

.btn-cashout-sticky {
    display: none; /* Shown by JS */
    flex: 1; /* Split row */
    background: #22c55e;
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 14px 10px;
    height: 72px; /* Fixed height for consistency */
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(34, 197, 94,0.3);
}
.btn-cashout-sticky .co-label { font-weight: 900; font-size: 11px; margin-top: -2px; }
.btn-cashout-sticky .co-val { font-weight: 900; font-size: 20px; margin-top: -1px; }

/* ─── MOBILE ─── */
@media(max-width:800px){
  #viewport { flex: none; height: 300px; }
  #panel { padding: 10px 12px; background: transparent; position: relative; bottom: 0; }
  .vertical-controls { width: 100%; max-width: none; border-radius: 20px; padding: 12px; gap: 10px; }

  .btn-play-large {
    font-size: 18px;
    height: 64px;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(34,197,94,0.5);
  }

  .btn-cashout-sticky {
    height: 64px;
    border-radius: 16px;
  }

  .ctrl-chip {
    font-size: 12px;
    padding: 10px 0;
  }
}

@media(max-width:400px){
  #viewport { height: 240px; }
  .btn-play-large { font-size: 16px; height: 56px; }
  .btn-cashout-sticky { height: 56px; }
  .ctrl-chip { font-size: 11px; padding: 8px 0; }
  #bet-input { font-size: 16px; }
}

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

/* ─── Cashout Center Popup ─── */
.cashout-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1c2127; /* Dark slate background */
  padding: 24px 48px;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 6px solid #22c55e; /* Thick green border */
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  white-space: nowrap;
}

.cashout-popup .c-multi {
  color: #22c55e; /* Green multiplier */
  font-size: clamp(36px, 9vw, 68px);
  font-weight: 800;
  line-height: 1;
  text-shadow: none;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.cashout-popup .divider {
  width: 70%;
  height: 4px;
  background-color: #313742;
  margin-bottom: 12px;
  border-radius: 2px;
}

.cashout-popup .c-return-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cashout-popup .c-return {
  color: #22c55e; /* Green return amount */
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 800;
  letter-spacing: 0;
}

.coin-blue {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6; /* Blue coin bg */
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  border: 2px solid #60a5fa;
}

@keyframes popIn {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
