:root {
  --bg: #08080c;
  --surface: #111116;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --ok: #34d399;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad: max(1rem, var(--safe-left));
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(52, 211, 153, 0.06), transparent 60%),
    var(--bg);
  pointer-events: none;
}

a, button, input, textarea, select {
  touch-action: manipulation;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: calc(1rem + var(--safe-top)) var(--page-pad) 1rem;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-back {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.nav-back:hover,
.nav-back:active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.page-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem var(--page-pad) calc(3rem + var(--safe-bottom));
}
.page-wrap-wide { max-width: 720px; }

.page-head {
  margin-bottom: 2rem;
}

.page-head .eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-head h1 {
  margin: 0.65rem 0 0;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-head p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.panel {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 1.4rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #052e1f;
  background: var(--accent);
  min-height: 48px;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover,
.btn-primary:active {
  opacity: 0.92;
  transform: translateY(-1px);
}

.field { margin-top: 1rem; }
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field textarea:focus {
  border-color: rgba(52, 211, 153, 0.45);
}
.field textarea { resize: vertical; min-height: 140px; }

.status {
  margin-top: 1rem;
  min-height: 1.3em;
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  text-align: center;
}
.status.ok {
  color: var(--ok);
  background: var(--accent-dim);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.status.err {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.rule-section {
  margin-bottom: 0.75rem;
  padding: 1.15rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.rule-section h2 {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rule-section ul {
  margin: 0;
  padding-left: 1.15rem;
}
.rule-section li {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.note-box {
  margin-top: 1.25rem;
  padding: 1.1rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}
.note-box a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.note-box a:hover,
.note-box a:active { text-decoration: underline; }

footer.site-foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem var(--page-pad) calc(2rem + var(--safe-bottom));
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* iPhone */
@media (max-width: 480px) {
  .nav {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .page-head h1 { font-size: 1.65rem; }
  .panel { padding: 1.25rem 1.1rem; }
}

/* iPad & Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
  .page-wrap,
  .page-wrap-wide {
    max-width: 680px;
  }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .page-wrap { padding-top: 0.5rem; }
  .page-head { margin-bottom: 1.25rem; }
}
