:root {
  --bg: #050505;
  --panel: #1a1a1a;
  --btn: #f3f3f3;
  --btn-text: #111;
  --accent: #f08a2a;
  --accent-text: #111;
  --muted: #9a9a9a;
  --danger: #ff5c5c;
  --ok: #3ecf8e;
  --line: #333;
  --petal-radius: 18px 6px 18px 6px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: #fff;
}

body {
  min-height: 100dvh;
}

#app {
  min-height: 100dvh;
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.shell.watch {
  max-width: 360px;
  padding: 10px;
}

.shell.demo {
  max-width: 980px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--panel);
  border-radius: 18px;
  padding: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #2a2a2a;
  font-size: 0.8rem;
}

.chip.ok {
  background: #173528;
  color: var(--ok);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.accent {
  background: var(--accent);
  color: var(--accent-text);
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid #444;
}

.btn.block {
  width: 100%;
}

.btn.danger {
  background: #3a1515;
  color: #ffb4b4;
}

.athlete-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.athlete-pick button {
  text-align: left;
  border: 1px solid #333;
  background: #121212;
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
}

.athlete-pick button.selected {
  border-color: var(--accent);
  background: #2a1a0c;
}

.code-huge {
  font-size: clamp(2.8rem, 14vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}

.qr {
  display: block;
  margin: 0 auto;
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pad button {
  border: 0;
  border-radius: var(--petal-radius);
  background: var(--btn);
  color: var(--btn-text);
  font-size: 1.4rem;
  font-weight: 800;
  min-height: 52px;
}

.field-block + .field-block {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 10px;
}

.field-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wrkt-button {
  border: 0;
  min-width: 56px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--petal-radius);
  background: var(--btn);
  color: var(--btn-text);
  font-weight: 800;
  font-size: 0.95rem;
}

.wrkt-button-selected {
  outline: 3px solid var(--accent);
}

.wrkt-button-unique-select {
  background: #8a8a8a;
  color: #111;
}

.wrkt-button-header-locked {
  background: #3a2a18;
  color: #ffd7a8;
  outline: 2px solid var(--accent);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.actions .btn {
  border-radius: 999px;
  min-height: 48px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #222;
  border: 1px solid #444;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 50;
  max-width: 90vw;
}

.toast.err {
  border-color: var(--danger);
  color: #ffd0d0;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 800px) {
  .demo-grid {
    grid-template-columns: 1fr;
  }
}

.frame {
  border: 1px solid #333;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  min-height: 640px;
}

.frame iframe {
  width: 100%;
  height: 720px;
  border: 0;
  background: #000;
}

.banner {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2a;
}

.list-item:last-child {
  border-bottom: 0;
}
