/* =================================================================
   Game Arranger — stylesheet
   Theme: a green felt games table, warm wood, parchment scorepads
   ================================================================= */

:root {
    /* Colour tokens */
    --felt:        #1F4D3C;
    --felt-dark:   #14352A;
    --wood:        #8C5E3A;
    --wood-dark:   #6E4A2C;
    --parchment:   #F6EFE0;
    --paper:       #FBF7EF;
    --ink:         #232621;
    --accent:      #D1495B; /* dice red */
    --gold:        #E3B65C;
    --line:        #E2D7C0;
    --muted:       #8A8275;

    /* Type */
    --font-display: "Fraunces", "Georgia", serif;
    --font-body:    "Inter", system-ui, -apple-system, sans-serif;

    /* Layout */
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 14px rgba(35, 38, 33, 0.08);
    --shadow-lg: 0 12px 30px rgba(20, 53, 42, 0.16);
    --max-width: 1080px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--felt); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
    color: var(--felt-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* -----------------------------------------------------------------
   Layout helpers
   ----------------------------------------------------------------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page-body {
    min-height: calc(100vh - 64px);
    padding: 32px 0 64px;
}

.grid {
    display: grid;
    gap: 20px;
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.split {
    display: grid;
    gap: 32px;
    grid-template-columns: 280px 1fr;
    align-items: start;
}
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------
   Navigation
   ----------------------------------------------------------------- */
.navbar {
    background: var(--felt);
    color: var(--paper);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--paper);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--gold);
    display: inline-block;
}
.brand:hover { text-decoration: none; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-links a { color: var(--paper); opacity: 0.88; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.active { color: var(--gold); opacity: 1; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    background: var(--felt-dark);
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--paper);
    font-size: 1.6rem;
    cursor: pointer;
}

@media (max-width: 700px) {
    .nav-links {
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: var(--felt);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px 24px;
        gap: 14px;
        display: none;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
}

/* -----------------------------------------------------------------
   Hero
   ----------------------------------------------------------------- */
.hero {
    background: linear-gradient(160deg, var(--felt) 0%, var(--felt-dark) 100%);
    color: var(--paper);
    padding: 64px 0;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 320px; height: 320px;
    border: 60px solid rgba(227, 182, 92, 0.08);
    border-radius: 50%;
}
.hero h1 { color: var(--paper); }
.hero .lede {
    font-size: 1.15rem;
    max-width: 540px;
    color: rgba(251, 247, 239, 0.85);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* -----------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--gold);
    color: var(--felt-dark);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(227, 182, 92, 0.45); }

.btn-outline {
    background: transparent;
    border-color: rgba(251, 247, 239, 0.55);
    color: var(--paper);
}
.btn-outline:hover { border-color: var(--paper); }

.btn-felt {
    background: var(--felt);
    color: var(--paper);
}
.btn-felt:hover { box-shadow: var(--shadow-lg); }

.btn-danger {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}
.btn-danger:hover { background: var(--accent); color: var(--paper); }

.btn-small { padding: 6px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* -----------------------------------------------------------------
   Cards
   ----------------------------------------------------------------- */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    background: var(--felt);
    color: var(--paper);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
}
.tag.wood { background: var(--wood); }
.tag.outline {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

/* -----------------------------------------------------------------
   Forms
   ----------------------------------------------------------------- */
form .field { margin-bottom: 16px; }
label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--felt-dark);
}
input, textarea, select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--gold);
}
textarea { resize: vertical; min-height: 90px; }
.field-hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 500px) {
    .field-row { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------
   Alerts / messages
   ----------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error {
    background: #FBE7E9;
    border-color: #F1B6BD;
    color: #8E2A36;
}
.alert-success {
    background: #E6F0E8;
    border-color: #BFDBC6;
    color: var(--felt-dark);
}
.alert-info {
    background: #FBF1DC;
    border-color: #EBD8AC;
    color: #7A5A18;
}

/* -----------------------------------------------------------------
   Seat pips — the signature element
   Each reserved seat is a filled "pip" (like a die face), each open
   seat is a hollow pip.
   ----------------------------------------------------------------- */
.seat-pips {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
}
.pip {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    border: 2px solid var(--felt);
    background: transparent;
    flex-shrink: 0;
}
.pip.filled { background: var(--felt); }
.pip.full { border-color: var(--accent); }
.pip.full.filled { background: var(--accent); }

.seat-count {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--felt-dark);
    margin-left: 6px;
}
.seat-count.full { color: var(--accent); }

/* -----------------------------------------------------------------
   Game table list item
   ----------------------------------------------------------------- */
.table-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: var(--paper);
}
.table-item + .table-item { margin-top: 12px; }
.table-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.table-head h3 { margin-bottom: 2px; }
.table-meta {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 2px;
}
.table-players {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--ink);
}
.table-players .player-chip {
    display: inline-block;
    background: var(--parchment);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 10px;
    margin: 2px 4px 0 0;
    font-size: 0.8rem;
}
.table-actions { margin-top: 12px; }

/* -----------------------------------------------------------------
   Profile
   ----------------------------------------------------------------- */
.avatar-lg {
    width: 130px; height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--paper);
    box-shadow: var(--shadow-lg);
    background: var(--line);
}
.avatar-placeholder {
    width: 130px; height: 130px;
    border-radius: 50%;
    background: var(--felt);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    border: 4px solid var(--paper);
    box-shadow: var(--shadow-lg);
}

/* -----------------------------------------------------------------
   Member lists
   ----------------------------------------------------------------- */
.member-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: none; }
.member-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 50px; /* aligns under the name, leaving space for the avatar */
}
.member-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--line);
    flex-shrink: 0;
}
.member-avatar-placeholder {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--felt);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem;
    flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-info strong { display: block; font-size: 0.95rem; }
.member-info span { font-size: 0.82rem; color: var(--muted); }

/* -----------------------------------------------------------------
   Footer
   ----------------------------------------------------------------- */
footer {
    text-align: center;
    padding: 24px 0;
    color: var(--muted);
    font-size: 0.85rem;
}

/* -----------------------------------------------------------------
   Empty state
   ----------------------------------------------------------------- */
.empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
    font-size: 0.95rem;
}
