/* party-kit — single stylesheet. Mobile-first, big tap targets, no build step.
   Works on iOS Safari and Android Chrome with plain HTML. */

:root {
  --bg: #12121a;
  --panel: #1e1e2b;
  --panel-2: #262636;
  --text: #f2f2f7;
  --muted: #a0a0b2;
  --accent: #ff4d6d;
  --accent-2: #4d8bff;
  --ok: #38d39f;
  --border: #33334a;
  --radius: 14px;
  --tap: 52px; /* minimum comfortable tap target */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-2); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); font-size: .95rem; }
.error { color: var(--accent); font-weight: 600; }

/* ---- Card-tap pages: big, centered, single message ---- */
.card-page { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 1.25rem; }
.card {
  width: 100%;
  max-width: 30rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.card code { background: var(--panel-2); padding: .1rem .4rem; border-radius: 6px; }

/* ---- Buttons & inputs: large, thumb-friendly ---- */
button, .btn {
  display: inline-block;
  min-height: var(--tap);
  padding: .8rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
button:active, .btn:active { filter: brightness(1.1); }
button.link {
  background: none;
  color: var(--accent-2);
  min-height: auto;
  padding: .25rem 0;
  font-weight: 500;
}

input[type="password"], input[type="text"] {
  width: 100%;
  min-height: var(--tap);
  margin-top: .35rem;
  padding: .6rem .8rem;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
label { display: block; text-align: left; margin-bottom: 1rem; font-weight: 600; }

/* ---- Admin pages ---- */
.admin-page { padding: 1.25rem; }
.admin { max-width: 60rem; margin: 0 auto; }
.admin.narrow { max-width: 26rem; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }

.cards-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 34rem) { .cards-grid { grid-template-columns: 1fr 1fr; } }
.tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
}
.tile p { margin: 0; color: var(--muted); }
.tile.disabled { opacity: .5; }

/* ---- Cards table (write-URLs helper) ---- */
.cards-table { width: 100%; border-collapse: collapse; }
.cards-table th, .cards-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.cards-table th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.cards-table .url { color: var(--accent-2); word-break: break-all; }

/* ---- Assassin: dashboard + admin panels ---- */
.card hr { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.card .big { font-size: 1.5rem; font-weight: 700; margin: .1rem 0 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.panel h2 { margin-top: 0; }
.panel.danger { border-color: #5a2733; }

/* Inline forms sit on one row with their controls. */
form.inline, .inline { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.inline input[type="text"], .inline input[type="number"] { width: auto; margin: 0; min-height: 40px; }
.inline button, form.inline button { min-height: 40px; padding: .4rem .9rem; font-size: .95rem; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0; }

.checkbox { display: flex; align-items: flex-start; gap: .6rem; font-weight: 500; }
.checkbox input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; }

button.link.danger, .link.danger { color: #ff6b81; }
button:disabled { opacity: .4; cursor: not-allowed; }

.ok { color: var(--ok); font-weight: 600; }
.banner { font-size: 1.2rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }

/* ---- CTF: team swatches, board, countdown ---- */
.swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  margin-right: .45rem;
  vertical-align: -2px;
  border: 1px solid rgba(255, 255, 255, .25);
}
.team-red { background: #e23b4e; }
.team-blue { background: #3b7de2; }
.team-green { background: #2fb265; }
.team-yellow { background: #e2b93b; }

.board table { margin-bottom: .5rem; }
.countdown {
  font-size: 2.4rem;
  font-weight: 800;
  margin: .5rem 0;
  color: var(--accent-2);
}
a.btn { text-decoration: none; }

select {
  min-height: 40px;
  padding: .4rem .6rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- Photo gallery ---- */
.gallery-page { padding: 1rem; }
.gallery-wrap { max-width: 70rem; margin: 0 auto; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.gallery-header h1 { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: .5rem;
}
@media (min-width: 40rem) { .grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); } }
.tile-photo {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
}
.tile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Admin gallery management grid */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .6rem; }
.admin-thumb { text-align: center; }
.admin-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--panel-2); }
.admin-thumb form { margin: .2rem 0 0; }
input[type="file"] { color: var(--text); margin-bottom: .5rem; }

/* ---- Print: just the card list, no chrome ---- */
@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --border: #bbb; }
  body { background: #fff; color: #000; }
  .no-print, .admin-header .link { display: none !important; }
  .cards-table .url { color: #000; }
}
