:root {
    --burgundy: #74182c;
    --burgundy-dark: #4a1020;
    --gold: #b58b3b;
    --cream: #fff8e7;
    --paper: #fffdfa;
    --ink: #30231f;
    --muted: #77665f;
    --line: #e9decb;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--cream);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        radial-gradient(ellipse at top, #fffdfa, transparent 60%),
        #f8f3e9;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
}

header {
    padding: 26px 18px;
    text-align: center;
    background: linear-gradient(
        135deg, var(--burgundy-dark), var(--burgundy)
    );
    color: white;
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 4px 18px #4a10201a;
}

.lbms-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 14px;
}

.lbms-brand img {
    display: block;
    width: min(280px, 80vw);
    max-height: 180px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border: 1px solid #e5c783;
    border-radius: 14px;
    box-shadow: 0 6px 22px #0002;
}

header h1 {
    color: white;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 650;
    margin: 5px 0;
    letter-spacing: -.5px;
}

header p {
    color: #f4dca6;
    margin: 4px 0;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 20px;
}

h2, h3 {
    color: var(--burgundy);
    line-height: 1.3;
}

.card, .tile, .menu-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 5px 20px #4a102008;
    margin-bottom: 16px;
}

.grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

a {
    color: var(--burgundy);
    text-underline-offset: 4px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

nav a, nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 9px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: white;
    color: var(--burgundy);
    font-weight: 600;
}

button, .button, .btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 13px 20px;
    background: var(--burgundy);
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

button:hover, .button:hover, .btn:hover {
    background: var(--burgundy-dark);
    color: white;
    box-shadow: 0 3px 12px #74182c25;
}

button:disabled {
    opacity: .55;
    cursor: wait;
}

button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

form {
    display: grid;
    gap: 12px;
}

form label {
    font-weight: 600;
    color: var(--burgundy);
}

input, select, textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d9c8ac;
    border-radius: 10px;
    background: white;
    color: var(--ink);
    font: inherit;
}

.auth-main {
    max-width: 520px;
    padding-top: 30px;
}

.auth-main .card {
    padding: 28px;
    border-top: 4px solid var(--gold);
}

#message {
    color: var(--burgundy);
    font-weight: 500;
}

#account-status {
    color: var(--muted);
}

[hidden] {
    display: none !important;
}

.lbms-developer-credit {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 17px 12px;
    color: #f4dca6;
    background: var(--burgundy-dark);
    border-top: 3px solid var(--gold);
    font-size: 12px;
    letter-spacing: .2px;
}

.lbms-developer-credit strong {
    color: white;
    font-weight: 600;
}

body.lbms-tv header {
    padding: 12px;
}

body.lbms-tv .lbms-brand img {
    max-height: 95px;
    width: auto;
    max-width: 240px;
}

body.lbms-tv main {
    max-width: none;
    padding: 20px 30px;
}

@media (max-width: 600px) {
    header { padding: 20px 12px; }
    main { padding: 18px 14px; }
    .card { padding: 18px; }
    .grid { grid-template-columns: 1fr; }
    .auth-main .card { padding: 22px; }
    input, select, textarea { font-size: 16px; }
    nav a, nav button { min-height: 44px; }
}

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