:root {
  --bg-main: #1c1c1c;
  --bg-dark: #2c2c2c;
  --bg-med: #404040;
  --bg-light: #525252;
  --text-light: #f5f5f5;
  --text-med: #a3a3a3;
  --text-dark: #737373;
  --primary: #22d3ee;
  --success: #4ade80;
  --warning: #facc15;
  --danger: #f87171;
  /* UPDATED FONT FAMILY TO USE DOWNLOADED ROBOTO */
  --font-family: 'Roboto', sans-serif;
  --border-radius: 6px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --app-height: 100vh;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font-family);
  /* NEW: Professional full-screen background image */
  background: url('assets/bg-animation.gif?v=1.8.0') no-repeat center center fixed;
  background-size: cover;
  background-color: #0a0a12; /* fallback while image loads */
  color: var(--text-light);
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--app-height);
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.container {
  width: 100%;
  max-width: 450px;
  height: 100%;
  max-height: 100%;
  /* Transparent so the bg-animation.gif shows through cleanly */
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  position: relative; 
  opacity: 1;
}

/* --- GIFT BANNER --- */
.gift-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: linear-gradient(90deg, rgba(29, 78, 216, 0.85), rgba(59, 130, 246, 0.85));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    text-align: center;
    padding: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.gift-banner i { color: white; }
.gift-banner span { font-weight: 700; }

/* --- CONNECTING OVERLAY --- */
.connecting-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(12, 12, 20, 0.92); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.connecting-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.connecting-icon { width: auto; height: 75px; max-width: 80vw; object-fit: contain; animation: pulse 1.5s ease-in-out infinite; }
.connecting-content h2 { font-size: 1.5rem; font-weight: 500; color: var(--text-light); }
.connecting-spinner { display: flex; justify-content: center; align-items: center; gap: 4px; }
.connecting-error { margin-top: 16px; color: var(--danger); }
.connecting-error p { font-size: 1rem; margin-bottom: 12px; }
.retry-btn { padding: 8px 16px; background: var(--primary); color: var(--bg-main); border: none; border-radius: var(--border-radius); font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; }
.retry-btn:hover { background: var(--success); }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 1; } }

/* --- HEADER --- */
header { 
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
    padding: 6px 8px; 
    flex-shrink: 0;
    background: rgba(12, 12, 20, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 100;
    height: 50px;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    flex-shrink: 0; 
}

.header-back-btn {
    background: transparent;
    border: none;
    color: var(--text-med);
    font-size: 1rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.header-back-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-light); }

.balance-group {
    display: flex;
    flex-direction: column;
    padding: 2px 8px;
    border-radius: 6px;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.golden-box {
    border: 1px solid rgba(255, 215, 0, 0.7);
    background: linear-gradient(135deg, rgba(44, 44, 44, 0.7), rgba(26, 26, 26, 0.7));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25), inset 0 0 6px rgba(255, 215, 0, 0.12);
    position: relative;
    overflow: visible;
}

.balance-row {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 2px;
}
.balance-row .currency {
    color: #ffd700;
    font-size: 0.8rem;
    margin-right: 2px;
}
.secondary-balance { 
    font-size: 0.6rem; 
    color: var(--text-med); 
    font-weight: 500;
    margin-top: 0px;
}

.header-center { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow: hidden; 
    flex: 1 1 auto;
    min-width: 0;
}
.app-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.title-icon { height: 32px; width: auto; max-width: 100%; object-fit: contain; flex-shrink: 1; }
.app-title h1 { 
    font-size: 0.9rem; 
    font-weight: 800; 
    color: var(--text-light); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center;
    gap: 8px;
    position: relative; 
    flex-shrink: 0;
}
.menu-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.menu-btn:hover { background-color: rgba(255,255,255,0.08); }

/* Style for the new chat button */
.chat-btn {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color 0.2s;
  flex-shrink: 0;
}
.chat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.chat-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

/* --- WALLET DROPDOWN --- */
.wallet-dropdown { 
    position: absolute; 
    top: 100%; 
    right: 0; 
    background: rgba(28, 28, 36, 0.92); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius); 
    box-shadow: 0 8px 32px rgba(0,0,0,0.45); 
    min-width: 180px; 
    z-index: 1000; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px); 
    transition: all 0.2s ease; 
    border: 1px solid rgba(255,255,255,0.1); 
    padding: 4px; 
}
.wallet-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.wallet-dropdown-item { padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-light); cursor: pointer; transition: background-color 0.2s ease; border-bottom: 1px solid rgba(255,255,255,0.06); }
.wallet-dropdown-item:last-child { border-bottom: none; }
.wallet-dropdown-item:hover { background-color: rgba(255,255,255,0.08); }
.wallet-dropdown-item i { color: var(--primary); width: 16px; margin-right: 8px; }
.wallet-dropdown-item span { font-weight: 500; font-size: 0.85rem; }

/* --- HISTORY --- */
.history-container { 
    padding: 0 8px; 
    position: relative; 
    flex-shrink: 0; 
    border-bottom: 1px solid rgba(255,255,255,0.06); 
    height: 36px; 
    display: flex; 
    align-items: center; 
    background: rgba(12, 12, 20, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50; /* raised so expanded history sits above the game display */
}
.history-visible { display: flex; gap: 4px; padding: 0; overflow-x: auto; scrollbar-width: none; width: 100%; align-items: center; height: 100%; }
.history-visible::-webkit-scrollbar { display: none; }
.history-item { padding: 2px 6px; font-size: 11px; font-weight: 600; border-radius: 4px; flex-shrink: 0; cursor: pointer; transition: transform 0.2s ease; border: 1px solid transparent; text-align: center; min-width: 45px; height: 20px; line-height: 18px; }
.history-item.range1 { background-color: #00BFFF; color: white; }
.history-item.range2 { background-color: #800080; color: white; }
.history-item.range3 { background-color: #800000; color: white; }
.history-item.range4 { background-color: #0002FF; color: white; }
.history-item.range5 { background-color: #008000; color: white; }
.history-item.range6 { background-color: #FF7900; color: white; }
.history-item.range7 { background-color: #FF00FF; color: white; }
.history-toggle-btn { 
    position: absolute; 
    right: 0; 
    top: 0; 
    height: 100%; 
    background: rgba(28, 28, 36, 0.7); 
    border: none; 
    border-left: 1px solid rgba(255,255,255,0.08); 
    color: var(--text-med); 
    padding: 0 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    z-index: 5; 
}
.history-toggle-btn:hover { background: rgba(60, 60, 70, 0.8); color: var(--text-light); }
.history-toggle-btn.expanded i { transform: rotate(180deg); }
.history-full { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background: rgba(20, 20, 28, 0.95); 
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 0 0 8px 8px; 
    max-height: 0; 
    overflow: hidden; 
    z-index: 60; /* appears on top of the plane display */
    transition: max-height 0.3s ease; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
    border: 1px solid rgba(255,255,255,0.08);
    border-top: none;
}
.history-full.expanded { max-height: 180px; overflow-y: auto; }
.history-full-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); gap: 4px; padding: 8px; }

/* --- GAME AREA --- */
.game-area { 
    flex-grow: 1;
    flex-shrink: 1; 
    min-height: 180px; 
    position: relative; 
    display: flex; 
    padding: 8px; 
    overflow: hidden; 
}

/* UPDATE #1: NEW RAIN TOP BANNER */
.rain-top-banner {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    width: 90%;
    max-width: 320px;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
.rtb-content {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(34, 211, 238, 0.9));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    border: 1px solid rgba(255,255,255,0.25);
}
.rtb-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.rtb-btn {
    background: white;
    color: #0ea5e9;
    border: none;
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* UPDATE #2 & #3: RAIN ICON SIZE AND ANIMATION */
.rain-promo-tiny {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.2);
    overflow: hidden;
    animation: rain-blink 1.5s infinite;
}

.rain-icon-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

@keyframes rain-blink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

.rain-promo-tiny.active {
    background-color: rgba(34, 211, 238, 0.25);
    border-color: var(--primary);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.65);
    animation: none; 
    transform: scale(1.05);
}

.rain-glow {
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--warning);
    border-left-color: var(--warning);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.rain-promo-tiny.active .rain-glow {
    opacity: 1;
    animation: spin-glow 2s linear infinite;
}

@keyframes spin-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.graph-container { 
    width: 100%; 
    height: 100%; 
    /* removed dark radial gradient so the GIF shows at full brightness */
    background-image: none;
    background-color: transparent;
    border-radius: var(--border-radius); 
    position: relative; 
    overflow: hidden; 
}

/* NEW ANIMATED BACKGROUND STYLES */
.game-bg-anim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.game-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0); /* completely removed darkness – 100% real image */
    z-index: 1;
    pointer-events: none;
}

@keyframes planeWobble { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-5px) rotate(-1deg); } 50% { transform: translateY(0) rotate(0); } 75% { transform: translateY(5px) rotate(1deg); } }

.plane { position: absolute; width: 33%; height: auto; transform-origin: center; transition: all 0.05s linear; filter: drop-shadow(0 0 8px #f87171aa); z-index: 3; animation: planeWobble 0.5s ease-in-out infinite; }
.plane-trail-svg { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
#planeTrailPath { stroke-width: 4px; stroke-linecap: round; fill: none; stroke: url(#trail-gradient); filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.7)); }
.multiplier-display { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: clamp(1.5rem, 6vw, 3rem); font-weight: 700; color: white; transition: color 0.3s ease; text-shadow: 0 0 18px rgba(0, 0, 0, 0.7); z-index: 4; }
.multiplier-display.crashed { color: var(--danger); }
.multiplier-display.betting { opacity: 0; }

.game-status-overlay { 
    position: absolute; 
    inset: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: radial-gradient(circle, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
    z-index: 5; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease; 
}
.game-status-overlay.visible { opacity: 1; pointer-events: all; }
.status-message { font-size: 1rem; font-weight: 500; color: var(--warning); margin-top: 12px; text-shadow: 0 2px 6px rgba(0,0,0,0.85); }

/* --- NEW SIMULATION BAR STYLES --- */
.simulation-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 15px;
    z-index: 4;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sim-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-med);
}

.sim-item i {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.sim-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sim-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
    font-family: monospace;
}

.sim-value.money {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.sim-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
}

.countdown-timer { position: relative; width: 70px; height: 70px; display: none; }
.countdown-svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)); }
.countdown-track { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 8; }
.countdown-progress { fill: none; stroke: var(--warning); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; filter: drop-shadow(0 0 5px var(--warning)); }
.countdown-text { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: var(--text-light); 
    font-size: 1.4rem; 
    font-weight: 700; 
    font-family: monospace;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.spinner-ring { width: 8px; height: 8px; border: 2px solid transparent; border-top: 2px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.spinner-ring:nth-child(2) { animation-delay: 0.1s; }
.spinner-ring:nth-child(3) { animation-delay: 0.2s; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- FLOATING MONEY ANIMATION --- */
.floating-text {
    position: fixed;
    font-weight: 800;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 9999;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.floating-text.win { color: #4ade80; }
.floating-text.loss { color: #f87171; }


/* =========================================================
   BETTING CONTROLS – TRANSPARENT / GLASS STYLE (main update)
   ========================================================= */
.bet-controls-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    padding: 6px; 
    background: transparent;          /* fully transparent */
    flex-shrink: 0; 
    min-height: 0;
    overflow-y: visible;
    margin-bottom: 2px;
}

.tabs-nav {
  display: flex;
  background: rgba(20, 20, 28, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--border-radius);
  padding: 2px;
  margin-bottom: 4px;
  gap: 2px;
  min-height: 32px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-med);
  padding: 0;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.tab-btn.active {
  background: rgba(80, 80, 95, 0.7);
  color: var(--text-light);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.tab-btn:hover:not(.active) { color: var(--text-light); }

.btn-effect {
    transition: transform 0.05s ease, filter 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-effect:active:not(:disabled) {
    transform: scale(0.96);
    filter: brightness(1.1);
}

.bet-panel { 
    display: flex; 
    flex-direction: column; 
    gap: 8px;
    height: auto;
}

/* Main glass betting cards */
.bet-control { 
    background: rgba(22, 22, 30, 0.62);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 10px; 
    padding: 8px 10px;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    gap: 4px; 
    transition: all 0.3s ease; 
    flex-grow: 0;
    height: auto; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
}

.bet-control.auto-bet-active { 
    border: 1px solid rgba(34, 211, 238, 0.6); 
    background: linear-gradient(135deg, rgba(22, 22, 30, 0.7), rgba(34, 211, 238, 0.12)); 
}
.bet-control.auto-bet-ready { 
    border-color: rgba(74, 222, 128, 0.6); 
    background: linear-gradient(135deg, rgba(22, 22, 30, 0.7), rgba(74, 222, 128, 0.12)); 
}

.bet-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.bet-main { display: flex; flex-direction: column; gap: 4px; }

.min-max-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
    padding: 0 2px;
    line-height: 1.2;
}

.amount-control { 
    display: flex; 
    align-items: center; 
    background: rgba(0, 0, 0, 0.45); 
    border-radius: 6px; 
    height: 36px; 
    border: 1px solid rgba(255,255,255,0.12); 
}

.bet-amount-input { 
    flex-grow: 1; 
    background: none; 
    border: none; 
    outline: none; 
    color: var(--text-light); 
    font-size: 16px; 
    font-weight: 700; 
    text-align: center; 
    width: 40px; 
    padding: 0; 
    -moz-appearance: textfield; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
}
.bet-amount-input[readonly], .auto-cashout-input[readonly] { cursor: pointer; }
.bet-amount-input[readonly]:hover, .auto-cashout-input[readonly]:hover { background-color: rgba(255,255,255,0.06); }
.bet-amount-input::-webkit-outer-spin-button, .bet-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-mod { 
    background: rgba(70, 70, 85, 0.7); 
    color: var(--text-light); 
    border: none; 
    font-size: 1.2rem; 
    width: 36px; 
    height: 100%; 
    cursor: pointer; 
    transition: background-color 0.2s; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.amount-mod:hover { background-color: rgba(100, 100, 120, 0.8); }
.amount-mod.minus { border-radius: 5px 0 0 5px; }
.amount-mod.plus { border-radius: 0 5px 5px 0; }

.quick-bets { display: flex; justify-content: space-between; gap: 4px; }
.quick-bet-btn { 
    flex-grow: 1; 
    background: rgba(0, 0, 0, 0.4); 
    color: rgba(255,255,255,0.7); 
    border: 1px solid rgba(255,255,255,0.12); 
    border-radius: 5px; 
    padding: 0; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 0.75rem; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
    height: 26px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 500; 
}
.quick-bet-btn:hover { 
    background: rgba(60, 60, 75, 0.7); 
    color: var(--text-light); 
    border-color: rgba(255,255,255,0.25); 
}

.action-btn { 
    padding: 0 12px; 
    border: none; 
    border-radius: 8px;
    font-size: 1.1rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    height: auto; 
    min-height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    min-width: 90px; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* UPDATED: richer, brighter, glowing real green */
.place-bet-btn { 
    background-color: #00BF00; 
    color: white; 
    box-shadow: 
        0 3px 0 #008000,
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.place-bet-btn:active:not(:disabled) { 
    box-shadow: 0 1px 0 #008000; 
    transform: translateY(2px); 
}

.cashout-btn { background-color: var(--warning); color: var(--bg-main); box-shadow: 0 3px 0 #b45309; }
.cashout-btn:active:not(:disabled) { box-shadow: 0 1px 0 #b45309; transform: translateY(2px); }

.cancel-btn { background-color: var(--danger); color: white; }
.waiting-btn { background-color: #f59e0b; color: #1c1c1c; opacity: 0.9; }

.action-btn.place-bet-btn.using-voucher {
  background: linear-gradient(135deg, #ec4899, #db2777);
  border: 1px solid #f472b6;
  box-shadow: 0 3px 0 #9d174d;
}
.action-btn.place-bet-btn.using-voucher:active:not(:disabled) { box-shadow: 0 1px 0 #9d174d; transform: translateY(2px); }

.action-btn span { font-size: 0.75rem; font-weight: 500; margin-top: 2px; letter-spacing: 0; text-transform: none; }
.action-btn.place-bet-btn.using-voucher span {
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 400;
}

.auto-panel { display: flex; justify-content: space-between; gap: 8px; padding: 0 2px; margin: 0; align-items: center; min-height: 22px; }
.auto-option { display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,0.7); font-size: 0.75rem; font-weight: 500; }
.auto-cashout-input { 
    background: rgba(0,0,0,0.4); 
    border: 1px solid rgba(255,255,255,0.15); 
    border-radius: 4px; 
    color: var(--text-light); 
    padding: 2px 4px; 
    width: 48px; 
    text-align: center; 
    font-size: 13px; 
    -moz-appearance: textfield; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
    height: 22px; 
    font-weight: 600; 
}
.auto-cashout-input::-webkit-outer-spin-button, .auto-cashout-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auto-cashout-input:disabled { background-color: transparent; border-color: transparent; opacity: 0.5; }


.switch { position: relative; display: inline-block; width: 34px; height: 18px; flex-shrink: 0; }
.switch input { display: none; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: rgba(80,80,95,0.7); border-radius: 16px; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: #1c1c1c; border-radius: 50%; transition: .4s; }
input:checked + .slider { background-color: var(--success); }
input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
input:checked + .slider:before { transform: translateX(16px); }

.quick-bet-btn.gift-btn {
    border-color: #f472b6;
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}
.quick-bet-btn.gift-btn:hover {
    background: #f472b6;
    color: #fff;
}


/* --- O/U CONTROLS (glass) --- */
.ou-container {
  background: rgba(18, 18, 26, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 0;
  height: auto;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.ou-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ou-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}
.ou-control-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 6px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.12);
}
.ou-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(50, 50, 65, 0.7);
  color: var(--text-light);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ou-circle-btn:active { transform: scale(0.95); background-color: rgba(80,80,95,0.8); }
.ou-input-wrapper {
  flex-grow: 1;
  text-align: center;
  position: relative;
}
#ouBetAmount, #ouCoefInput {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  width: 100%;
  text-align: center;
  outline: none;
  padding: 0;
}
.ou-x-marker {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 700;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}
.ou-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-items: flex-start; 
}
.ou-action-btn {
  flex: 1;
  border: none;
  border-radius: 8px; 
  height: 50px;
  max-height: 50px; 
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
}
.ou-action-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.25); }

.ou-action-btn.over {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #1a1a1a;
}
.ou-action-btn.under {
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  color: white;
}
.ou-action-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ou-act-title {
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.5px;
}
.ou-act-odds {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}
.ou-quick {
    background: rgba(50, 50, 65, 0.6);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.75);
    border-radius: 12px;
    padding: 4px 0;
    font-size: 0.75rem;
    font-weight: 600;
}
.ou-quick:hover { background: rgba(70, 70, 85, 0.8); color: white; }

.ou-action-btn.waiting {
  background-color: rgba(80, 80, 95, 0.85) !important;
  color: var(--warning) !important;
  border: 1px solid var(--warning);
  animation: pulse-border 1.5s infinite;
}

.ou-action-btn.won {
  background-color: var(--success) !important;
  color: white !important;
  border: 1px solid var(--success);
  transform: scale(1.02);
}

.ou-action-btn.lost {
  background-color: var(--danger) !important;
  color: white !important;
  border: 1px solid var(--danger);
  opacity: 0.8;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* --- NOTIFICATION --- */
#notification { 
  position: fixed; 
  top: 15%; 
  left: 50%; 
  transform: translate(-50%, 0) scale(0.9); 
  padding: 8px 16px; 
  border-radius: 30px; 
  font-weight: 600; 
  font-size: 0.85rem; 
  z-index: 11000; 
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  opacity: 0; 
  visibility: hidden;
  max-width: 90%; 
  text-align: center; 
  box-shadow: 0 8px 16px rgba(0,0,0,0.3); 
  cursor: pointer; 
  pointer-events: none;
  white-space: nowrap;
}

#notification.show { 
  opacity: 1; 
  visibility: visible;
  transform: translate(-50%, 0) scale(1); 
  pointer-events: auto;
}

.notification.success { background-color: var(--success); color: #000; }
.notification.error { background-color: var(--danger); color: white; }
.notification.warning { background-color: var(--warning); color: #000; }

/* --- MODALS (kept solid for readability) --- */
.my-bets-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.my-bets-modal.show { opacity: 1; visibility: visible; }
.my-bets-modal-content { background: #12121a; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; box-shadow: none; border: none; display: flex; flex-direction: column; }
.my-bets-modal-header { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.my-bets-modal-header h2 { font-size: 1rem; color: var(--text-light); font-weight: 500; }
.my-bets-modal-close { background: none; border: none; color: var(--text-med); font-size: 1.2rem; cursor: pointer; transition: color 0.2s ease; }
.my-bets-modal-close:hover { color: var(--text-light); }
.my-bets-modal-body { padding: 8px; overflow-y: auto; flex-grow: 1; scrollbar-width: thin; display: flex; flex-direction: column; gap: 6px; }
.my-bets-modal-body::-webkit-scrollbar { width: 4px; }
.my-bets-modal-body::-webkit-scrollbar-track { background: #1a1a24; }
.my-bets-modal-body::-webkit-scrollbar-thumb { background: #404050; border-radius: 3px; }
.my-bets-modal-body::-webkit-scrollbar-thumb:hover { background: #525265; }
.my-bet-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; padding: 6px 8px; background-color: rgba(30,30,40,0.8); border-radius: 4px; border-left: 3px solid var(--text-dark); }
.my-bet-item.win { border-left-color: var(--success); }
.my-bet-item.loss { border-left-color: var(--danger); }
.bet-details, .bet-result { display: flex; flex-direction: column; }
.bet-details { align-items: flex-start; }
.bet-result { align-items: flex-end; }
.timestamp { font-size: 0.65rem; color: var(--text-med); margin-bottom: 2px; }
.amount { font-weight: 600; }
.mult { font-size: 0.75rem; color: var(--text-med); margin-bottom: 2px; }
.my-bet-item span { text-align: right; }
.my-bet-item .profit { font-weight: 700; }
.my-bet-item .profit.win { color: var(--success); }
.my-bet-item .profit.loss { color: var(--danger); }
.bonus-badge { font-size: 0.65rem; background: var(--primary); color: var(--bg-main); padding: 1px 3px; border-radius: 3px; margin-left: 4px; }

.bonus-info-bar { background-color: rgba(34, 211, 238, 0.12); color: var(--primary); text-align: center; padding: 4px; font-size: 0.8rem; font-weight: 500; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }
.bonus-prompt-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); z-index: 2500; display: flex !important; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.bonus-prompt-modal.show { opacity: 1; visibility: visible; }
.bonus-prompt-content { background: rgba(28, 28, 36, 0.95); backdrop-filter: blur(12px); padding: 16px; border-radius: var(--border-radius); text-align: center; width: 90%; max-width: 300px; box-shadow: var(--shadow); position: relative; border: 1px solid rgba(255,255,255,0.1); }
.bonus-prompt-content h3 { color: var(--text-light); margin-bottom: 6px; font-size: 1rem; }
.bonus-prompt-content p { color: var(--text-med); margin-bottom: 14px; font-size: 0.85rem; }
.bonus-prompt-buttons { display: flex; gap: 8px; }
.bonus-choice-btn { flex: 1; padding: 8px; border: none; border-radius: var(--border-radius); font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.bonus-choice-btn.bonus { background-color: var(--primary); color: var(--bg-main); }
.bonus-choice-btn.bonus:hover { opacity: 0.9; }
.bonus-choice-btn.real { background-color: rgba(80,80,95,0.8); color: var(--text-light); }
.bonus-choice-btn.real:hover { background-color: rgba(100,100,115,0.9); }
.cancel-choice-btn { position: absolute; top: 6px; right: 6px; background: none; border: none; color: var(--text-med); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.cancel-choice-btn:hover { color: var(--text-light); }

.exit-modal { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.7); 
    z-index: 3500; 
    display: flex; 
    justify-content: center; 
    align-items: flex-end; /* Sticks it firmly to the bottom */
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0.3s ease; 
}
.exit-modal.show { opacity: 1; visibility: visible; }
.exit-modal-content { 
    background: #ffffff; 
    width: 100%; 
    max-width: 450px; 
    text-align: left; 
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}
.exit-modal.show .exit-modal-content { transform: translateY(0); }
.exit-modal-header {
    padding: 12px 16px;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
}

/* FIX: Changed to Grid. This forces exactly 4 small equal columns */
.exit-games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 16px 16px 16px;
    width: 100%;
}

.exit-game-box {
    width: 100%;
    aspect-ratio: 1; /* Keeps the tiny boxes perfectly square */
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    background: #e5e5e5;
}

/* FIX: strictly confines the image to the tiny box */
.exit-game-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.exit-modal-actions { display: flex; width: 100%; height: 50px; }
.exit-action-btn { 
    border: none; 
    font-weight: 600; 
    font-size: 1rem; 
    cursor: pointer; 
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0;
}
.exit-action-btn.leave { background: #3f3f3f; color: white; flex: 0.35; }
.exit-action-btn.stay { background: #16a34a; color: white; flex: 0.65; }

.rain-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); z-index: 2500; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(6px); }
.rain-modal.show { opacity: 1; visibility: visible; }
.rain-modal-content { background: rgba(28, 28, 36, 0.95); backdrop-filter: blur(14px); border-radius: var(--border-radius); width: 95%; max-width: 320px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,0.1); overflow: hidden; }
.rain-modal-header { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; background: rgba(34, 211, 238, 0.12); }
.rain-modal-header h2 { font-size: 1rem; color: var(--text-light); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.rain-modal-close { background: none; border: none; color: var(--text-med); font-size: 1.2rem; cursor: pointer; transition: color 0.2s ease; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rain-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-light); }
.rain-modal-body { padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.rain-timer { font-size: 1rem; font-weight: 700; color: var(--primary); font-family: monospace; background: rgba(34, 211, 238, 0.12); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--primary); }
.rain-gifts-info { justify-content: space-between; align-items: center; background: rgba(20,20,28,0.6); padding: 8px 12px; border-radius: var(--border-radius); border: 1px solid rgba(255,255,255,0.08); display: none; }
.gifts-left { font-size: 0.9rem; font-weight: 600; color: var(--text-light); }
.gift-amount { font-size: 0.85rem; color: var(--success); font-weight: 500; }
.rain-claim-circle-btn { background: linear-gradient(135deg, var(--success), #22c55e); color: white; border: none; border-radius: 50%; width: 100px; height: 100px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease; margin: 0 auto; display: flex; justify-content: center; align-items: center; text-align: center; box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3); position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rain-claim-circle-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 12px 35px rgba(34, 197, 94, 0.4); }
.rain-claim-circle-btn:active:not(:disabled) { transform: scale(0.95); }
.rain-claim-circle-btn:disabled { background: rgba(80,80,95,0.7); color: var(--text-med); cursor: not-allowed; transform: none; box-shadow: none; }
.rain-claim-circle-btn.pulse { animation: pulse 2s infinite; }
.claim-text { display: flex; flex-direction: column; gap: 2px; }
.rain-eligibility-message, .rain-claimed-message, .rain-empty-message { align-items: center; justify-content: center; gap: 4px; padding: 8px; border-radius: var(--border-radius); font-size: 0.8rem; font-weight: 500; display: none; }
.rain-eligibility-message { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid var(--danger); }
.rain-claimed-message { background: rgba(34, 197, 94, 0.12); color: var(--success); border: 1px solid var(--success); }
.rain-empty-message { background: rgba(163, 163, 163, 0.12); color: #a3a3a3; border: 1px solid #a3a3a3; }

/* --- VOUCHER --- */
.voucher-modal { position: fixed; bottom: 0; left: 0; width: 100%; height: auto; z-index: 2800; opacity: 0; visibility: hidden; transition: all 0.3s ease; display: flex; align-items: flex-end; justify-content: center; }
.voucher-modal.show { opacity: 1; visibility: visible; }
.voucher-modal-content { 
    background: rgba(24, 24, 32, 0.96); 
    backdrop-filter: blur(16px);
    width: 100%; 
    max-width: 450px; 
    border-radius: 12px 12px 0 0; 
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    max-height: 85vh; 
    border: 1px solid rgba(255,255,255,0.1);
}
.voucher-modal-header { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; background: rgba(30,30,40,0.8); }
.voucher-modal-header h2 { font-size: 0.95rem; color: #fff; font-weight: 600; }
.voucher-modal-close { background: none; border: none; color: #aaa; font-size: 1.2rem; cursor: pointer; }
.voucher-list-container { 
    padding: 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
    overflow-y: auto; 
    max-height: 60vh; 
    -webkit-overflow-scrolling: touch;
    transition: padding-bottom 0.3s ease;
}
.voucher-list-container.keyboard-active { padding-bottom: 150px !important; }
.voucher-card {
    background-color: rgba(40,40,52,0.85);
    border-radius: 8px;
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    flex-shrink: 0; 
    width: 100%;
    min-height: auto;
    margin-bottom: 4px;
}
.v-card-top { background: linear-gradient(90deg, #14b8a6, #0d9488); padding: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.v-header-text { font-size: 1.2rem; font-weight: 800; color: white; letter-spacing: 0.5px; }
.v-card-middle { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.v-title { color: #22d3ee; font-weight: 700; font-size: 0.9rem; }
.v-expiry { color: #a3a3a3; font-size: 0.8rem; font-weight: 500; }
.v-note { font-size: 0.7rem; color: #737373; margin-top: 2px; }
.v-card-bottom { padding: 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.08); background-color: rgba(30,30,40,0.7); flex-shrink: 0; }
.v-use-btn { background: #6366f1; color: white; border: none; border-radius: 4px; padding: 6px 20px; font-weight: 700; font-size: 0.85rem; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.v-use-btn:active { transform: scale(0.95); }
.v-partial-section { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.v-partial-label { font-size: 0.75rem; color: rgba(255,255,255,0.8); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.v-partial-circle { width: 12px; height: 12px; border-radius: 50%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.5); }
.v-partial-label.active .v-partial-circle { background: #4ade80; border-color: #4ade80; }
.v-partial-input { background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.25); border-radius: 4px; color: white; padding: 4px 8px; width: 100px; text-align: right; font-weight: 600; display: none; outline: none; font-size: 0.9rem; }
.v-partial-input.show { display: block; }
.v-partial-input::placeholder { color: rgba(255,255,255,0.5); }
.voucher-ui-container { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.v-ui-labels { display: flex; justify-content: space-between; font-size: 0.6rem; color: #a3a3a3; padding: 0 2px; }
.v-ui-input-box { display: flex; align-items: center; justify-content: space-between; background-color: rgba(0,0,0,0.5); border: 2px solid #ec4899; border-radius: 4px; padding: 0 8px; height: 36px; position: relative; }
.v-ui-icon { color: #ec4899; font-size: 0.9rem; }
.v-ui-amount { color: white; font-size: 1rem; font-weight: 700; }
.v-ui-close-btn { background: #333; color: #aaa; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.v-ui-close-btn:hover { background: #444; color: white; }


/* =========================================================
   NEW TINY KEYBOARD STYLES
   ========================================================= */
.tiny-keyboard { 
    position: fixed; 
    bottom: 0; 
    left: 50%; 
    transform: translate(-50%, 100%); 
    width: 100%; 
    max-width: 450px; 
    background: rgba(12, 12, 18, 0.96); 
    backdrop-filter: blur(16px);
    z-index: 9999; 
    display: flex; 
    flex-direction: column;
    padding: 6px; 
    gap: 6px; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    transition: transform 0.25s cubic-bezier(0.19, 1, 0.22, 1); 
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5); 
}
.tiny-keyboard.visible { transform: translate(-50%, 0); }

.tk-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.tk-btn {
    flex: 1;
    background: rgba(50, 50, 65, 0.85);
    color: white;
    border: none;
    border-radius: 4px;
    height: 38px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 0 rgba(0,0,0,0.4);
    -webkit-tap-highlight-color: transparent;
}

.tk-btn:active {
    transform: translateY(2px);
    box-shadow: none;
    background: rgba(70, 70, 85, 0.9);
}

.tk-btn.action {
    background: #b91c1c;
    color: white;
    flex-grow: 0.8; 
}

.tk-btn.done {
    background: #15803d;
    color: white;
    flex-grow: 0.8;
}

.tk-btn.clear {
    background: #c2410c;
    color: white;
}

/* Adjustments for Tiny Screens */
@media (max-height: 500px) {
  .app-title h1 { display: none; }
  .header-left { min-width: 0; padding: 0; }
  .balance-group { padding: 2px; }
  .balance-row { font-size: 0.75rem; }
  .secondary-balance { display: none !important; }
  .header-center { padding: 0; }
  header { height: 32px; padding: 0 4px; }
  .title-icon { height: 24px; width: auto; max-width: 140px; object-fit: contain; }
  .menu-btn { width: 24px; height: 24px; font-size: 0.9rem; }
  
  /* Add these two lines for the chat button responsive adjustment */
  .chat-btn { width: 24px; height: 24px; }
  .chat-icon { width: 18px; height: 18px; }
  
  .history-container { height: 24px; padding: 0 4px; }
  .history-item { height: 16px; line-height: 14px; font-size: 9px; min-width: 35px; padding: 0 2px; }
  .history-toggle-btn { padding: 0 4px; font-size: 0.7rem; }
  .game-area { max-height: none; min-height: 30%; flex-grow: 1; padding: 4px; }
  .multiplier-display { font-size: 2rem; }
  .rain-promo-tiny { width: 36px; height: 36px; top: 4px; left: 4px; }
  .rain-icon-img { width: 22px; height: 22px; }
  .status-message { font-size: 0.8rem; margin-top: 4px; }
  .countdown-timer { width: 50px; height: 50px; }
  .countdown-text { font-size: 1rem; }
  .bet-controls-wrapper { padding: 2px; gap: 2px; flex-shrink: 1; overflow-y: auto; min-height: 0; }
  .tabs-nav { min-height: 20px; margin-bottom: 2px; padding: 1px; }
  .tab-btn { font-size: 0.65rem; padding: 2px; }
  .bet-control { padding: 2px; gap: 2px; flex-shrink: 0; min-height: auto; overflow: visible; }
  .bet-amount-input { font-size: 12px; width: 30px; padding: 0; }
  .amount-mod { width: 20px; height: 20px; font-size: 0.8rem; }
  .quick-bet-btn { font-size: 0.55rem; min-height: 16px; padding: 1px; }
  .action-btn { min-width: 50px; font-size: 0.8rem; padding: 2px; }
  .action-btn span { font-size: 0.6rem; }
  .auto-panel { display: flex !important; opacity: 1 !important; min-height: 20px; align-items: center; margin: 0; justify-content: space-between; width: 100%; visibility: visible !important; }
  .auto-option span { display: none; } 
  .min-max-labels { font-size: 0.55rem; padding: 0; }
  .switch { width: 28px; height: 16px; display: inline-block; border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; }
  .slider:before { width: 10px; height: 10px; left: 2px; bottom: 2px; }
  input:checked + .slider:before { transform: translateX(12px); }
  .auto-cashout-input { width: 40px; font-size: 10px; padding: 1px; display: inline-block !important; visibility: visible !important; border-color: var(--text-med); height: 18px; }

  .ou-container { padding: 2px; gap: 2px; }
  .ou-label { display: none; } 
  .ou-circle-btn { width: 20px; height: 20px; font-size: 0.6rem; }
  #ouBetAmount, #ouCoefInput { font-size: 0.9rem; }
  .ou-action-btn { padding: 4px; height: 36px; max-height: 36px; }
  .ou-act-title { font-size: 0.7rem; }
  .ou-act-odds { font-size: 0.6rem; }
}

@media (max-height: 350px) {
    header { height: 26px; }
    .balance-row { font-size: 0.65rem; }
    .history-container { height: 18px; }
    .history-item { font-size: 8px; min-width: 30px; }
    .game-area { min-height: 35%; }
    .bet-control { border-radius: 2px; }
    .bet-grid { gap: 2px; }
    .amount-control { border-radius: 2px; }
    .quick-bet-btn { font-size: 0.5rem; }
    .bet-amount-input { font-size: 10px; }
    .action-btn { font-size: 0.7rem; }
    .auto-cashout-input { width: 32px; font-size: 9px; height: 16px; }
    .switch { width: 24px; height: 14px; }
    .slider:before { width: 8px; height: 8px; left: 2px; bottom: 2px; }
    input:checked + .slider:before { transform: translateX(10px); }
}