body.page { padding-bottom: env(safe-area-inset-bottom); }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 26px; }
.wordmark span { color: var(--accent); margin-left: 4px; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.open i { background: var(--tail); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tail) 25%, transparent); animation: pulse 1.6s infinite; }
.status.closed i { background: var(--fade); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

.wrap { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; display: grid; gap: 14px; }

.hero { padding: 18px 0 4px; }
.hero h1 { font-size: clamp(44px, 13vw, 72px); margin: 0; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

/* Now on screen */
.now { display: flex; align-items: center; gap: 12px; }
.now .face { width: 54px; height: 54px; }
.now .meta { flex: 1; min-width: 0; }
.now .k { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent); }
.now .t { font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Your ticket */
.ticket { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 40px var(--glow); text-align: center; }
.ticket .k { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); }
.ticket .pos { font-size: 84px; color: var(--accent); margin: 6px 0; }
.ticket .pos small { font-size: 30px; color: var(--muted); }
.ticket .t { font-weight: 700; }
.ticket .live { font-size: 40px; color: var(--accent); margin: 8px 0; }
.ticket .v { font-size: 64px; margin: 8px 0 4px; }
.ticket .v.tail { color: var(--tail); }
.ticket .v.fade { color: var(--fade); }
.ticket .note { color: var(--muted); font-style: italic; margin-top: 6px; }
.ticket button {
  margin-top: 14px;
  background: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Form */
.form { display: grid; gap: 16px; position: relative; }
.form.is-closed > :not(.closed) { opacity: 0.35; pointer-events: none; }
.closed { background: var(--surface2); border-radius: 12px; padding: 12px; text-align: center; font-weight: 700; }
.field { display: grid; gap: 8px; }
.label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }

.handle { display: flex; align-items: center; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.handle:focus-within { border-color: var(--accent); }
.handle b { padding-left: 14px; color: var(--muted); }
.handle input { border: 0; background: none; padding-left: 4px; }

.seg { display: flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
}
.seg button.on { background: var(--accent); color: var(--on-accent); }

.search { position: relative; }
.results {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.results button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}
.results button:hover, .results button.hl { background: var(--surface2); }
.results .face { width: 38px; height: 38px; }
.results small, .picked small { display: block; color: var(--muted); font-size: 12px; }
.results .none { padding: 14px; color: var(--muted); }

.picked { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: var(--surface2); }
.picked .face { width: 52px; height: 52px; }
.picked b { font-size: 17px; }
.picked button { margin-left: auto; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; padding: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
}
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.teams { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.teams button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--surface2);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.teams img { width: 100%; height: 100%; object-fit: contain; }
.teams button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 380px) { .teams { grid-template-columns: repeat(5, 1fr); } }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.solo { grid-template-columns: 1fr; }
.stepper { display: flex; align-items: stretch; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.stepper:focus-within { border-color: var(--accent); }
.stepper input { border: 0; background: none; text-align: center; font-weight: 800; font-size: 20px; padding: 8px 0; min-width: 0; }
.stepper button { border: 0; background: none; color: var(--text); font-size: 24px; width: 46px; cursor: pointer; }

.preview {
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.preview.ready { color: var(--text); border-style: solid; border-color: var(--accent); }
.error { margin: -6px 0 0; min-height: 0; color: var(--fade); font-weight: 700; text-align: center; }
.error:empty { display: none; }

.go {
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 26px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--glow);
}
.go:disabled { opacity: 0.5; cursor: wait; }

/* Promo */
.promo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(120deg, var(--surface), var(--surface2));
}
.promo .code {
  flex: none;
  font-size: 30px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px dashed var(--accent);
  color: var(--accent);
}
.promo p { margin: 0; font-size: 14px; color: var(--muted); }
.promo b { color: var(--text); }

/* Lists */
.list h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; display: flex; justify-content: space-between; }
.list h2 small { color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }
.list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.list li.me { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.list li .n { width: 22px; text-align: right; color: var(--muted); font-weight: 800; font-size: 13px; }
.list li .face { width: 34px; height: 34px; }
.list li .t { flex: 1; min-width: 0; }
.list li .t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .t small { color: var(--muted); font-size: 12px; }
.list .empty { color: var(--muted); padding: 6px; }

.foot { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }
