/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Core palette */
    --color-brown-dark: #4a2c0e;
    --color-brown-medium: #6b3a0f;
    --color-brown-light: #8a5c2e;
    --color-gold: #d4a017;
    --color-gold-dark: #b8860b;
    --color-gold-muted: #c8a870;
    --color-gold-light: #f0d090;
    --color-gold-pale: #a07840;
    --color-red: #b91c1c;
    --color-red-dark: #991b1b;
    --color-green: #2d7a2d;
    --color-green-dark: #256025;
    --color-blue: #4b7ca8;
    --color-cream: #f7e7ce;
    --color-cream-dark: #f5d7b2;
    --color-bg-modal: #fff8ef;
    --color-bg-card: #fdf6e3;
    --color-purple: #9333ea;
    --color-purple-dark: #7c3aed;
    --color-purple-light: #a855f7;
    --color-white: #fff;

    /* ── Semantic Theme Tokens ─────────────────────────────── */
    --theme-bg-start: var(--color-cream);
    --theme-bg-end: var(--color-cream-dark);
    --theme-text-primary: var(--color-brown-dark);
    --theme-text-secondary: var(--color-brown-medium);
    --theme-text-muted: var(--color-brown-light);
    --theme-accent: var(--color-gold);
    --theme-accent-hover: var(--color-gold-dark);
    --theme-accent-muted: var(--color-gold-muted);
    --theme-accent-light: var(--color-gold-light);
    --theme-surface: rgba(255, 255, 255, 0.7);
    --theme-surface-solid: #fff8ef;
    --theme-surface-card: #fdf6e3;
    --theme-border: var(--color-gold);
    --theme-border-muted: #ccc;
    --theme-input-bg: #fff;
    --theme-focus-ring: var(--color-brown-medium);
    --theme-header-bg: rgba(74,44,14,0.08);
    --theme-link: var(--color-brown-medium);
    --theme-link-hover: var(--color-gold-dark);
    --theme-btn-bg: var(--color-gold);
    --theme-btn-text: #fff;
    --theme-btn-hover: var(--color-gold-dark);
    --theme-spinner: var(--color-gold);
    --theme-bartender-border: var(--color-gold);
    --theme-bartender-bg: #fffbe6;
    --theme-meta-color: #4a2c0e;

    /* Game board semantic tokens */
    --theme-board-bg: linear-gradient(160deg, #2c1a0e 0%, #3d2410 40%, #2a1608 100%);
    --theme-board-text: #e8d5a8;
    --theme-board-border: rgba(212,160,23,0.25);
    --theme-stats-bg: rgba(44,26,14,0.92);
    --theme-stats-text: #f4e8c1;
    --theme-stats-accent: #d4a017;
    --theme-player-active-start: #1a5c1a;
    --theme-player-active-end: #2d8a2d;
    --theme-player-waiting-start: #5a3010;
    --theme-player-waiting-end: #7a4820;
    --theme-card-bg-start: #fffdf8;
    --theme-card-bg-end: #f5e8c8;
    --theme-card-border: rgba(212,160,23,0.35);
    --theme-card-text: #2a1606;
    --theme-gold-text: #f5d07a;
    --theme-gold-accent: #d4a850;

    /* Player sheet tokens */
    --theme-sheet-area-bg: rgba(247,231,206,0.45);
    --theme-sheet-bg: rgba(255,255,255,0.65);
    --theme-sheet-border: rgba(180,130,40,0.3);
    --theme-sheet-shadow: rgba(74,44,14,0.12);

    /* RGB component tokens (for rgba() with varying opacity) */
    --theme-shadow-rgb: 74,44,14;
    --theme-accent-rgb: 212,160,23;
    --theme-border-accent-rgb: 180,130,40;
    --theme-cream-rgb: 247,231,206;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-pill: 9999px;
}

/* * {border:1px solid red} */
body {
    font-family: 'Georgia', serif;
    margin: 0;
    text-align: center;
    background: linear-gradient(to bottom, var(--theme-bg-start), var(--theme-bg-end));
    color: var(--theme-text-primary);
    min-height: 100vh;
    background-attachment: fixed;
}
.page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
    display: none !important;
}

header, footer {
    font-size: 0.75em;
}

footer {
    height: 20px;
}


header {
  display: flex;
  flex-direction: row;
}

main {
  flex: 1
}

.user-header {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 600px) {
    .user-header {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
        padding: 10px 8px 0;
        font-size: 0.95em;
    }
}

#helloUser {
    display: inline;
}

.game-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    margin-left: 4px;
}

.bartender-image {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    border: 4px solid var(--theme-bartender-border);
    background: var(--theme-bartender-bg);
}

main .bartender-image {
    margin: 30px auto 20px auto;
    width: 120px;
    height: 120px;
}

header .bartender-image {
    width: 40px;
    height: 40px;
    margin: 4px 0 0 4px;
}

header a {
    color: var(--theme-link);
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}

h1 {
    color: var(--theme-text-secondary);
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

p {
    font-size: 1.2em;
    margin-bottom: 20px;
    font-style: italic;
}

ul {
    list-style-type: none;
    text-align: left;
    display: block;
    margin: 20px auto;
    padding: 15px;
    max-width: 600px;
    background: var(--theme-surface);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    margin: 10px 0;
    font-size: 1.1em;
    border-left: 3px solid var(--theme-border);
    padding-left: 10px;
}

.game-info {
    flex: 1;
    min-width: 0;
}

.game-title {
    font-weight: bold;
    color: var(--theme-text-primary);
    margin-bottom: 2px;
}

.game-players {
    font-size: 0.9em;
    color: var(--theme-text-secondary);
    margin-bottom: 2px;
}

.game-status {
    font-size: 0.8em;
    font-style: italic;
    color: var(--theme-text-muted);
    opacity: 0.85;
}

.game-action {
    flex-shrink: 0;
}

.game-action button {
    display: inline-block;
    margin: 0;
}

button {
    display: block;
    margin: 20px auto;
    padding: 12px 25px;
    font-size: 1.1em;
    background: var(--theme-btn-bg);
    color: var(--theme-btn-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:hover {
    background: var(--theme-btn-hover);
    transform: scale(1.05);
}
    
button:focus {
    outline: 3px solid var(--theme-focus-ring);
    outline-offset: 2px;
}

form {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--theme-text-primary);
}

input {
    width: 80%;
    padding: 8px;
    margin: 0 auto 15px;
    display: block;
    border: 1px solid var(--theme-border-muted);
    border-radius: 5px;
    font-size: 1em;
}

#login-form, #register-form {
    display: inline-block;
    width: 45%;
    vertical-align: top;
    margin: 10px;
}

#message {
    text-align: center;
    margin-top: 20px;
    color: var(--theme-accent);
    font-weight: bold;
}

.table {
    display: flex;
}

.playerSheet {
    border: black
}

.error-msg {
    color: var(--color-red);
    font-weight: bold;
    padding: 8px;
    text-align: center;
}

.remove-player-btn {
    display: inline;
    margin: 0 0 0 6px;
    padding: 2px 8px;
    font-size: 0.8em;
    background: var(--color-red);
}

.remove-player-btn:hover {
    background: var(--color-red-dark);
}

.player-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
}

.loading-placeholder {
    justify-content: center;
    border-left: none;
    font-style: italic;
    color: var(--theme-text-muted);
    opacity: 0.8;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--theme-spinner);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.game-section > h2 {
    max-width: 630px;
    margin: 16px auto 0;
    text-align: left;
    font-size: 1.2em;
    color: var(--theme-text-secondary);
    padding-left: 5px;
    font-style: normal;
}

/* Status filter tabs */
.status-filter {
    max-width: 630px;
    margin: 8px auto 0;
    display: flex;
    gap: 4px;
    padding-left: 5px;
}

.filter-tab {
    display: inline-block;
    margin: 0;
    padding: 6px 16px;
    font-size: 0.85em;
    background: transparent;
    color: var(--theme-text-muted);
    border: 1px solid var(--theme-accent-muted);
    border-radius: var(--radius-pill);
    box-shadow: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.filter-tab:hover {
    background: var(--theme-accent-light);
    color: var(--theme-text-primary);
    transform: none;
}

.filter-tab.active {
    background: var(--theme-accent);
    color: var(--theme-btn-text);
    border-color: var(--theme-accent);
    font-weight: bold;
}

.game-section-empty {
    justify-content: center;
    border-left: none;
    font-style: italic;
    color: var(--theme-text-muted);
    opacity: 0.8;
}

.load-more-item {
    justify-content: center;
    border-left: none;
}

.load-more-btn {
    display: inline-block;
    margin: 2px auto;
    padding: 6px 20px;
    font-size: 0.9em;
    background: var(--theme-text-muted);
    box-shadow: none;
}

.load-more-btn:hover {
    background: var(--theme-text-secondary);
}

.game-full-label {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.85em;
    font-style: italic;
    color: var(--theme-text-secondary);
    opacity: 0.7;
}

/* Turn indicator on game cards */
.game-turn {
    font-size: 0.8em;
    color: var(--theme-text-muted);
    font-style: italic;
}

.game-turn.my-turn {
    color: var(--color-green);
    font-weight: bold;
    font-style: normal;
}

/* Notification bell */
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-secondary);
    text-decoration: none;
    cursor: pointer;
    padding: 4px;
    margin-right: 8px;
}

.notif-bell:hover {
    color: var(--theme-link-hover);
    text-decoration: none;
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 0.6rem;
    font-weight: bold;
    font-style: normal;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-sizing: border-box;
}
