/* Base Styling & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Roboto', sans-serif;
}

body {
    background: #0f172a; /* Dark blue/gray background */
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle at top right, #1e1b4b, #0f172a 40%),
                      radial-gradient(circle at bottom left, #064e3b, #0f172a 40%);
    background-attachment: fixed;
}

/* Glassmorphism Container */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
}

.dashboard-panel {
    max-width: 600px;
    margin: 2rem;
    width: 90%;
}

/* Typography */
h1, h2, h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
    font-weight: 600;
}

.text-cyan {
    color: #06b6d4;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Neon Glow Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.7);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: none;
    font-size: 0.9rem;
    text-align: center;
}

.alert.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    display: block;
}

/* Dashboard specific */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info .name {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-info .balance {
    color: #06b6d4;
    font-size: 0.9rem;
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Playing Cards */
.player-hand {
    position: absolute;
    bottom: 5%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 10;
}

.card-img {
    width: 12vw;
    max-width: 80px;
    height: auto;
    margin-left: -6vw; /* Overlap cards */
    cursor: pointer;
    transition: all 0.3s ease-out !important;
    position: relative;
    user-select: none;
    -webkit-user-drag: element;
    transform: none !important;
}

.card-img.dragging {
    opacity: 0.5;
    z-index: 1000 !important;
}

.card-img:first-child {
    margin-left: 0;
}

.card-img:hover {
    transform: translateY(-15px) !important;
    z-index: 100 !important;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6));
}

/* Step 5: Opponent Cards Rotation */
.player-left .card-img, .player-right .card-img,
.player-left .card-back, .player-right .card-back {
    transform: rotate(90deg) !important;
}

/* Desktop Responsive Layout */
@media (min-width: 768px) {
    /* Step 3: Desktop Player Hand Fix */
    .player-hand .card-img {
        width: 90px;
        max-width: none;
        margin-left: -50px;
    }
    
    .player-hand .card-img:first-child {
        margin-left: 0;
    }

    /* Step 4: Desktop Table Adjustment */
    .player-left { left: 15% !important; }
    .player-right { right: 15% !important; }
    .player-top { top: 15% !important; }
}
