@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Cinzel:wght@600;700;800;900&display=swap');

:root {
    --bg-main: #070b14;
    --bg-surface: #0f172a;
    --bg-card: #131d33;
    --bg-card-hover: #182440;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(245, 158, 11, 0.35);
    --border-active: #f59e0b;
    
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.25);
    --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    
    --andar-color: #4f46e5;
    --andar-light: #6366f1;
    --andar-glow: rgba(99, 102, 241, 0.35);
    --andar-gradient: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    
    --bahar-color: #dc2626;
    --bahar-light: #ef4444;
    --bahar-glow: rgba(239, 68, 68, 0.35);
    --bahar-gradient: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);

    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-main: 'Outfit', sans-serif;
    --font-royal: 'Cinzel', serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 60%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, .font-royal {
    font-family: var(--font-royal);
    letter-spacing: 0.03em;
}

/* Glass & Surfaces */
.glass-panel {
    background: rgba(19, 29, 51, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
}

.glass-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px -3px var(--gold-glow);
}

/* Header & Navbar */
.navbar-custom {
    background: rgba(10, 15, 28, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.5rem 0.75rem;
}

@media (min-width: 640px) {
    .navbar-custom {
        padding: 0.75rem 1.5rem;
    }
}

/* Badges & Chips */
.badge-gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border: 1px solid var(--gold);
    color: #fef08a;
    font-weight: 600;
}

.badge-live {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 2px rgba(239, 68, 68, 0.1); }
}

.badge-andar {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--andar-light);
    color: #c7d2fe;
}

.badge-bahar {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--bahar-light);
    color: #fecaca;
}

/* Buttons */
.btn-gold {
    background: var(--gold-gradient);
    color: #1e1b4b;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-andar {
    background: var(--andar-gradient);
    color: #ffffff;
    font-weight: 700;
    border: 2px solid #818cf8;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
    box-shadow: 0 6px 20px var(--andar-glow);
    cursor: pointer;
}

.btn-andar:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    border-color: #a5b4fc;
}

.btn-bahar {
    background: var(--bahar-gradient);
    color: #ffffff;
    font-weight: 700;
    border: 2px solid #f87171;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
    box-shadow: 0 6px 20px var(--bahar-glow);
    cursor: pointer;
}

.btn-bahar:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
    border-color: #fca5a5;
}

/* Chip Selector */
.chip-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #1e293b;
    color: #ffffff;
    user-select: none;
}

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

.chip-btn.selected {
    transform: translateY(-6px) scale(1.15);
    box-shadow: 0 0 20px var(--gold);
    border: 3px solid #fef08a;
}

.chip-100 { background: radial-gradient(circle, #3b82f6 0%, #1e3a8a 100%); border-color: #93c5fd; }
.chip-500 { background: radial-gradient(circle, #10b981 0%, #064e3b 100%); border-color: #a7f3d0; }
.chip-1000 { background: radial-gradient(circle, #ef4444 0%, #7f1d1d 100%); border-color: #fecaca; }
.chip-1500 { background: radial-gradient(circle, #8b5cf6 0%, #4c1d95 100%); border-color: #ddd6fe; }
.chip-2000 { background: radial-gradient(circle, #f59e0b 0%, #78350f 100%); border-color: #fef08a; color: #1e1b4b; }

/* Playing Cards Rendering */
.card-slot {
    width: 105px;
    height: 145px;
    background: #ffffff;
    border-radius: 10px;
    border: 3px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(245, 158, 11, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    position: relative;
    user-select: none;
    animation: card-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes card-reveal {
    0% { transform: scale(0.6) rotateY(90deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.card-empty {
    width: 105px;
    height: 145px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

/* Countdown Bar & Circular Ring */
.timer-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle {
    transform: rotate(-90deg);
}

.timer-circle circle {
    transition: stroke-dashoffset 1s linear;
}

/* Animations */
@keyframes win-glow {
    0%, 100% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.6), inset 0 0 20px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 50px rgba(16, 185, 129, 0.9), inset 0 0 35px rgba(16, 185, 129, 0.6); }
}

.winner-andar {
    border-color: #6366f1 !important;
    animation: win-glow 1.5s infinite;
}

.winner-bahar {
    border-color: #ef4444 !important;
    animation: win-glow 1.5s infinite;
}

/* Form Styles */
.form-input-custom {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: all 0.2s;
}

.form-input-custom:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    background: rgba(19, 29, 51, 0.95);
}

.form-input-custom.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-input-custom.is-valid {
    border-color: #10b981;
}

.invalid-feedback-custom {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: block;
}

/* Custom Casino Room & Betting Screen Tokens */
.casino-pattern-bg {
    background-color: #080a10;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(20, 26, 42, 0.7) 0%, rgba(8, 10, 16, 0.95) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Ctext x='15' y='25' font-size='16' font-family='serif'%3E♠%3C/text%3E%3Ctext x='55' y='25' font-size='16' font-family='serif'%3E♥%3C/text%3E%3Ctext x='15' y='65' font-size='16' font-family='serif'%3E♦%3C/text%3E%3Ctext x='55' y='65' font-size='16' font-family='serif'%3E♣%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* Room Thumbnail Card matching Images 3 & 5 */
.casino-room-card {
    border: 2px solid #ffffff;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background: #11141c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.casino-room-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.3);
    border-color: #f59e0b;
}

/* Image 4 Poker Chips */
.chip-green  { background: radial-gradient(circle, #22c55e, #15803d); color: #ffffff; border: 2px dashed rgba(255,255,255,0.7); }
.chip-silver { background: radial-gradient(circle, #94a3b8, #475569); color: #ffffff; border: 2px dashed rgba(255,255,255,0.7); }
.chip-purple { background: radial-gradient(circle, #a855f7, #6b21a8); color: #ffffff; border: 2px dashed rgba(255,255,255,0.7); }
.chip-pink   { background: radial-gradient(circle, #ec4899, #9d174d); color: #ffffff; border: 2px dashed rgba(255,255,255,0.7); }
.chip-gold   { background: radial-gradient(circle, #eab308, #854d0e); color: #ffffff; border: 2px dashed rgba(255,255,255,0.7); }

/* Image 4 Bead Road History Grid */
.bead-b-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.bead-a-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.bead-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
}

/* Admin Game Control — original card layout (does not depend on Tailwind CDN) */
.hidden { display: none; }
input.peer { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

header.sticky { position: sticky; top: 0; z-index: 40; background: #0d1322; border-bottom: 1px solid rgba(30, 41, 59, 0.8); }
header .flex { display: flex; }
header nav { display: none; align-items: center; gap: 0.5rem; }
@media (min-width: 768px) {
    header nav { display: flex !important; }
    #mobile-menu-toggle { display: none !important; }
    .md\:hidden { display: none !important; }
    .md\:flex { display: flex !important; }
}

main.max-w-7xl,
main { max-width: 80rem; width: 100%; margin-left: auto; margin-right: auto; padding: 1.5rem; flex-grow: 1; }

.space-y-5 > * + * { margin-top: 1.25rem; }
.glass-panel { padding: 1.25rem; }

.gc-control-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 1024px) {
    .gc-control-matrix { grid-template-columns: 1fr 1fr; }
}
.gc-control-matrix > .glass-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-color: #1e293b;
}

.gc-workflow-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    font-size: 10px;
    font-weight: 700;
}

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-1 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.w-full { width: 100%; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.cursor-pointer { cursor: pointer; }

.bg-emerald-600 { background: #059669; color: #fff; }
.bg-emerald-700 { background: #047857; color: #fff; }
.bg-red-600 { background: #dc2626; color: #fff; }
.bg-amber-500 { background: #f59e0b; color: #020617; }
.bg-amber-600 { background: #d97706; color: #020617; }
.bg-amber-700 { background: #b45309; color: #fff; }
.bg-indigo-700 { background: #4338ca; color: #fff; }
.bg-slate-800 { background: #1e293b; }
.bg-slate-900 { background: #0f172a; }

#btn-stream-start,
#btn-stream-end {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 0.75rem;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
}
#btn-stream-start { background: #059669; box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3); }
#btn-stream-end { background: #dc2626; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3); }

#admin-stream-preview {
    height: 175px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.gc-control-matrix label .p-2,
.gc-control-matrix label > div {
    padding: 0.5rem;
    text-align: center;
    border-radius: 0.5rem;
    background: #1e293b;
    font-size: 12px;
    font-weight: 700;
}
.gc-control-matrix label:has(input:checked) > div {
    background: #f59e0b;
    color: #020617;
}

.btn-gold {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    text-align: center;
}

#notif-dropdown-menu.hidden,
#notif-mobile-backdrop.hidden,
#mobile-sidebar-backdrop.hidden {
    display: none !important;
}
#mobile-sidebar {
    transform: translateX(-100%);
}

