/* Shared tokens and components for the vfnetwork demos. */
:root {
  --vf-red: #e60000;
  --vf-red-dark: #bd0000;
  --ink: #25282b;
  --ink-2: #4a4d4e;
  --muted: #6f7375;
  --paper: #ffffff;
  --paper-2: #f4f4f4;
  --line-light: #e3e3e3;

  --night: #111315;
  --night-2: #1b1e21;
  --night-3: #272b2f;
  --night-line: rgba(255, 255, 255, 0.12);
  --night-text: #f2f2f2;
  --night-muted: #a7acb0;

  --ok: #8fb800;
  --warn: #fecb00;

  --font: 'Vodafone Rg', 'Vodafone', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

body.night {
  color: var(--night-text);
  background: var(--night);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  display: block;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.15s, transform 0.1s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--vf-red);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: var(--vf-red-dark);
}

.btn-ghost {
  background: transparent;
  border-color: currentColor;
}

.btn-quiet {
  background: rgba(127, 127, 127, 0.14);
}

.btn-block {
  width: 100%;
}

.btn-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

:focus-visible {
  outline: 3px solid var(--warn);
  outline-offset: 2px;
}

/* Small bits */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vf-red);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(127, 127, 127, 0.16);
}

.chip-red {
  background: var(--vf-red);
  color: #fff;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px dashed currentColor;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.muted {
  color: var(--muted);
}

body.night .muted {
  color: var(--night-muted);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Game screens (dark) */
body.night {
  background: var(--night) radial-gradient(120% 60% at 50% 0%, #2a1416 0%, var(--night) 55%) no-repeat fixed;
}

.screen {
  max-width: 520px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 40px;
}

.small {
  font-size: 0.85rem;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  margin-bottom: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px 0 0;
  border: 0;
  background: none;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--night-muted);
}

.back-link:hover {
  color: var(--night-text);
}

.hero {
  margin: 12px 0 24px;
}

.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 9vw, 2.6rem);
}

.lead {
  font-size: 1.08rem;
  color: var(--night-muted);
}

.clock {
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.clock.is-low {
  color: #ff5c5c;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

.timebar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: var(--night-3);
  overflow: hidden;
}

.timebar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--vf-red), #ff6b6b);
  transition: width 0.1s linear;
}

/* Toasts */
.toasts {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  z-index: 50;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease-out;
}

body.night .toast {
  background: #fff;
  color: var(--ink);
}

.toast-out {
  opacity: 0;
  transition: opacity 0.3s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}

.shake {
  animation: shake 0.35s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
