:root {
    --bg: #0f1020;
    --card: #191a2e;
    --line: #2b2d4a;
    --text: #ececf5;
    --muted: #9a9cb8;
    --accent: #7c5cff;
    --shame: #ff4d6d;
    --real: #2ed3a3;
    --gold: #ffcc4d;
    color-scheme: dark;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(circle at 20% 0%, #1d1840 0, var(--bg) 45%) fixed;
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans Myanmar", sans-serif;
}
a { color: #b9a8ff; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; margin-top: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(15,16,32,.85); position: sticky; top: 0; z-index: 2; backdrop-filter: blur(6px); }
.brand { font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.top nav a, .link { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.top nav a.on, .top nav a:hover { color: var(--text); background: var(--line); }
.top form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 32px auto; }
.flash { background: #1e3a33; border: 1px solid var(--real); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.flash--bad { background: #3a1e27; border-color: var(--shame); }

label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
.hint { font-size: .78rem; }
input, select, textarea { font: inherit; color: var(--text); background: #11122a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
input[type=checkbox] { width: auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.checkin { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.checkin .grow { flex: 1 1 200px; }
.checkin .num { width: 80px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { min-width: 0; }

.btn { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--accent); color: white; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn--small { padding: 6px 10px; font-size: .85rem; }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.link { background: none; border: 0; cursor: pointer; font: inherit; }
.danger { color: var(--shame); }

.roast { background: linear-gradient(135deg, #3a1027, #2a0f2f); border: 1px solid var(--shame); border-radius: 14px; padding: 16px; margin-bottom: 16px; text-align: center; }
.roast__badge { font-size: 1.3rem; font-weight: 800; color: var(--shame); }
.roast p { margin: 8px 0 0; font-size: 1.05rem; }
.roast__line { font-style: italic; color: #ffb3c1; }
.respect { background: #10302a; border: 1px solid var(--real); border-radius: 14px; padding: 14px; margin-bottom: 16px; text-align: center; font-weight: 700; color: var(--real); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filters select { width: auto; }
.tabs { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.filters .tabs { margin: 0; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.tabs a.on { background: var(--accent); color: white; }

.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.award { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.award__emoji { font-size: 2rem; }
.award__title { font-size: .8rem; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.award__who { display: block; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; margin: 4px 0; }

.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board li.me { background: rgba(124,92,255,.08); border-radius: 10px; }
.rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.board li:first-child .rank { color: var(--gold); }
.who { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.who a { color: var(--text); font-weight: 700; text-decoration: none; }
.who .small { flex-basis: 100%; }
.time { font-weight: 800; font-variant-numeric: tabular-nums; }
.tag { font-size: .75rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.tag--shame { background: rgba(255,77,109,.15); color: var(--shame); }
.tag--real { background: rgba(46,211,163,.15); color: var(--real); }

.stat { font-size: 1.8rem; font-weight: 800; margin: 8px 0 12px; }
.bar { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; margin: 8px 0; font-size: .9rem; }
.bar__track { background: #11122a; border-radius: 999px; height: 12px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar__fill--mlbb { background: var(--shame); }
.bar__value { text-align: right; font-variant-numeric: tabular-nums; }
.log { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.log:first-of-type { border-top: 0; }
.log form { margin: 0; }
.grow { flex: 1; }
.code { background: #11122a; border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; font-size: 1.1rem; }

@media (max-width: 520px) {
    .bar { grid-template-columns: 90px 1fr 60px; }
    .top { justify-content: center; }
}

/* Photos, logos and fake votes */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.avatar--blank { background: linear-gradient(135deg, var(--accent), #4b2fd1); color: white; font-weight: 800; }
.glogo { border-radius: 8px; object-fit: contain; background: #0b0c1c; flex: none; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.glogo--blank { color: var(--muted); font-weight: 800; border: 1px solid var(--line); }
.award .avatar { margin: 4px auto 0; }
.me-link { display: inline-flex; align-items: center; gap: 6px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.profile-head h1 { margin: 0; }
.photo-row { display: flex; align-items: center; gap: 16px; margin: 12px 0 20px; }
.photo-row label.btn { display: inline-block; color: white; font-size: .85rem; }
.logo-pick label { cursor: pointer; display: inline-flex; }
.bar__label { display: flex; align-items: center; gap: 6px; }
.vote { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.vote:hover { border-color: var(--shame); color: var(--shame); }
.vote--on { background: rgba(255,77,109,.15); border-color: var(--shame); color: var(--shame); }
.log--out .grow, .log--out .time { text-decoration: line-through; opacity: .55; }

/* Reports */
.snitch summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.snitch summary::-webkit-details-marker { display: none; }
.snitch summary h2 { margin: 0; }
.snitch[open] summary { margin-bottom: 12px; }
.vote--yes:hover, .vote--yes.vote--on { border-color: var(--real); color: var(--real); background: rgba(46,211,163,.12); }
.tag--spy { background: rgba(255,204,77,.14); color: var(--gold); }

/* Grass, ranks, reactions */
.btn--grass { background: #1f9d6f; }
.tag--cave { background: rgba(154,156,184,.15); color: #c9cbe0; }
.tag--rank { background: rgba(124,92,255,.15); color: #b9a8ff; }
.reacts { display: inline-flex; gap: 2px; }
.reacts form { margin: 0; }
.react { font: inherit; font-size: .8rem; border: 1px solid transparent; background: transparent; border-radius: 999px; padding: 2px 6px; cursor: pointer; opacity: .55; color: var(--text); }
.react:hover { opacity: 1; border-color: var(--line); }
.react--on { opacity: 1; background: rgba(124,92,255,.15); border-color: var(--accent); }
.big-card { text-align: center; padding: 28px 18px; background: linear-gradient(160deg, #2a1d63, #191a2e 60%); }
.big-number { font-size: 3.2rem; font-weight: 900; line-height: 1; margin: 6px 0; }
.wrap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.wrap-grid div { background: rgba(0,0,0,.2); border-radius: 12px; padding: 12px; }
.wrap-grid strong { display: block; font-size: 1.3rem; }
.side-list { font-size: .85rem; }
.log--stack > .grow { flex-basis: 100%; }

/* Phone app bar */
.tabbar { display: none; }
.menu-card { display: none; padding: 4px 0; }
.menu-card a, .menu-card__out { display: flex; justify-content: space-between; align-items: center; width: 100%;
    padding: 14px 16px; color: var(--text); text-decoration: none; font: inherit; font-weight: 600;
    background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; text-align: left; }
.menu-card > a:first-child { border-top: 0; }
.menu-card a span { color: var(--muted); font-size: 1.2rem; }
.menu-card__out { color: var(--shame); }
.menu-card form { margin: 0; }
#checkin { scroll-margin-top: 16px; }
#checkin:target { outline: 2px solid var(--accent); }

@media (max-width: 720px) {
    .top nav { display: none; }
    .top { position: static; }
    main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .menu-card { display: block; }
    .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
        justify-content: space-around; align-items: flex-end;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        background: rgba(17,18,40,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
    .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; padding: 4px 0; }
    .tabbar a.on { color: var(--text); }
    .tabbar a.on .tabbar__icon { transform: translateY(-1px); filter: drop-shadow(0 0 6px rgba(124,92,255,.7)); }
    .tabbar__icon { font-size: 1.35rem; line-height: 1; height: 26px; display: flex; align-items: center; }
    .tabbar__plus { flex: 0 0 auto !important; }
    .tabbar__plus span { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px;
        margin-top: -22px; border-radius: 50%; background: var(--accent); color: white; font-size: 1.9rem; font-weight: 700;
        box-shadow: 0 6px 18px rgba(124,92,255,.5); border: 4px solid var(--bg); }
}

/* The phone's ＋ screen */
.tabs--wide { display: flex; width: 100%; }
.tabs--wide a { flex: 1; text-align: center; }
.tabbar__plus.on span { background: #9b80ff; }
@media (max-width: 720px) {
    .desktop-only { display: none; }
    /* Big, thumb-sized controls on the check-in screen. */
    .checkin input, .checkin select { font-size: 16px; padding: 12px; }
    .checkin .btn { width: 100%; padding: 14px; font-size: 1.05rem; }
    .checkin label.grow { flex-basis: 100%; }
}
