/* =============================================================================
   CONTROLS.CSS — Bottom Controls Panel: Rows Selector, Bet, Play, Auto
   Plinko Game | Claymorphism Theme
   ============================================================================= */

/* ── Game Canvas Area ─────────────────────────────────────────────────────── */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    margin-top: -1.2rem;
    padding: 0 1.2rem;
}
.canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.game-canvas {
    width: 100%;
    height: 100%;
    max-height: 66vh;
    object-fit: contain;
}

/* ── Controls Section Wrapper ─────────────────────────────────────────────── */
.controls-section {
    width: 100%;
    padding: 0 1.4rem 1.6rem;
    z-index: 30;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* ── Rows Selector Bar ────────────────────────────────────────────────────── */
.rows-selector-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.rows-label {
    font-size: 9px;
    color: var(--clay-text-muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
    text-shadow: 1px 1px 0px #ffffff;
}

/* Pill track that holds all row number buttons */
.row-selector-container {
    background: #ebdffd;
    border-radius: 16px;
    padding: 4.5px;
    display: flex;
    justify-content: space-between;
    gap: 3px;
    box-shadow: var(--clay-inset);
    flex: 1;
    width: 100%;
}

/* Individual row count buttons (8–16) */
.row-btn {
    flex: 1;
    height: 34px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 850;
    color: var(--clay-text-muted);
    background: transparent;
    border: none;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    cursor: pointer;
    min-width: 0;
}
.row-btn:hover  { color: var(--clay-text-dark); background: rgba(255, 255, 255, 0.35); }
.row-btn:active { transform: scale(0.93); }

/* Active / selected row button — purple accent */
.row-btn-active,
.row-btn-active:hover,
.row-btn-active:focus,
.row-btn-active:active {
    background: #f4e6ff !important;
    color: #822ee3 !important;
    border: 2px solid #ffffff !important;
    box-shadow:
        0 4px 10px rgba(130, 46, 227, 0.15),
        inset 1.5px 1.5px 3px #ffffff,
        inset -1.5px -1.5px 3px rgba(130, 46, 227, 0.2),
        0 0 12px rgba(130, 46, 227, 0.15) !important;
    font-weight: 900 !important;
}

/* ── Bottom Controls Row (Bet | Play | Auto) ──────────────────────────────── */
.bottom-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    gap: 12px;
}

/* Shared inset capsule used by both Bet and Auto panels */
.control-capsule {
    height: 56px;
    background: #f4edf8;
    border-radius: 28px;
    border: 3px solid #ffffff;
    box-shadow:
        0 6px 16px rgba(121, 110, 187, 0.05),
        inset 3px 3px 6px rgba(121, 110, 187, 0.2),
        inset -3px -3px 6px #ffffff;
    display: flex;
    align-items: center;
    padding: 0 6px 0 14px;
    position: relative;
    flex: 1;
    min-width: 90px;
}

/* ── Bet Capsule ──────────────────────────────────────────────────────────── */
.bet-capsule    { display: flex; justify-content: space-between; }
.bet-info       { display: flex; flex-direction: column; overflow: hidden; padding-right: 2px; }
.bet-label-tag  {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--clay-text-muted);
    letter-spacing: 0.08em;
    font-weight: 900;
    text-shadow: 1px 1px 0px #ffffff;
}
.bet-display-value {
    font-size: 11.5px;
    font-weight: 950;
    color: var(--clay-text-dark);
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
/* Red state when bet exceeds balance */
.bet-insufficient { color: #ef004c; text-shadow: 0 0 10px rgba(239, 0, 76, 0.15); }

/* Orange coin / stack icon button inside bet capsule */
.coin-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffab40;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 10px rgba(255, 122, 0, 0.18),
        inset 2px 2px 4px #ffffff,
        inset -2px -2px 4px rgba(172, 79, 0, 0.3);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    flex-shrink: 0;
}
.coin-btn:hover  { transform: scale(1.1) rotate(15deg); background: #ffbc54; }
.coin-btn:active { transform: scale(0.9) translateY(1.5px); box-shadow: inset 1.5px 1.5px 3.5px rgba(255, 122, 0, 0.3); }

/* Three stacked lines inside the coin button */
.coin-icon-lines { display: flex; flex-direction: column; gap: 3.5px; align-items: center; justify-content: center; }
.coin-icon-lines::before,
.coin-icon-lines::after,
.coin-icon-lines { content: ''; width: 15px; height: 3px; background: rgba(255, 255, 255, 0.85); border-radius: 10px; }

/* ── Play Button ──────────────────────────────────────────────────────────── */
/* Outer inset ring that cradles the play button */
.play-btn-circle-bay {
    width: 88px;
    height: 88px;
    background: #ebdffd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--clay-inset);
    flex-shrink: 0;
}

/* The pressable gradient circle */
.play-btn-inner {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff758f 0%, #ff0054 100%);
    border: 3.5px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 4px 4px 8px rgba(255, 255, 255, 0.75),
        inset -4px -4px 8px rgba(153, 0, 48, 0.45),
        0 8px 24px rgba(255, 0, 84, 0.22);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.35);
}
.play-btn-inner:hover  { transform: scale(1.06); filter: brightness(1.05); }
.play-btn-inner:active { transform: scale(0.91); box-shadow: inset 4px 4px 8px rgba(153, 0, 48, 0.5); }

/* Greyed-out state during auto-play */
.play-btn-disabled {
    opacity: 0.45;
    filter: grayscale(0.8) !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* CSS triangle icon inside play button */
.play-triangle-icon {
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-left: 21px solid rgba(255, 255, 255, 0.95);
    border-bottom: 12px solid transparent;
    margin-left: 6px;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.2));
}

/* ── Auto-Play Capsule ────────────────────────────────────────────────────── */
.auto-capsule {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px !important;
    gap: 4px;
}

/* Sync/rotation icon button */
.auto-btn-inner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f5eeff;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 10px rgba(131, 56, 236, 0.12),
        inset 2px 2px 4px #ffffff,
        inset -2px -2px 4px rgba(131, 56, 236, 0.2);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    flex-shrink: 0;
    color: #8338ec;
}
.auto-btn-inner:hover  { transform: scale(1.1); background: #fbf8ff; }
.auto-btn-inner:active { transform: scale(0.9); box-shadow: inset 1.5px 1.5px 3.5px rgba(131, 56, 236, 0.2); }

/* Active (auto running) state */
.auto-active {
    background: #ebdffd;
    color: #8338ec;
    box-shadow: inset 1.5px 1.5px 3.5px rgba(255, 255, 255, 0.5), 0 0 12px rgba(131, 56, 236, 0.25);
}

/* SVG sync icon — slow idle spin, fast active spin */
.sync-icon {
    color: currentColor;
    stroke: currentColor;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    animation: rotate-slow 12s linear infinite;
}
.auto-active .sync-icon { animation: rotate-fast 2s linear infinite; color: #8338ec; }

@keyframes rotate-slow { from { transform: rotate(0deg);   } to { transform: rotate(360deg);  } }
@keyframes rotate-fast { from { transform: rotate(0deg);   } to { transform: rotate(-360deg); } }

/* ── Auto-Play Toggle Switch ──────────────────────────────────────────────── */
.auto-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 2px;
}
.auto-slide-toggle {
    width: 40px;
    height: 24px;
    background: #ebdffd;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--clay-inset);
    cursor: pointer;
    overflow: hidden;
}
.auto-slide-knob {
    position: absolute;
    top: 2.5px;
    bottom: 2.5px;
    left: 2.5px;
    width: 19px;
    background: #bfa5e5;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1.25);
    box-shadow: inset 1px 1px 2px #ffffff, 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Toggle on — knob slides right and turns purple */
.auto-slide-active {
    left: 18.5px;
    background: #8338ec;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.5), 0 2px 6px rgba(131, 56, 236, 0.35);
}

/* ── Auto Rounds Popup Menu ───────────────────────────────────────────────── */
.auto-menu {
    position: absolute;
    bottom: 66px;
    left: 50%;
    transform: translateX(-50%);
    background: #f6f1fc;
    border-radius: 16px;
    border: 3px solid #ffffff;
    display: flex;
    flex-direction: column;
    width: 64px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(121, 110, 187, 0.2), inset 2px 2px 4px #ffffff;
    z-index: 110;
    animation: slideUpFade 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}
.auto-menu-btn {
    padding: 11px 0;
    font-weight: 850;
    font-size: 13.5px;
    border: none;
    border-bottom: 1.5px solid rgba(131, 56, 236, 0.15);
    color: var(--clay-text-dark);
    text-align: center;
    cursor: pointer;
    background: none;
    transition: all 0.15s;
}
.auto-menu-btn:last-child { border-bottom: none; }
.auto-menu-btn:hover      { background: rgba(255, 255, 255, 0.55); color: #8338ec; }
