/* Bezique: a card table. Deep green baize, brass trim, navy-and-gold card backs. */

:root {
    --felt: #0f5132;
    --felt-dark: #083a23;
    --felt-edge: #052416;
    --panel: rgba(3, 26, 15, 0.62);
    --panel-line: rgba(233, 199, 122, 0.28);
    --brass: #e9c77a;
    --brass-strong: #f3d894;
    --ink: #f4f1e8;
    --muted: #b9cbbf;
    --danger-bg: #5a1a14;
    --card-w: clamp(54px, 10.5vw, 96px);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.07), transparent 60%),
        radial-gradient(ellipse at 50% 120%, var(--felt-edge), transparent 70%),
        linear-gradient(180deg, var(--felt), var(--felt-dark));
    background-color: var(--felt-dark);
    background-attachment: fixed;
}

a { color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--brass-strong); }

:focus-visible { outline: 3px solid var(--brass-strong); outline-offset: 2px; }

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Top bar -------------------------------------------------------------- */

.bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--panel-line);
    background: rgba(2, 20, 11, 0.55);
    font-size: 15px;
}
.bar .back { color: var(--muted); text-decoration: none; white-space: nowrap; flex: 1; }
.bar .back:hover { color: var(--ink); }
.bar .title {
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: 0.06em;
    color: var(--brass);
    text-align: center;
    margin: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bar .who { color: var(--muted); white-space: nowrap; text-align: right; flex: 1; }
.bar .who strong { color: var(--ink); font-weight: 600; }

@media (max-width: 520px) {
    .bar .back .long { display: none; }
}

/* --- Buttons -------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    font-size: 16px;
    padding: 11px 20px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.button:active:not([disabled]) { transform: translateY(1px); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }

.button.primary { background: var(--brass); color: #1f1606; box-shadow: 0 2px 0 #9d7f3c; }
.button.primary:hover:not([disabled]) { background: var(--brass-strong); color: #1f1606; }

.button.secondary { background: rgba(0, 0, 0, 0.15); color: var(--ink); border-color: var(--panel-line); }
.button.secondary:hover:not([disabled]) { border-color: var(--brass); color: var(--brass-strong); }

.button.small { font-size: 14px; padding: 7px 14px; }

/* --- Panels and messages -------------------------------------------------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    padding: 20px;
}

.center-panel { max-width: 460px; margin: 48px auto; text-align: center; }
.center-panel h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 8px; }
.center-panel p { color: var(--muted); margin: 0 0 20px; }

/* Errors and notices slide up from the bottom and go away by themselves. */
.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 20px);
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 6px;
    background: var(--danger-bg);
    color: #fff;
    border: 1px solid rgba(255, 180, 168, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.info { background: #173d2a; border-color: var(--panel-line); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
