@font-face { font-family: "PT Sans"; src: url("/static/fonts/PT_Sans-Web-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("/static/fonts/PT_Sans-Web-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --blue: #0050d7;
  --navy: #001e50;
  --deep: #003278;
  --sky: #0073ff;
  --light: #5fa0ff;
  --gray: #f0f0f0;
  --line: #d9e3f3;
  --muted: #5b6b86;
  --green: #23d787;
  --orange: #ffa019;
  --red: #ff5550;
  --white: #ffffff;
  --radius: 16px;
  --font: "PT Sans", "PT Astra Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--navy);
  background: var(--blue);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--blue); }
button, input { font: inherit; }

/* фирменная графика: штрихи «магнитного поля» */
.pattern {
  background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='18'%3E%3Cpath d='M4 13 L16 5' stroke='%23ffffff' stroke-opacity='.07' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.topbar {
  background: var(--white);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar img { height: 32px; display: block; }
.topbar .tag { font-size: 14px; color: var(--muted); text-align: right; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.hero { color: var(--white); padding: 48px 0 32px; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
.hero p { font-size: 18px; margin: 0; max-width: 620px; opacity: .9; }

.panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.panel h2 { margin: 0 0 16px; font-size: 24px; }
.panel h3 { margin: 0 0 10px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.form { display: grid; gap: 16px; max-width: 480px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px;
  font-size: 17px; color: var(--navy); background: var(--white); outline: none;
}
.field input:focus { border-color: var(--blue); }
.field .err { color: var(--red); font-size: 14px; margin-top: 4px; min-height: 0; }
.field.bad input { border-color: var(--red); }
.prefix { position: relative; }
.prefix span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.prefix input { padding-left: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 14px 22px; cursor: pointer;
  background: var(--blue); color: var(--white); font-weight: 700; font-size: 17px; text-decoration: none;
}
.btn:hover { background: var(--deep); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn.ghost:hover { background: #eef4ff; }
.btn.danger { background: var(--white); color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn.small { padding: 8px 14px; font-size: 15px; border-radius: 10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.alert { padding: 14px 16px; border-radius: 12px; background: #eef4ff; color: var(--navy); }
.alert.err { background: #ffeceb; color: #b3261e; }
.alert.ok { background: #e3faf0; color: #0b6b43; }

/* ------------------------------------------------ билет */
.ticket {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0;
  background: var(--white); border-radius: 18px; overflow: hidden;
  border: 2px solid var(--line);
}
.t-side {
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
  border-right: 2px dashed var(--line);
}
.t-side img { width: 150px; }
.t-title { font-size: 40px; font-weight: 700; line-height: 1; color: var(--blue); margin-top: 8px; }
.t-sub { font-size: 14px; color: var(--muted); }
.t-dashes { height: 26px; width: 176px; margin: 4px 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='13'%3E%3Cpath d='M3 10 L12 3' stroke='%230050d7' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); background-size: 16px 13px; }
.t-meta { margin-top: auto; }
.t-meta .lbl { font-size: 13px; color: var(--muted); }
.t-meta .num { font-size: 28px; font-weight: 700; color: var(--blue); letter-spacing: .04em; }
.t-meta .owner { font-weight: 700; margin-top: 6px; }
.t-meta .tg { color: var(--muted); }
.t-cards { padding: 16px; display: grid; gap: 14px; align-content: center; }
.card {
  display: grid; grid-template-columns: repeat(9, 1fr);
  border: 2px solid var(--blue); border-radius: 10px; overflow: hidden;
}
.cell {
  aspect-ratio: 1 / .82; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: clamp(14px, 2.6vw, 26px); color: var(--navy);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .3s, color .3s;
}
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-last-child(-n+9) { border-bottom: 0; }
.cell.empty { background: #f3f7fe; }
.cell.hit { background: var(--blue); color: var(--white); }
.cell.rowdone { background: var(--green); color: var(--navy); }
.cell.fresh { animation: pop .8s ease; }
@keyframes pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (max-width: 720px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .t-side { border-right: 0; border-bottom: 2px dashed var(--line); flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .t-side img { width: 110px; }
  .t-title { font-size: 28px; margin: 0; }
  .t-dashes, .t-sub { display: none; }
  .t-meta { margin-top: 0; margin-left: auto; text-align: right; }
  .t-meta .num { font-size: 22px; }
  .t-cards { padding: 10px; gap: 10px; }
  .panel { padding: 20px; }
}

/* ------------------------------------------------ табло 1–90 */
.board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.board div {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--gray); color: #9aa6ba; font-weight: 700; font-size: 15px;
}
.board div.on { background: var(--blue); color: var(--white); }
.board div.last { background: var(--orange); color: var(--navy); }

.lastball {
  width: 120px; height: 120px; border-radius: 50%; background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 56px; font-weight: 700; flex: none;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.25);
}

/* ------------------------------------------------ призы */
.prizes { display: grid; gap: 12px; }
.prize { border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.prize.done { border-color: var(--green); }
.prize .ph { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.prize .pt { font-weight: 700; }
.prize .pw { font-size: 14px; color: var(--muted); white-space: nowrap; }
.prize ol { margin: 8px 0 0; padding-left: 22px; }
.prize li { margin: 4px 0; }
.prize li .tg { color: var(--muted); }
.prize li .tn { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--orange); color: var(--navy); vertical-align: middle; }
.badge.green { background: var(--green); }
.me { background: #e3faf0; border-radius: 6px; padding: 0 4px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.foot { color: rgba(255,255,255,.75); font-size: 14px; padding: 8px 0 40px; }
.hidden { display: none !important; }
.win-banner {
  background: var(--green); color: var(--navy); border-radius: var(--radius); padding: 22px 28px;
  font-size: 22px; font-weight: 700; margin-bottom: 24px;
}
