/* --- 1. Theme Variables --- */
:root {
    --bg-deep: #0f172a; 
    --bg-surface: #1e293b; 
    --bg-elevated: #334155; 
    --primary-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass: rgba(30, 41, 59, 0.7);
}

/* --- 2. Base Resets & Layout --- */
html {
    font-size: 16px;
    height: 100%;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding-top: 60px;    /* Space for fixed header */
    padding-bottom: 50px; /* Space for fixed footer */
    min-height: 100vh;
}

/* Make sure the main container feels modern and centered */
.container {
    max-width: 1200px;
}

/* --- 3. 3D Poker Components --- */
.game-table {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border-radius: 40px;
    padding: 3rem;
    box-shadow: inset 0 4px 30px rgba(0,0,0,0.7);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.poker-card {
    background-color: var(--bg-elevated);
    border-radius: 12px;
    width: 100px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.5), 
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.poker-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--primary-blue);
    box-shadow: 0 0 15px var(--primary-blue);
}

/* --- 4. HTMX Transitions --- */
.htmx-added {
    opacity: 0;
}
.htmx-settling {
    opacity: 1;
    transition: opacity 0.4s ease-out;
}

/* --- 5. Navigation Adjustments (Fixing the .NET defaults) --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
}

.navbar {
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 0 !important;
}

.navbar-brand, .nav-link {
    color: var(--text-main) !important;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

footer,
.footer {
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 40;
    background-color: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

/* --- Landing Page Fixes --- */
.landing-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.landing-title {
    color: var(--primary-blue);
    font-weight: 900;
    font-style: italic;
    font-size: 3.5rem;
    margin-bottom: 3rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    text-align: center;
}

.action-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 450px;
}

.action-card {
    background-color: var(--bg-elevated);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.4), 
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
}

.action-card:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    border-color: var(--primary-blue);
}

.create-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
    color: white;
    font-weight: 900;
    font-size: 1.25rem;
    padding: 1.25rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.join-header {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

.join-form {
    display: flex;
    gap: 0.5rem;
}

.join-form input {
    flex: 1;
    background-color: var(--bg-deep);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-family: monospace;
    font-size: 1.25rem;
    outline: none;
}

.join-form input:focus {
    border-color: var(--primary-blue);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: white;
    font-weight: bold;
    padding: 0 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* --- Player Hand UI --- */
.player-hand {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
    z-index: 50;
    overflow-x: auto;
}

.hand-card {
    background-color: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: 8px;
    min-width: 50px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    color: var(--text-main);
}

/* --- Adjusted Player Hand Animations --- */
.hand-card:hover {
    transform: scale(1.05) translateY(-4px);
    border-color: var(--text-dim);
}

.hand-card.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--primary-blue);
    transform: scale(1.1) translateY(-6px);
}

/* --- Game Area Wrapper: three-column layout --- */
.game-area-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    padding: 1.5rem 0;
}

/* --- Left Sidebar: Score Panel --- */
.board-overlay {
    flex-shrink: 0;
    width: 190px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
}

.category-list {
    background: rgba(15, 23, 42, 0.75);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.category-section-header {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--primary-blue);
    text-transform: uppercase;
    padding-bottom: 0.1rem;
}

.category-section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.2rem 0;
}

.category-item {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.category-item span {
    font-weight: bold;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 120px;
    vertical-align: bottom;
}

/* --- Right Sidebar: Mean Box --- */
.mean-box {
    flex-shrink: 0;
    width: 160px;
    background: rgba(15, 23, 42, 0.75);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.mean-box-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mean-label {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--primary-blue);
    text-transform: uppercase;
}

.mean-value {
    color: white;
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1;
}

.mean-box-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Native HTML5 Dialog element styling */
dialog {
    background: var(--bg-elevated);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2rem;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

dialog::backdrop {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
}