/* Palette: one place to retheme. Keep in step with COL in pongbot.js and :root in pongbot.css. */
:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --court: #f1f5f9;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --coral: #f2603c;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
}

a { color: var(--accent-dark); }

/* ---- header (mirrors ChatPort's: brand left, hamburger right) ---- */
.pb-nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.pb-nav-row {
    min-height: 56px;
    gap: 10px;
    padding: 0 32px;
    width: 100%;
}

.pb-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
}

.pb-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
}

.pb-bot { color: var(--accent); }

.pb-subtitle {
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 2px;
}

.pb-chip {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
}

.pb-register {
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pb-register:hover { background: var(--accent-dark); color: #fff; }

.pb-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    padding: 12px 18px;
    min-width: 180px;
}

.pb-menu .nav-link { color: var(--ink); }
.pb-menu .nav-link:hover { color: var(--accent-dark); }

@media (max-width: 480px) {
    .pb-nav-row { padding: 0 16px; }
    .pb-title { font-size: 1.45rem; }
    .pb-subtitle { font-size: .78rem; }
    .navbar-toggler { padding: .2rem .5rem; }
}

/* ---- home page ---- */
.pb-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 20px 12px;
    box-sizing: border-box;
}

.pb-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
    overflow: hidden;
}

/* "YOU" (blue paddle) and "BOT" (orange paddle), shown above the level buttons */
.pb-sides {
    display: flex;
    justify-content: center;
    gap: clamp(32px, 14vw, 72px);
    margin: 20px 0 0;
}

.pb-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 104px;
    height: 136px;
    border-radius: 52px 52px 46px 46px / 60px 60px 46px 46px;
    margin-bottom: 26px;
    color: #fff;
}

/* the paddle handle */
.pb-side::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 18px;
    height: 24px;
    transform: translateX(-50%);
    border-radius: 0 0 6px 6px;
    background: inherit;
}

.pb-side svg { width: 56px; height: 56px; fill: #fff; }
.pb-side span { margin-top: 4px; font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.pb-side-you { background: var(--accent); }
.pb-side-bot { background: var(--coral); }

.pb-card-body { padding: 20px 20px 22px; text-align: center; }
.pb-blurb { margin: 0 0 18px; font-size: 1.1rem; font-weight: 600; }
.pb-blurb-top { margin: 24px 20px 0; text-align: center; }
.pb-headline {
    margin: 26px 20px 0;
    text-align: center;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
    color: var(--ink);
}
.pb-headline-bot { color: var(--accent); }
.pb-headline-sub {
    display: block;
    margin-top: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--muted);
}
@media (max-width: 480px) {
    .pb-headline { font-size: 2rem; }
    .pb-headline-sub { font-size: 1rem; }
}

.pb-choose {
    margin: 0 0 12px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.pb-levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Chunky arcade buttons: a solid "edge" underneath that squashes flat when pressed */
.pb-levels { margin-bottom: 6px; }

.pb-levels a {
    --lv: #22c55e;
    --lv-dark: #15803d;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 16px 4px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--lv) 80%, #fff) 0%, var(--lv) 55%);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: .06em;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
    box-shadow: 0 6px 0 var(--lv-dark), 0 12px 18px rgba(15, 23, 42, .22);
    touch-action: manipulation;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.pb-levels a::before {   /* glossy highlight */
    content: "";
    position: absolute;
    inset: 4px 8px auto 8px;
    height: 38%;
    border-radius: 12px 12px 20px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.pb-levels a.lv-medium { --lv: #f59e0b; --lv-dark: #b45309; }
.pb-levels a.lv-brutal { --lv: #ef4444; --lv-dark: #b91c1c; }

.pb-lv-pts { font-size: .85rem; letter-spacing: .12em; color: #fff7c2; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }

.pb-levels a:hover {
    transform: translateY(-3px) rotate(-1.5deg);
    filter: brightness(1.06);
    box-shadow: 0 9px 0 var(--lv-dark), 0 16px 22px rgba(15, 23, 42, .24);
}
.pb-levels a.lv-medium:hover { transform: translateY(-3px) rotate(1.5deg); }

.pb-levels a:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 var(--lv-dark), 0 3px 6px rgba(15, 23, 42, .2);
}

@media (prefers-reduced-motion: reduce) {
    .pb-levels a, .pb-levels a:hover, .pb-levels a:active { transition: none; }
    .pb-levels a:hover, .pb-levels a.lv-medium:hover { transform: none; }
}

.pb-record { margin: 14px 0 0; font-size: .85rem; color: var(--muted); min-height: 1em; }

.pb-modal .modal-content {
    background: var(--card);
    color: var(--ink);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, .25);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
}

.pb-modal .modal-header { border-bottom: 1px solid var(--line); }
.pb-modal .modal-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.pb-modal ul { margin: 0; padding-left: 1.1rem; line-height: 1.6; }
.pb-modal li + li { margin-top: 6px; }

/* Footer: thin light rule, small ClarkApps mark beside one centred line (same as WebShare) */
.pb-footer {
    margin: 2rem 0 1rem;
    text-align: center;
    border-top: 1px solid #e8eaed;
}

.footer-company {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 10px;
    text-align: center;
}

.footer-company-logo {
    height: 32px;
    width: auto;
    display: block;
    margin: 0;
}

.footer-company-line {
    display: block;
    color: #777;
    line-height: 1.5;
}

.footer-company-line a {
    color: #0066cc;
    text-decoration: none;
}

.footer-company-line a:hover { text-decoration: underline; }

.pb-note { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }

/* ---- register / account ---- */
.pb-form-card { max-width: 440px; margin: 0 auto; }
.pb-form-card .pb-card-body { text-align: left; }
.pb-form-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.pb-form-sub { margin: 0 0 18px; color: var(--muted); font-size: .95rem; }

/* Leaderboard heading: gradient bold left-aligned title, small subline */
.pb-board-head { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }

.pb-board-title { margin: 0; font-size: 1.7rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.pb-board-sub { margin: 4px 0 0; font-size: .82rem; font-weight: 600; color: var(--muted); }

.pb-card-body form + form { margin-top: 22px; }

.pb-card-body label {
    display: block;
    margin: 0 0 6px;
    font-size: .85rem;
    font-weight: 600;
}

.pb-card-body input[type="text"],
.pb-card-body input[type="email"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

.pb-card-body input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.cf-turnstile { margin: 0 0 16px; min-height: 65px; }

.pb-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .9rem;
}

.pb-button {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.pb-button:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.pb-button:disabled { opacity: .6; cursor: default; }
.pb-button-link { text-align: center; text-decoration: none; box-sizing: border-box; }
a.pb-button-link:hover { color: #fff; }
a.pb-button-link.pb-button-outline:hover { color: #fff; }
.pb-button-outline { background: #fff; color: var(--accent-dark); }
.pb-button-outline:hover:not(:disabled) { background: var(--accent); color: #fff; }
.pb-button-danger { background: #fff; border-color: #dc2626; color: #b91c1c; }
.pb-button-danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; color: #fff; }

@media (max-width: 480px) {
    .pb-chip { max-width: 7.5rem; padding: 5px 10px; font-size: .82rem; }
    .pb-register { padding: 6px 12px; font-size: .85rem; }
}

/* ---- leaderboard ---- */
.pb-board-card { margin-top: 20px; scroll-margin-top: 12px; }
.pb-board-card .pb-card-body { text-align: left; }
.pb-board { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: 0 0 4px; }
.pb-board th { padding: 0 12px 2px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; }
.pb-board td { padding: 12px; background: #f8fafc; font-weight: 700; }
.pb-board td:first-child { border-radius: 12px 0 0 12px; }
.pb-board td:last-child { border-radius: 0 12px 12px 0; }
.pb-board tr:nth-child(-n+3) td { background: linear-gradient(90deg, #fffbeb, #f8fafc); }
.pb-board .rk { width: 2.6rem; text-align: center; }
.pb-board .lv { color: var(--muted); font-size: .85rem; }
.pb-board .num { text-align: right; width: 4.2rem; font-variant-numeric: tabular-nums; }
.pb-board tr.you td { background: #dbeafe; color: var(--accent-dark); }
.pb-board tr.you td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.pb-board tr.gap td { text-align: center; color: var(--muted); padding: 0; background: none; }
