:root {
    --bg: #101210;
    --surface: #1a1e19;
    --surface-alt: #23291f;
    --ink: #eee9d8;
    --ink-soft: #a6ad9b;
    --line: #3a4432;
    --accent: #c4ef63;
    --accent-dark: #daff88;
    --green: #c4ef63;
    --amber: #edbd70;
    --header: #101210;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(31, 27, 22, 0.06), 0 6px 18px rgba(31, 27, 22, 0.05);
    --maxw: 880px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.75rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--header); color: #f0ece6; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: #cfc7bd; padding: 6px 10px; border-radius: 4px; font-size: 0.94rem; }
.nav a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; text-decoration: none; }
.whoami { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #e7e1d8; }
.link-muted { color: #9b938a; font-size: 0.82rem; }

main { padding: 24px 0 48px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card.flat { box-shadow: none; }
.card h2 { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .grid.two { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--surface); border-color: #78473b; color: var(--accent-dark); }
.btn-small { padding: 5px 10px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="file"], textarea, select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    font: inherit;
    color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > .field { margin-bottom: 0; flex: 1; min-width: 140px; }

/* Badges + pills */
.badge { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.alive { background: #293720; color: var(--green); }
.badge.dead { background: #362522; color: #ffa08d; }
.badge.setup { background: #382e1e; color: var(--amber); }
.badge.active { background: #293720; color: var(--green); }
.badge.finished { background: #32293d; color: #d5b4f2; }
.badge.admin { background: #223039; color: #a9cfe4; }

/* Contract */
.contract { background: linear-gradient(135deg, #2a2521, #3a322c); color: #f5efe7; border: none; }
.contract h2 { color: #fff; }
.contract .weapon { font-size: 1.35rem; font-weight: 700; color: #ffd9a8; }
.contract .place { font-size: 1.35rem; font-weight: 700; color: #a8e0c0; }
.contract .muted { color: #bdb4a9; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.message { padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; border: 1px solid var(--line); background: var(--surface); }
.message.success { background: #263420; border-color: #536e3d; }
.message.error { background: #352420; border-color: #78473b; }
.message.warning { background: #332c1f; border-color: #75603a; }
.message.info { background: #222f38; border-color: #425c6b; }

/* Feed */
.feed-list { list-style: none; padding: 0; margin: 0; }
.feed-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-item.pinned { background: #30291c; border-radius: 4px; padding: 12px; }
.feed-meta { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; }
.feed-body { white-space: pre-wrap; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.photo-grid img { width: 100%; height: 150px; object-fit: cover; display: block; cursor: zoom-in; }
.photo-grid figcaption { padding: 6px 9px; font-size: 0.8rem; color: var(--ink-soft); }
.lightbox { position: fixed; inset: 0; background: rgba(15, 13, 11, 0.92); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 4px; }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 2rem; background: none; border: none; cursor: pointer; }

/* Lists */
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.plain li:last-child { border-bottom: none; }
.tag { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 3px; padding: 2px 10px; font-size: 0.8rem; }

.site-footer { padding: 24px 0 40px; color: var(--ink-soft); font-size: 0.82rem; text-align: center; }

.empty { color: var(--ink-soft); font-style: italic; }

/* After-hours arcade: phosphor green, amber, and dark dossier panels. */
:root {
    --bg: #101210;
    --surface: #191e19;
    --surface-alt: #252d22;
    --ink: #eee9d8;
    --ink-soft: #a6ad9b;
    --line: #3a4432;
    --accent: #c4ef63;
    --accent-dark: #daff88;
    --green: #c4ef63;
    --radius: 6px;
    --shadow: 0 3px 14px #00000040;
    --maxw: 1080px;
}
body {
    font-family: "Courier New", Courier, monospace;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 50% 0, #c4ef6309, transparent 65%),
        repeating-linear-gradient(0deg, transparent, transparent 3px, #00000018 3px, #00000018 4px);
}
::selection { background: #c4ef63; color: #101210; }
body, input, textarea { overflow-wrap: anywhere; }
h1, h2 { letter-spacing: .015em; }
h1 { text-transform: uppercase; text-shadow: 3px 3px 0 #53663a; }
h1 { font-family: Impact, "Arial Black", sans-serif; font-size: clamp(2.15rem, 5vw, 3.4rem); font-weight: 500; line-height: 1.12; }
h2 { font-size: 1.22rem; margin-bottom: 12px; }
h3 { margin-bottom: 16px; }
a, button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #edbd70; outline-offset: 4px; }
.container { padding-inline: 24px; }
.icon { flex-shrink: 0; }
.site-header { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 86px; gap: 30px; flex-wrap: nowrap; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 7px; font-size: 1.22rem; letter-spacing: -.05em; white-space: nowrap; }
.brand-game { font-weight: 400; margin-left: -5px; color: var(--accent); }
.brand-mark { transform: rotate(-6deg); display: grid; place-items: center; width: 34px; height: 34px; color: #101210; background: var(--accent); border-radius: 4px; font-size: 1.5rem; margin-right: 5px; }
.nav { justify-content: center; gap: 3px; flex-wrap: nowrap; }
.nav a { color: var(--ink-soft); padding: 10px; font-size: .8rem; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.nav .icon { width: 18px; height: 18px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-dark); background: #303c24; text-decoration: none; }
.whoami { color: var(--ink); min-width: 0; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: #332b20; color: #edbd70; width: 36px; height: 36px; flex-shrink: 0; font-weight: 700; }
.player-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
main.container { padding-top: 38px; padding-bottom: 28px; }
.eyebrow { display: block; font-size: .65rem; letter-spacing: .17em; font-weight: 750; margin-bottom: 12px; color: var(--ink-soft); }
.dashboard-heading, .page-heading { margin-bottom: 26px; }
.dashboard-heading p { margin-top: 14px; }
.page-heading + .row { margin-bottom: 18px; }
.card { padding: 25px; margin-bottom: 20px; }
.grid { gap: 20px; }
.grid > .card { margin-bottom: 0; }
.grid + .row { margin-top: 20px; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 25px; }
.quick-links a { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); padding: 18px; border-radius: 4px; color: var(--ink); font-weight: 650; font-size: .9rem; transition: background .15s; }
.quick-links a:hover { text-decoration: none; background: #252e20; }
.quick-links a > .icon { width: 38px; height: 38px; padding: 8px; border-radius: 4px; background: #2b3423; }
.quick-links small { display: block; font-size: .7rem; color: var(--ink-soft); font-weight: 400; }
.quick-links a > span:last-child { margin-left: auto; color: var(--ink-soft); }
.hunt-intro { position: relative; background: #1f281b; border-color: #53663a; padding: 30px; }
.hunt-intro h2 { font-family: Impact, "Arial Black", sans-serif; font-size: 2rem; font-weight: 500; }
.hunt-intro > p { max-width: 620px; }
.invite-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid #465435; }
.invite-box input { font-size: .8rem; background: #141a12; }
.invite-box strong { letter-spacing: .17em; color: var(--ink); }
.btn { min-height: 46px; border-radius: 4px; padding: 10px 17px; font-size: .88rem; gap: 12px; transition: background .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #141a10; box-shadow: 3px 3px 0 #53663a; }
.btn-danger { color: #ffa08d; border-color: #78473b; }
.btn-small { min-height: 44px; padding: 8px 13px; font-size: .8rem; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input[type="file"], textarea, select { min-height: 48px; border-radius: 4px; padding: 12px 14px; font-size: 16px; background: var(--surface); }
input::placeholder, textarea::placeholder { color: #959d8b; }
input[type="file"] { padding: 9px; font-size: .85rem; }
input::file-selector-button { background: var(--surface-alt); border: 0; border-radius: 4px; padding: 7px 10px; color: var(--ink); margin-right: 8px; }
textarea { min-height: 115px; }
label { font-size: .8rem; margin-bottom: 7px; }
.field { margin-bottom: 18px; }
.inline-form { gap: 12px; }
.badge { font-size: .63rem; letter-spacing: .07em; padding: 4px 9px; vertical-align: middle; }
.badge.setup { background: #382e1e; color: #edbd70; }
.contract { background: linear-gradient(135deg, #202a1a, #141c14); padding: 30px; border: 1px solid #637b43; border-top: 4px solid var(--accent); box-shadow: 5px 5px 0 #080c08; }
.contract h2 { font-family: Impact, "Arial Black", sans-serif; font-size: 2rem; font-weight: 400; }
.contract .muted { color: #b1bda4; }
.contract > p:not(.small) { padding-block: 12px; border-bottom: 1px solid #1a1e1924; }
.contract .weapon, .contract .place { font-size: 1.45rem; color: #c4ef63; }
.contract .btn-primary { background: #c4ef63; border-color: #c4ef63; color: #141c14; }
dialog.card { width: calc(100% - 32px); margin: auto; color: var(--ink); box-shadow: 0 24px 80px #0003; }
dialog::backdrop { background: #080b08cc; backdrop-filter: blur(4px); }
.contract dialog h3 { color: var(--ink); }
.feed-item { padding: 18px 0; }
.feed-item.pinned { background: #30291c; padding: 16px; }
.feed-body { font-size: .94rem; }
.feed-meta { margin-top: 8px; font-size: .72rem; }
.empty { font-style: normal; font-size: .88rem; padding: 22px 16px; margin: 14px 0 0; text-align: center; border: 1px dashed #47523d; border-radius: 4px; background: #141913; }
.plain li { padding: 15px 0; font-size: .9rem; }
.plain li > span { min-width: 0; }
.tag { font-size: .7rem; flex-shrink: 0; max-width: 50%; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 25px; }
.photo-grid figure { border-radius: 4px; }
.photo-grid img { height: auto; aspect-ratio: 1; }
.photo-grid figcaption { padding: 12px; }
.photo-grid .btn { margin-top: 8px; }
/* Swap the submit label while a photo is uploading */
.photo-form .btn-label-busy { display: none; }
.photo-form.htmx-request .btn-label { display: none; }
.photo-form.htmx-request .btn-label-busy { display: inline; }
.lightbox { z-index: 100; }
.lightbox-close { min-height: 48px; min-width: 48px; top: max(16px, env(safe-area-inset-top)); }
.site-footer { padding: 24px 16px 35px; font-size: .72rem; }
.skip-link { position: fixed; top: -100px; left: 12px; background: var(--surface); padding: 12px; z-index: 200; }
.skip-link:focus { top: 12px; }
.welcome .header-inner { justify-content: center; }
.welcome .site-header { border: 0; }
.welcome-intro { text-align: center; margin: 16px auto 32px; }
.welcome-intro h1 { font-size: clamp(3rem, 8vw, 4.7rem); margin: 18px 0; }
.welcome-intro em { color: #c4ef63; font-weight: 400; font-style: normal; }
.welcome-intro p { font-size: .92rem; }
.entry-card { max-width: 430px; margin: 0 auto; padding: 30px; }
.entry-card h2 { font-size: 1.45rem; }
.entry-card .btn { width: 100%; justify-content: space-between; }
.entry-card .small { text-align: center; }
.join-card { margin-top: 35px; }
.join-card h1 { font-size: 2.5rem; }
@media (max-width: 1000px) {
    .header-inner { min-height: 72px; justify-content: space-between; }
    .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: #101210f5; backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 8px 8px max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
    .nav a { flex-direction: column; gap: 3px; font-size: .61rem; min-height: 53px; padding: 6px 1px; border-radius: 4px; }
    .nav .icon { width: 21px; height: 21px; }
    .signed-in { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
    .player-name { max-width: 130px; }
    .container { padding-inline: 20px; }
    main.container { padding-top: 28px; }
    .quick-links { gap: 8px; }
    .quick-links a { flex-direction: column; align-items: flex-start; padding: 13px; gap: 10px; font-size: .78rem; }
    .quick-links small { font-size: .64rem; line-height: 1.5; margin-top: 3px; }
    .quick-links a > span:last-child { display: none; }
    .card, .contract, .hunt-intro { padding: 22px; }
    .entry-card { padding: 26px; }
}
@media (max-width: 420px) {
    .container { padding-inline: 16px; }
    .card { border-radius: 4px; padding: 20px; }
    .quick-links a { padding: 11px; }
    .quick-links small { font-size: .6rem; }
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .inline-form > .field { flex-basis: 100%; min-width: 0; }
    .inline-form > .btn { width: 100%; }
    .plain li { gap: 8px; }
    .welcome-intro { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.photo-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-open:focus-visible { outline-offset: -4px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 620px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }

/* Printed labels and offset edges give the interface its retro game character. */
.eyebrow { color: var(--amber); }
.entry-card { border-top: 4px solid var(--accent); box-shadow: 6px 6px 0 #080b08; }
.hunt-intro { border-left: 4px solid var(--accent); }
.hunt-intro h2, .contract h2 { text-transform: uppercase; letter-spacing: .025em; }
.quick-links a:hover { border-color: var(--accent); }
.btn-danger:hover { background: #352420; }
.btn-primary:hover { color: #101210; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
.site-footer { letter-spacing: .035em; }

/* Rules page */
.rules { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 16px; }
.rules li { position: relative; padding-left: 44px; }
.rules li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    font-size: .85rem;
    display: grid;
    place-items: center;
}
.rules h3 { margin: 0 0 2px; }
.rules p { margin: 0; color: var(--ink-soft); }
.fine { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fine li { position: relative; padding-left: 24px; color: var(--ink-soft); }
.fine li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* Game states */
.game-over { border-top: 4px solid var(--accent); }
.eliminated { border-left: 4px solid var(--amber); }
.kill-registered { border-left: 4px solid var(--accent); }
.standings .rank {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    font-size: .78rem;
    font-weight: 700;
}

/* Kill confirmation + confirm modals */
.kill-modal,
.confirm-modal {
    max-width: 460px;
    padding: 26px;
    border: 1px solid #637b43;
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 5px 5px 0 #080c08;
}
.kill-modal::backdrop,
.confirm-modal::backdrop { background: rgba(6, 8, 6, 0.8); }
.kill-modal h2,
.confirm-modal h2 {
    margin: 0 0 0.5rem;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: 1.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .025em;
}
.kill-modal .row,
.confirm-modal .row { margin-top: 8px; }
.kill-modal .btn-primary,
.confirm-modal .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #141c10;
}



