/* Shared chrome: public home page, password page, admin panel and the three tools.
   Palette matches the existing ticket editors. */
:root {
  color-scheme: light;
  --ink: #12213d;
  --muted: #526070;
  --line: #b5c0d0;
  --green: #087c43;
  --green-dark: #056535;
  --blue: #0b5cad;
  --blue-dark: #084b8e;
  --red: #b3202c;
  --page: #f1f4f8;
  --card: #fff;
  --shadow: 0 3px 18px #10254a1c;
  --shadow-lg: 0 10px 30px #10254a24;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 18px 16px 40px;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}
body.centered { display: grid; place-items: center; padding-top: 32px; }
body.home { padding: 0; }
img { max-width: 100%; }

h1 { margin: 0 0 6px; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.2; }
h2 { margin: 26px 0 10px; font-size: 1.05rem; }
a { color: var(--blue); }
code { padding: 1px 5px; border-radius: 4px; background: #e4eaf2; font-size: .92em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  width: min(100%, 1280px);
  margin: 0 auto 18px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
body.home .nav {
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: 0 1px 12px #10254a1f;
}
.nav-inner {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  font-size: .98rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--green), #0aa25a);
  color: #fff;
  font-size: .8rem;
  letter-spacing: .02em;
}
.brand-text em { font-style: normal; color: var(--green); }

.nav-toggle {
  display: none;
  width: 42px; min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--ink);
  content: "";
}
.nav-toggle .bars::before { transform: translateY(-6px); }
.nav-toggle .bars::after  { transform: translateY(4px); }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { background: #eef2f8; }
.nav-link.active, .nav-drop.active > .nav-link { color: var(--green); }
.chip-lock { font-size: .72rem; opacity: .75; }
.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .6;
}

.nav-drop { position: relative; }
.drop-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 248px;
  padding: 6px;
  display: none;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.nav-drop:hover .drop-menu,
.nav-drop.open .drop-menu { display: block; }
.drop-menu a {
  display: block;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.drop-menu a:hover { background: #eef2f8; }
.drop-menu strong { display: block; font-size: .88rem; }
.drop-menu small { color: var(--muted); font-size: .78rem; }

.nav-cta {
  padding: 9px 15px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-cta:hover { background: var(--green-dark); }
.nav-cta.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
}
.nav-cta.ghost:hover { background: #eef2f8; color: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 8px;
  }
  .nav.open .nav-menu { display: flex; }
  .nav-link { justify-content: space-between; width: 100%; }
  .nav-drop:hover .drop-menu { display: none; }
  .nav-drop.open .drop-menu { display: block; }
  .drop-menu {
    position: static;
    min-width: 0;
    padding: 2px 0 6px 10px;
    box-shadow: none;
    background: none;
  }
  .nav-cta { margin-top: 6px; text-align: center; }
}

/* --------------------------------------------------------------- Hero */
.hero {
  padding: 46px 16px 54px;
  background:
    radial-gradient(900px 340px at 82% -10%, #0aa25a33, transparent 60%),
    linear-gradient(160deg, #0d2a4d 0%, #0b3d63 48%, #08603c 100%);
  color: #fff;
}
.hero-inner {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 34px;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
}
.hero-copy h1 { margin: 12px 0 14px; font-size: clamp(1.7rem, 4.4vw, 2.85rem); }
.hero-copy p { margin: 0 0 22px; max-width: 56ch; color: #dde7f2; font-size: clamp(.92rem, 2vw, 1.02rem); }
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffffff1f;
  border: 1px solid #ffffff33;
  color: #d9f2e4;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 20px 0 0; color: #c9dcee; font-size: .84rem; }
.hero-art { display: grid; place-items: center; }
.hero-art img {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  box-shadow: 0 18px 44px #00000059;
  transform: rotate(-2.2deg);
}

@media (max-width: 820px) {
  .hero { padding: 34px 16px 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 320px; transform: none; }
}

/* ----------------------------------------------------------- Sections */
.section { padding: 46px 16px; }
.section.alt { background: #e9eef6; }
.section-head { width: min(100%, 1120px); margin: 0 auto 26px; text-align: center; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.section-head p { margin: 0 auto; max-width: 62ch; color: var(--muted); font-size: .9rem; }

.steps {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.steps li {
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.step-no {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #e7f6ed;
  color: var(--green);
  font-weight: 800;
}
.steps h3 { margin: 0 0 6px; font-size: 1rem; }
.steps p { margin: 0; color: var(--muted); font-size: .86rem; }

.stats {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  text-align: center;
}
.stats.compact { margin: 0; text-align: left; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat {
  padding: 20px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.stat-no { display: block; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; color: var(--green); line-height: 1.1; }
.stat-label { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }

.site-foot { padding: 30px 16px 40px; background: #0d2a4d; color: #c9dcee; }
.foot-inner { width: min(100%, 1120px); margin: 0 auto; }
.site-foot p { margin: 0 0 8px; font-size: .88rem; }
.site-foot .small { color: #9fb8d2; font-size: .78rem; }
.site-foot a { color: #9ed9bb; }

/* ---------------------------------------------------- Cards and forms */
.stack { width: min(100%, 1280px); margin: 0 auto; }
.page-head { width: min(100%, 860px); margin: 0 auto 16px; text-align: center; }

.card {
  width: min(100%, 420px);
  padding: 26px 24px 28px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.card.wide { width: min(100%, 860px); margin: 0 auto; text-align: left; }
.auth-card { text-align: center; }
.lock-badge {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #e7f6ed;
  font-size: 1.3rem;
}

label { display: grid; gap: 5px; margin-bottom: 12px; text-align: left; font-size: .83rem; font-weight: 700; }
input, select, button { min-height: 42px; border-radius: 7px; font: inherit; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #0aa25a66; outline-offset: 1px; }
button, .btn {
  display: inline-block;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--green-dark); }
button:disabled { background: #9bb0a6; cursor: not-allowed; }
button.full, .btn.full { width: 100%; }
.btn.lg { padding: 13px 26px; font-size: 1rem; }
.btn.secondary { background: var(--blue); }
.btn.secondary:hover { background: var(--blue-dark); }

.hint { margin: 0 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.5; }

.alert { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; font-size: .86rem; text-align: left; }
.alert.error { background: #fdecec; color: #8c1c1c; }
.alert.ok { background: #e7f6ed; color: #0a5c33; }
.alert.warn { background: #fdf4e3; color: #7a5410; }

/* --------------------------------------------------------- Tool tiles */
.tiles {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 22px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile .amount { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1; }
.tile .name { font-size: 1rem; font-weight: 700; }
.tile .desc { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.tile-foot {
  margin-top: auto;
  padding-top: 14px;
  color: var(--green);
  font-size: .8rem;
  font-weight: 700;
}
.tile.t200 .amount { color: var(--blue); }
.tile.t500 .amount { color: var(--red); }
.tile.result .amount { color: var(--green); }

/* ------------------------------------------------------- Result tables */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; }
th { background: #f6f8fb; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > label { flex: 1 1 160px; margin-bottom: 0; }
.row > button { align-self: end; }

.win { padding: 18px; border-radius: 12px; background: #e7f6ed; border: 1px solid #b6e0c6; }
.win .prize { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; color: #0a5c33; }
.lose { padding: 18px; border-radius: 12px; background: #f6f8fb; border: 1px solid #dde4ed; }

textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  resize: vertical;
}

@media (max-width: 520px) {
  body { padding: 12px 8px 28px; }
  body.home { padding: 0; }
  .card { padding: 20px 16px 24px; }
  .section { padding: 34px 14px; }
}
