.auth-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.auth-container {
    color: white;
}

/* Make Login/Register headings match hero-title styling scale */
.auth-form h3 {
    margin: 0 0 10px 0;
    font-weight: 900;
    font-size: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #8B5CF6 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin: 0;
    border: 1px solid #444;
    border-radius: 5px;
    background: #222;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.auth-form button {
    width: 100%;
    padding: 12px 14px;
    margin: 0;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 6px 18px rgba(245,158,11,0.28);
}

.auth-form button::before {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 120%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-15deg);
    transition: left .5s ease;
}

.auth-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(245,158,11,0.38);
}

.auth-form button:hover::before {
    left: 120%;
}

.auth-form p {
    margin: 0;
    text-align: center;
    font-size: 12px;
}

/* Keep bottom meta line same height on both forms so spacing is identical */
.auth-form p:last-child { min-height: 2.4em; display: block; }

/* Center inner content, standardize spacing between fields */
.auth-form { display: grid; justify-items: center; align-content: start; gap: 14px; }
.auth-fields { display: grid; gap: 12px; justify-items: center; width: 100%; max-width: 420px; margin: 0 auto; }
.auth-meta { display: grid; gap: 6px; justify-items: center; }
.auth-meta .subtle { opacity: 0.8; }
/* Ensure register fields center identically */
#register-form input, #register-form button { margin-left: auto; margin-right: auto; display:block; }
#register-form { align-items: center; }

/* Inputs/buttons always fill the local field container; responsive cap above */

.auth-form a {
    color: #00ff88;
    text-decoration: none;
}

.auth-form a:hover {
    text-decoration: underline;
}

.user-info h3 {
    margin: 0 0 15px 0;
    color: #00ff88;
    font-size: 16px;
    text-align: center;
}

.user-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
}

.user-stats p {
    margin: 5px 0;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

.user-stats span {
    font-weight: bold;
    color: #00ff88;
}

#logout-btn {
    width: 100%;
    padding: 8px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#logout-btn:hover {
    background: #cc3333;
}

.auth-message {
    margin-top: 10px;
    padding: 8px;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
    display: none;
}

.auth-message.success {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00ff88;
    color: #00ff88;
}

.auth-message.error {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    color: #ff4444;
}

.auth-message.info {
    background: rgba(0, 150, 255, 0.2);
    border: 1px solid #0096ff;
    color: #0096ff;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-panel {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px;
        min-width: auto;
    }
}

/* Match history styles */
.history.card {
    margin-top: 1rem;
}

/* Ensure history section can use full available width */
.account-page .history.card.full-bleed { width: 100vw; max-width: 100vw; }
@media (min-width: 1200px) {
  /* On wide screens, constrain history to ~60% viewport width */
  .account-page .history.card.full-bleed { width: 60vw; max-width: 60vw; }
}
.account-page .history.card.full-bleed .history-scroll { overflow-x: visible; }
@media (max-width: 1024px) {
  .account-page .history.card.full-bleed .history-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.history-list .empty {
    color: #9CA3AF;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}


/* Table version of history */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 700px;
}

.history-table thead th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9CA3AF;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    position: static; /* default: not sticky on wide screens to avoid overflow artifacts */
}

.history-table tbody td {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.history-table tbody tr:hover td {
    background: rgba(255,255,255,0.03);
}

.history-tr.win td.result .badge { color: #10B981; border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.15); }
.history-tr.loss td.result .badge { color: #EF4444; border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.15); }
.history-tr.draw td.result .badge { color: #F59E0B; border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.15); }

/* Better table readability on dark */
.history.card .history-header .col { opacity: 0.85; }
.history.card .history-row .col.result { display: flex; align-items: center; }

/* On narrow screens, show all columns and rely on horizontal scrolling */

/* Enable sticky header only when the table can scroll horizontally */
@media (max-width: 1024px) {
    .history-table thead th { position: sticky; top: 0; z-index: 1; }
}
