/* ==========================================================================
   Kalchakra - Luxury Casino Design System
   ========================================================================== */

:root {
    --bg-dark: #0b0d11;
    --bg-card: rgba(20, 24, 33, 0.85);
    --bg-card-hover: rgba(28, 34, 48, 0.95);
    --border-gold: rgba(212, 163, 44, 0.4);
    --border-gold-bright: #ffd700;
    --gold-gradient: linear-gradient(135deg, #fff275 0%, #e5a93b 50%, #9a6514 100%);
    --gold-glow: 0 0 15px rgba(255, 215, 0, 0.45);
    --red-wheel: #c1121f;
    --black-wheel: #15181e;
    --green-accent: #10b981;
    --red-accent: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --shadow-deep: 0 10px 30px -5px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

.personal-history-card {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow-deep);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.personal-history-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.personal-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.personal-history-table th,
.personal-history-table td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    white-space: nowrap;
}

.personal-history-table th { color: #e5a93b; }
.personal-history-table td { color: #cbd5e1; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 15%, rgba(197, 155, 39, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 85% 85%, rgba(193, 18, 31, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Allow text selection only in form inputs */
input, textarea, select {
    -webkit-user-select: auto;
    user-select: auto;
    touch-action: auto;
}

/* Touch Manipulation Lock on Interactive Gaming Components */
button,
.chip,
.number-card,
.btn-tool,
.control-btn,
.brand,
.wallet-bar,
.stage-container,
.wheel-wrap,
.betting-grid,
.recent-pill {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Confetti Canvas for Victory Celebrations */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

/* Main Container Layout with Android/iOS Notch & Cutout Safe Area Insets */
.app-container {
    width: 100%;
    max-width: 1260px;
    min-width: 0;
    margin: 0 auto;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ==========================================================================
   Header Navigation Bar (Ultra-compact & sleek)
   ========================================================================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 6px 16px;
    box-shadow: var(--shadow-deep);
    min-height: 44px;
    box-sizing: border-box;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    animation: none !important;
    transform: none !important;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 6px #ffd700);
    animation: none !important;
    transform: none !important;
}

.brand-logo-img {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    display: block;
    animation: none !important;
    transform: none !important;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

.brand-text .sub-title {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    line-height: 1;
}

.header-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.status-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green-accent);
    box-shadow: 0 0 8px var(--green-accent);
}

.status-indicator .dot.live {
    animation: pulseGlow 1.8s infinite;
}

.wallet-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 163, 44, 0.3);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile-badge:hover {
    background: rgba(229, 169, 59, 0.18);
    border-color: #e5a93b;
    box-shadow: 0 0 10px rgba(229, 169, 59, 0.25);
}

#userAvatarImg {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #e5a93b;
    object-fit: cover;
    flex-shrink: 0;
}

#userNameDisplay {
    font-size: 0.74rem;
    font-weight: 700;
    color: #ffd700;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.balance-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.balance-label {
    display: block;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #e5a93b;
    line-height: 1;
}

.balance-value {
    font-family: var(--font-mono);
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

/* Custom Glowing Gold Casino Coin Icon */
.coin-svg {
    width: 15px;
    height: 15px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.65));
}

.coin-svg-lg {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    margin-right: 5px;
}

/* Header Actions: Strictly side-by-side in a horizontal row */
.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.btn-icon-square {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.btn-icon-square:hover {
    background: rgba(212, 163, 44, 0.2);
    border-color: var(--border-gold-bright);
    transform: translateY(-2px);
}

.btn-icon-square .icon-svg {
    width: 15px;
    height: 15px;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border: 1px solid #34d399;
    color: white;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-icon-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   Luxury Vector SVG Icon System
   ========================================================================== */
.icon-svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.icon-crown {
    color: #ffd700;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

.brand-icon .icon-svg {
    width: 32px;
    height: 32px;
}

.btn-icon-square .icon-svg {
    width: 18px;
    height: 18px;
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-icon .icon-svg {
    width: 16px;
    height: 16px;
}

.spin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spin-icon .icon-svg {
    width: 18px;
    height: 18px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
    margin-right: 6px;
    animation: pulseGlow 1.2s infinite alternate;
}

.stats-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-title .icon-svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Main Game Stage (Wheel & Betting Arena)
   ========================================================================== */
.game-stage {
    display: grid;
    grid-template-areas:
        "hud hud"
        "wheel betting";
    grid-template-columns: 340px 1fr;
    gap: 12px;
    align-items: start;
    transition: filter 0.3s ease;
}

/* ==========================================================================
   Casino Cockpit Live HUD Ribbon (Desktop: Above the fold)
   ========================================================================== */
.casino-hud-ribbon {
    grid-area: hud;
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 12px;
    align-items: stretch;
    width: 100%;
}

.hud-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hud-status .announcement-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 10px 16px;
    gap: 4px;
    box-sizing: border-box;
}

.hud-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.hud-timer .timer-controls-bar {
    height: 100%;
    padding: 8px 14px;
    box-sizing: border-box;
}

/* Locked state during spin */
.game-stage.spinning-locked .betting-section {
    opacity: 0.82;
    pointer-events: none;
}

.game-stage.spinning-locked .number-card,
.game-stage.spinning-locked .chip,
.game-stage.spinning-locked .btn-tool {
    cursor: not-allowed !important;
}

/* ==========================================================================
   Wheel Arena Section
   ========================================================================== */
.wheel-section {
    grid-area: wheel;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.betting-section {
    grid-area: betting;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.announcement-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-deep);
    transition: all 0.3s ease;
}

.announcement-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-accent);
    border: 1px solid rgba(16, 185, 129, 0.4);
    text-transform: uppercase;
}

.announcement-badge.rolling {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: #fbbf24;
    animation: pulseGlow 1s infinite alternate;
}

.announcement-badge.winner {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: #f87171;
    animation: pulseGlow 0.8s infinite alternate;
}

.announcement-msg {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    min-height: 22px;
}

/* Wheel Stage & LED Lights Ring */
.wheel-stage {
    position: relative;
    width: 320px;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(20, 24, 33, 0.9) 0%, rgba(10, 12, 16, 0.98) 100%);
    border-radius: 50%;
    padding: 12px;
    box-shadow: 
        0 0 35px rgba(0, 0, 0, 0.9),
        inset 0 0 25px rgba(0, 0, 0, 0.8),
        0 0 0 5px rgba(212, 163, 44, 0.3),
        0 0 0 8px rgba(10, 12, 16, 0.9);
}

/* LED Bulbs Ring around the Wheel */
.led-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
}

.led-bulb {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
    box-shadow: 0 0 2px #475569;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.led-bulb.lit-gold {
    background: #ffd700;
    box-shadow: 0 0 8px #ffd700, 0 0 14px rgba(255, 215, 0, 0.8);
}

.led-bulb.lit-red {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444, 0 0 14px rgba(239, 68, 68, 0.8);
}

.led-bulb.lit-cyan {
    background: #06b6d4;
    box-shadow: 0 0 8px #06b6d4, 0 0 14px rgba(6, 182, 212, 0.8);
}

/* Top Pointer Needle */
.needle-pointer {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 48px;
    z-index: 25;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.9));
}

.needle-body {
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 36px solid #ffd700;
    position: relative;
    transform-origin: 50% 0%;
    transition: transform 0.08s ease-out;
}

.needle-body::after {
    content: '';
    position: absolute;
    top: -36px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 24px solid #fff;
    opacity: 0.7;
}

.needle-pivot {
    position: absolute;
    top: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700 0%, #9a6514 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.needle-pointer.tick .needle-body {
    transform: rotate(14deg);
}

/* Wheel Wrapper & SVG */
.wheel-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.wheel-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(0deg);
    transition: transform 5.2s cubic-bezier(0.12, 0.75, 0.15, 1);
    will-change: transform;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.7));
}

.slice-path {
    cursor: pointer;
    transition: filter 0.2s ease;
}

.slice-path:hover {
    filter: brightness(1.2);
}

.slice-text {
    font-family: var(--font-heading);
    font-weight: 900;
    fill: #ffffff;
    user-select: none;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.slice-peg {
    fill: #ffd700;
    stroke: #805b10;
    stroke-width: 1.5;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

/* Result Spotlight Overlay */
.result-badge-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(11, 13, 17, 0.95);
    border: 2px solid #ffd700;
    border-radius: var(--radius-lg);
    padding: 16px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 30;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), var(--shadow-deep);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.result-badge-overlay.active {
    transform: translate(-50%, -50%) scale(1);
}

.result-title {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffd700;
}

.result-number-highlight {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #ffd700;
    line-height: 1;
}

.result-payout-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #10b981;
}

/* Timer Controls Bar */
.timer-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-deep);
}

.timer-display-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.timer-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.timer-countdown {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.timer-unit {
    font-size: 0.85rem;
    color: #94a3b8;
}

.timer-countdown.warning {
    color: #ef4444;
    animation: pulseGlow 0.5s infinite alternate;
}

.timer-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 3px;
}

.timer-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    transition: width 1s linear;
}

.round-total-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    text-align: right;
}

.round-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.round-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffd700;
}

.btn-spin-now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e5a93b 0%, #b45309 100%);
    border: 1px solid #ffd700;
    color: #0b0d11;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(229, 169, 59, 0.4);
    transition: all 0.2s ease;
}

.btn-spin-now:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #fff275 0%, #e5a93b 100%);
}

.btn-spin-now:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

/* ==========================================================================
   Betting Arena Section (Right Column)
   ========================================================================== */
.betting-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-deep);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #e5a93b;
}

.panel-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.badge-multiplier {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(229, 169, 59, 0.15);
    border: 1px solid var(--border-gold);
    color: #ffd700;
}

/* Chips Selector */
.chips-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed rgba(255, 255, 255, 0.4);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.chip-inner {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.chip:hover {
    transform: translateY(-4px) scale(1.08);
}

.chip.active {
    transform: translateY(-6px) scale(1.15);
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.8);
}

/* Chip Color Themes */
.chip-1 { background: radial-gradient(circle, #475569 0%, #1e293b 100%); border-color: #94a3b8; }
.chip-5 { background: radial-gradient(circle, #dc2626 0%, #991b1b 100%); border-color: #f87171; }
.chip-10 { background: radial-gradient(circle, #2563eb 0%, #1e40af 100%); border-color: #60a5fa; }
.chip-50 { background: radial-gradient(circle, #059669 0%, #065f46 100%); border-color: #34d399; }
.chip-100 { background: radial-gradient(circle, #4b5563 0%, #111827 100%); border-color: #d1d5db; }
.chip-500 { background: radial-gradient(circle, #7c3aed 0%, #4c1d95 100%); border-color: #c084fc; }

/* Numbers Matrix (0-9) */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.number-card {
    background: linear-gradient(180deg, #1e2430 0%, #12151c 100%);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.number-card:hover {
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.3);
}

.number-card:active {
    transform: scale(0.96);
}

.number-card.red-theme {
    border-top: 3px solid #ef4444;
}

.number-card.black-theme {
    border-top: 3px solid #94a3b8;
}

.number-card .card-num {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.number-card .card-payout {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Placed Bet Chip Badge Overlay (Clickable to Unbet) */
.placed-bet-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    background: linear-gradient(135deg, #ffd700 0%, #b45309 100%);
    color: #0b0d11;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
    display: none;
    animation: popBadge 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 15;
    cursor: pointer;
    transition: all 0.2s ease;
}

.placed-bet-badge:hover {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.placed-bet-badge.active {
    display: block;
}

.number-card.has-bet {
    border-color: #ffd700;
    background: linear-gradient(180deg, #2d2613 0%, #15181e 100%);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
}

/* Actions Toolbar */
.actions-toolbar {
    display: flex;
    gap: 8px;
}

.btn-tool {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #f8fafc;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tool:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-tool:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-undo:hover:not(:disabled) {
    border-color: #f59e0b;
    color: #fbbf24;
}

.btn-clear:hover:not(:disabled) {
    border-color: #ef4444;
    color: #f87171;
}

.btn-double:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #60a5fa;
}

.btn-rebet:hover:not(:disabled) {
    border-color: #10b981;
    color: #34d399;
}

/* ==========================================================================
   Live Intelligence & Trend Analytics Section (Above My History)
   ========================================================================== */
.game-analytics-section {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.analytics-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-deep);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.recent-results-card, .hot-cold-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.stats-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #e5a93b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.stats-info {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.recent-numbers-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    scrollbar-width: thin;
}

.recent-pill {
    min-width: 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 900;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.recent-pill.red {
    background: radial-gradient(circle, #dc2626 0%, #7f1d1d 100%);
    border-color: #f87171;
}

.recent-pill.black {
    background: radial-gradient(circle, #334155 0%, #0f172a 100%);
    border-color: #94a3b8;
}

.recent-pill.latest {
    border-color: #ffd700;
    box-shadow: 0 0 12px #ffd700;
    transform: scale(1.08);
}

.hot-cold-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-group.hot-group {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.03) 100%);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.stat-group.cold-group {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0.03) 100%);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.stat-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    min-width: 125px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hot-label {
    color: #f87171;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.cold-label {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.stat-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hot-group .stat-badge {
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fecaca;
}

.cold-group .stat-badge {
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #bae6fd;
}

/* ==========================================================================
   Rules & Info Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #141820;
    border: 1px solid var(--border-gold-bright);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), var(--gold-glow);
    animation: popBadge 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-gold);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #ffd700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body h3 {
    font-size: 1rem;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.modal-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.rules-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.rule-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.9fr;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    align-items: center;
}

.rule-row.header {
    background: rgba(229, 169, 59, 0.2);
    font-weight: 700;
    color: #ffd700;
}

.highlight-gold {
    color: #ffd700;
    font-weight: 700;
    font-family: var(--font-mono);
}

.modal-tips {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.modal-tips p {
    margin: 0;
    color: #a7f3d0;
}

/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */
@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes popBadge {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}


/* ==========================================================================
   Mobile Single-Viewport Zero-Scroll & Zero-Overflow Console (≤ 900px)
   ========================================================================== */
@media (max-width: 900px) {
    .app-container {
        padding: 6px 8px 24px;
        gap: 6px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Top Nav: Ultra-compact, slim mobile header */
    .top-nav {
        display: flex;
        flex-direction: column;
        padding: 4px 8px;
        gap: 3px;
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-sm);
        box-sizing: border-box;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .brand-icon .icon-svg {
        width: 16px;
        height: 16px;
    }

    .brand-text h1 {
        font-size: 0.86rem;
        letter-spacing: 0.8px;
        line-height: 1;
    }

    .brand-text .sub-title {
        font-size: 0.48rem;
        letter-spacing: 1px;
        line-height: 1;
    }

    .wallet-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .user-profile-badge {
        display: flex;
        align-items: center;
        gap: 4px;
        background: rgba(255, 255, 255, 0.05);
        padding: 1px 5px;
        border-radius: 12px;
        border: 1px solid var(--border-gold);
        max-width: 85px;
        min-width: 0;
        overflow: hidden;
    }

    .user-profile-badge img {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 1px solid #e5a93b;
        object-fit: cover;
        flex-shrink: 0;
    }

    .user-profile-badge span {
        font-size: 0.66rem;
        font-weight: 700;
        color: #ffd700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .balance-card {
        padding: 1px 6px;
        flex-shrink: 0;
        text-align: center;
        border-radius: var(--radius-sm);
    }

    .balance-card .balance-label {
        font-size: 0.46rem;
        letter-spacing: 0.8px;
        line-height: 1;
    }

    .balance-card .balance-value {
        font-size: 0.78rem;
        line-height: 1.1;
    }

    .balance-card-available {
        display: none;
    }

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

    .btn-icon-square {
        width: 24px;
        height: 24px;
        border-radius: 4px;
    }

    .btn-icon-square .icon-svg {
        width: 11px;
        height: 11px;
    }

    /* Main Game Console: Zero-scroll compact layout */
    .game-stage {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 100%;
        max-width: 100%;
    }

    /* Wheel Arena: Majestic Centered Wheel with Compact Controls Below */
    .wheel-section {
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: var(--bg-card);
        border: 1px solid var(--border-gold);
        border-radius: var(--radius-md);
        padding: 8px 8px 6px;
        box-shadow: var(--shadow-deep);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* On mobile, dissolve ribbon container so children order seamlessly */
    .casino-hud-ribbon {
        display: contents;
    }

    .hud-status {
        order: 2;
        width: 100%;
    }

    .hud-timer {
        order: 3;
        width: 100%;
    }

    .betting-section {
        order: 4;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .game-analytics-section {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .wheel-stage {
        width: min(72vw, 240px);
        max-width: 250px;
        aspect-ratio: 1 / 1;
        height: auto;
        padding: 6px;
        margin: 0 auto;
        box-shadow: 
            0 0 18px rgba(0, 0, 0, 0.9),
            0 0 0 4px rgba(212, 163, 44, 0.35),
            0 0 0 7px rgba(10, 12, 16, 0.95);
    }

    .needle-pointer {
        top: 1px;
        width: 26px;
        height: 32px;
    }

    .needle-body {
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-top: 24px solid #ffd700;
    }

    .needle-pivot {
        width: 11px;
        height: 11px;
        top: -3px;
    }

    .led-bulb {
        width: 6.5px;
        height: 6.5px;
    }

    /* Controls & Status HUD - Shifted cleanly below the wheel */
    .wheel-hud-panel {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
        max-width: 400px;
        box-sizing: border-box;
    }

    .announcement-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: rgba(10, 12, 16, 0.65);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(212, 163, 44, 0.28);
        border-radius: var(--radius-full);
        padding: 3px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .announcement-badge {
        font-size: 0.62rem;
        font-weight: 800;
        padding: 2px 7px;
        letter-spacing: 0.8px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .announcement-msg {
        font-size: 0.72rem;
        font-weight: 600;
        color: #e2e8f0;
        min-height: auto;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timer-controls-bar {
        display: grid;
        grid-template-columns: 1fr 1fr 1.32fr;
        gap: 5px;
        align-items: center;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .timer-display-box {
        background: rgba(15, 23, 42, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--radius-sm);
        padding: 3px 6px;
        text-align: center;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .timer-title {
        font-size: 0.48rem;
        letter-spacing: 0.6px;
        color: #94a3b8;
        display: block;
        line-height: 1;
        font-weight: 700;
    }

    .timer-countdown {
        font-size: 0.98rem;
        font-weight: 800;
        line-height: 1.1;
        margin-top: 1px;
    }

    .timer-unit {
        font-size: 0.62rem;
    }

    .timer-progress-bar {
        height: 3px;
        margin-top: 2px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }

    .round-total-box {
        background: rgba(15, 23, 42, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--radius-sm);
        padding: 3px 6px;
        text-align: center;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .round-label {
        font-size: 0.48rem;
        letter-spacing: 0.6px;
        color: #94a3b8;
        display: block;
        line-height: 1;
        font-weight: 700;
    }

    .round-value {
        font-size: 0.95rem;
        font-weight: 800;
        color: #ffd700;
        line-height: 1.1;
        margin-top: 1px;
        text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
    }

    .btn-spin-now {
        padding: 5px 6px;
        font-size: 0.66rem;
        font-weight: 700;
        justify-content: center;
        border-radius: var(--radius-sm);
        width: 100%;
        height: 100%;
        min-height: 36px;
        box-sizing: border-box;
    }

    .btn-spin-now .spin-icon .icon-svg {
        width: 13px;
        height: 13px;
    }

    .btn-spin-now .spin-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .result-badge-overlay {
        padding: 8px 14px;
        border-radius: var(--radius-md);
    }

    .result-badge-overlay .result-title {
        font-size: 0.65rem;
    }

    .result-number-highlight {
        font-size: 2.2rem;
        line-height: 1;
    }

    .result-payout-text {
        font-size: 0.8rem;
    }

    /* Betting Section directly beneath wheel */
    .betting-section {
        gap: 5px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .chip-selector-panel {
        padding: 4px 6px;
    }

    .panel-header {
        margin-bottom: 2px;
    }

    .panel-title {
        font-size: 0.64rem;
    }

    .panel-hint {
        display: none;
    }

    .chips-container {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        width: 100%;
    }

    .chip {
        width: 100%;
        max-width: 44px;
        aspect-ratio: 1 / 1;
        height: auto;
        padding: 0;
        margin: 0 auto;
    }

    .chip-inner {
        font-size: 0.74rem;
    }

    /* Number Grid: 2 rows of 5 cards */
    .number-grid-panel {
        padding: 4px 6px;
    }

    .numbers-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        width: 100%;
    }

    .number-card {
        width: 100%;
        height: 46px;
        min-width: 0;
        padding: 2px;
        border-radius: var(--radius-sm);
    }

    .number-card .card-num {
        font-size: 1.25rem;
    }

    .number-card .card-payout {
        font-size: 0.5rem;
    }

    .number-card .placed-bet-badge {
        font-size: 0.6rem;
        padding: 1px 3px;
        top: 2px;
        right: 2px;
    }

    /* Actions Toolbar */
    .actions-toolbar {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        width: 100%;
    }

    .btn-tool {
        width: 100%;
        min-width: 0;
        padding: 6px 2px;
        font-size: 0.68rem;
        gap: 2px;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .result-badge-overlay {
        padding: 8px 12px;
    }

    .result-number-highlight {
        font-size: 1.8rem;
    }

    /* Stats cards mobile sizing */
    .recent-results-card, .hot-cold-card, .hud-results-card, .personal-history-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        padding: 8px 10px;
        box-sizing: border-box;
    }

    .stats-header {
        margin-bottom: 6px;
        gap: 4px;
    }

    .stats-title {
        font-size: 0.72rem;
    }

    .stats-info {
        font-size: 0.65rem;
    }

    .recent-numbers-strip {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 4px;
    }

    .recent-pill {
        min-width: 28px;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .personal-history-table-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .personal-history-table {
        width: 100%;
        min-width: 360px;
        font-size: 0.72rem;
    }

    .personal-history-table th,
    .personal-history-table td {
        padding: 6px 6px;
    }
}

/* Extra small Android screens (≤ 360px) */
@media (max-width: 360px) {
    .top-nav {
        padding: 3px 6px;
        gap: 2px;
    }

    .brand-text h1 {
        font-size: 0.8rem;
    }

    .wheel-section {
        padding: 6px 6px 4px;
        gap: 5px;
    }

    .wheel-stage {
        width: min(68vw, 215px);
        max-width: 215px;
        padding: 5px;
    }

    .timer-controls-bar {
        grid-template-columns: 1fr 1fr 1.25fr;
        gap: 3px;
    }

    .timer-countdown, .round-value {
        font-size: 0.88rem;
    }

    .btn-spin-now {
        font-size: 0.6rem;
        padding: 4px 3px;
        min-height: 34px;
    }

    .announcement-badge {
        font-size: 0.56rem;
        padding: 1px 5px;
    }

    .announcement-msg {
        font-size: 0.66rem;
    }

    .chip-inner {
        font-size: 0.66rem;
    }

    .number-card {
        height: 40px;
    }

    .number-card .card-num {
        font-size: 1.1rem;
    }

    .btn-tool span:not(.tool-icon) {
        font-size: 0.6rem;
    }
}

/* ==========================================================================
   Player Profile & Master Link Modal Mini Window
   ========================================================================== */
.profile-modal-card {
    max-width: 440px !important;
    width: min(440px, calc(100vw - 28px)) !important;
    background: linear-gradient(180deg, #141822 0%, #0c0f17 100%) !important;
    border: 1px solid rgba(229, 169, 59, 0.35) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(229, 169, 59, 0.12) !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.profile-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(229, 169, 59, 0.2) !important;
}

.profile-modal-header h2 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-family: var(--font-heading) !important;
    font-size: 1.08rem !important;
    color: #ffd700 !important;
    margin: 0 !important;
    min-width: 0 !important;
}

.profile-modal-header h2 span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.profile-modal-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    box-sizing: border-box !important;
}

/* Player Identity Card */
.profile-user-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.profile-avatar-wrap {
    position: relative !important;
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
}

.profile-avatar-wrap img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 1.5px solid #ffd700 !important;
    box-shadow: 0 0 10px rgba(229, 169, 59, 0.3) !important;
    display: block !important;
}

.profile-online-dot {
    position: absolute !important;
    bottom: -1px !important;
    right: -1px !important;
    width: 11px !important;
    height: 11px !important;
    background: #10b981 !important;
    border: 2px solid #141820 !important;
    border-radius: 50% !important;
}

.profile-user-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
}

.profile-user-name {
    font-weight: 700 !important;
    font-size: 0.96rem !important;
    color: #fff !important;
    line-height: 1.25 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.profile-user-email {
    font-size: 0.76rem !important;
    color: var(--text-muted) !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.profile-wallet-pill {
    flex-shrink: 0 !important;
    text-align: right !important;
    background: rgba(0, 0, 0, 0.35) !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    min-width: 76px !important;
    box-sizing: border-box !important;
}

.profile-wallet-label {
    font-size: 0.64rem !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

.profile-wallet-amount {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #34d399 !important;
    white-space: nowrap !important;
}

.profile-wallet-amount .coin-svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
}

/* Master Status Box */
.profile-master-box {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.profile-master-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.profile-master-tag {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
}

.profile-master-tag svg {
    width: 15px !important;
    height: 15px !important;
    color: var(--gold-glow) !important;
    flex-shrink: 0 !important;
}

.profile-status-badge {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    letter-spacing: 0.4px !important;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.profile-master-desc {
    font-size: 0.82rem !important;
    color: #cbd5e1 !important;
    line-height: 1.45 !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px dashed rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
}

.profile-link-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 2px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.profile-input-group {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
}

.profile-input-group input {
    flex: 1 1 180px !important;
    min-width: 0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    color: #fff !important;
    font-size: 0.88rem !important;
    outline: none !important;
    font-family: 'JetBrains Mono', monospace !important;
    text-transform: uppercase !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.profile-input-group input:focus {
    border-color: #ffd700 !important;
    box-shadow: 0 0 10px rgba(229, 169, 59, 0.25) !important;
}

.profile-submit-btn {
    flex: 0 0 auto !important;
    background: linear-gradient(135deg, #e5a93b 0%, #b38018 100%) !important;
    color: #060913 !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.profile-submit-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(229, 169, 59, 0.35) !important;
}

.profile-submit-btn:active {
    transform: translateY(0) !important;
}

/* Mobile Responsiveness for Profile Mini Window */
@media (max-width: 480px) {
    .profile-modal-card {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }

    .profile-modal-header h2 {
        font-size: 0.98rem !important;
    }

    .profile-user-card {
        padding: 10px 10px !important;
        gap: 10px !important;
    }

    .profile-avatar-wrap {
        width: 38px !important;
        height: 38px !important;
    }

    .profile-user-name {
        font-size: 0.9rem !important;
    }

    .profile-user-email {
        font-size: 0.72rem !important;
    }

    .profile-wallet-pill {
        min-width: 68px !important;
        padding: 4px 8px !important;
    }

    .profile-wallet-amount {
        font-size: 0.92rem !important;
    }

    .profile-master-box {
        padding: 12px !important;
    }

    .profile-master-tag {
        font-size: 0.7rem !important;
    }

    .profile-input-group {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .profile-input-group input {
        width: 100% !important;
        flex: 1 1 auto !important;
    }

    .profile-submit-btn {
        width: 100% !important;
        padding: 11px !important;
    }
}
