:root {
  --green: #14805e;
  --mint: #4acfa5;
  --yellow: #ffdf1b;
  --gold: #ffcc00;
  --bg: #282828;
  --panel: #333333;
  --footer: #474747;
  --text: #cccccc;
  --muted: #bababa;
  --faint: #888888;
  --white: #ffffff;
  --card: #494949;
  --line: #3a3a3a;
  --slip: #f0f0f0;
  --slip-2: #e4e4e4;
  --key: #dddddd;
  --stake: #333333;
  --place: #585858;
  --overlay: #3d3d3d;
  --login: #dddddd;
  --input: #e4e4e4;
  --header-h: 46px;
  --font: -apple-system, "Helvetica Neue", Helvetica, "Segoe UI", Roboto, "Droid Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.35;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.app {
  width: min(100%, 430px);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--green);
  display: flex;
  align-items: stretch;
}
.header button {
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 14px;
  font-weight: 400;
  padding: 0;
}
.nav-menu { width: 75px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.nav-live { width: 75px; }
.nav-logo { width: 74px; }
.nav-join { width: 92px; }
.nav-login { width: 74px; color: var(--yellow); }
.header button.is-active { color: var(--yellow); }
.burger {
  width: 16px;
  height: 12px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.main { min-height: calc(100vh - var(--header-h)); }

.games {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 8px 0 10px 8px;
  scrollbar-width: none;
}
.games::-webkit-scrollbar { display: none; }
.game {
  position: relative;
  flex: 0 0 235px;
  width: 235px;
  height: 140px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  color: #fff;
}
.game img {
  width: 235px;
  height: 140px;
  object-fit: cover;
}
.game::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.28), rgba(12, 90, 66, 0.22));
  pointer-events: none;
}
.game span {
  z-index: 1;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 10px 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
}

.board { padding: 0 0 12px; }
.board:empty { min-height: calc(100vh - 176px); }
.match-list { display: flex; flex-direction: column; }
.league {
  background: #1f6b52;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}
.match {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #333;
  background: #303030;
}
.match-teams { display: flex; flex-direction: column; gap: 2px; }
.match-teams strong { color: #fff; font-weight: 600; font-size: 14px; }
.match-teams small { color: var(--muted); font-size: 12px; }
.odds { display: flex; gap: 6px; align-items: center; }
.odd {
  min-width: 58px;
  height: 40px;
  border: 0;
  border-radius: 3px;
  background: #3c3c3c;
  color: var(--yellow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.odd b { color: #fff; font-size: 11px; font-weight: 500; }
.odd.is-on { background: var(--green); color: #fff; }
.empty-note { display: none; }

.slip {
  background: var(--slip-2);
  color: #222;
}
.slip-head {
  height: 55px;
  background: var(--slip);
  display: grid;
  grid-template-columns: 1fr auto 48px;
  align-items: center;
  padding-left: 12px;
  border-bottom: 1px solid #d5d5d5;
}
.slip-title { display: flex; align-items: center; gap: 10px; font-size: 16px; color: #333; }
.slip-count {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.slip-balance { text-align: right; font-size: 13px; color: #666; line-height: 1.2; padding-right: 8px; }
.slip-balance b { display: block; color: #444; font-weight: 600; }
.slip-close {
  height: 55px;
  border: 0;
  border-left: 1px solid #ddd;
  background: #f7f7f7;
  color: #777;
  font-size: 22px;
}
.slip.is-shut .slip-body { display: none; }
.user-pick {
  width: 100%;
  height: 46px;
  border: 0;
  background: var(--key);
  color: #444;
  font-size: 15px;
}
.stake-row { display: flex; height: 48px; }
.stake, .place {
  flex: 1;
  border: 0;
  font-size: 22px;
  font-weight: 500;
}
.stake { background: var(--stake); color: var(--mint); text-align: left; padding-left: 14px; }
.place { background: var(--place); color: #cfcfcf; }
.place.is-ready { background: var(--green); color: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); }
.key {
  height: 44px;
  border: 0;
  border-right: 1px solid #cfcfcf;
  border-bottom: 1px solid #cfcfcf;
  background: var(--key);
  color: #6e6e6e;
  font-size: 28px;
}
.key:nth-child(3n) { border-right: 0; }
.picks { background: #fff; }
.pick {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  color: #333;
}
.pick button { border: 0; background: transparent; color: #999; font-size: 16px; }

.footer { background: var(--footer); color: var(--muted); padding: 18px 16px 28px; font-size: 13px; }
.back-top {
  width: 100%;
  height: 36px;
  margin-bottom: 22px;
  border: 0;
  background: #5c5c5c;
  color: #d0d0d0;
  font-size: 14px;
}
.footer select {
  width: 100%;
  height: 48px;
  margin: 0 0 14px;
  padding: 0 12px;
  background: transparent;
  color: #ddd;
  border: 1px solid #8d8d8d;
  border-radius: 2px;
  font-size: 16px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #bbb 50%), linear-gradient(135deg, #bbb 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 8px 0 16px;
  line-height: 1.6;
}
.footer-links a { color: #d5d5d5; text-decoration: none; font-size: 14px; }
.footer-links a:last-child { flex-basis: 100%; text-align: center; }
.footer p { margin: 0 0 16px; text-align: center; line-height: 1.45; font-size: 13px; }
.copy { color: #cfcfcf; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(312px, 86vw);
  background: var(--panel);
  z-index: 40;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: none; }
.search-row {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #ddd;
  font-size: 16px;
}
.search-row input {
  flex: 1;
  height: 32px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  outline: none;
}
.tabs { display: flex; border-bottom: 1px solid #2a2a2a; }
.tabs button {
  flex: 1;
  height: 55px;
  border: 0;
  background: transparent;
  color: #bbb;
  font-size: 15px;
}
.tabs button.is-on { color: var(--mint); }
.drawer-body { flex: 1; overflow: auto; padding: 8px 0 24px; }
.sport-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #ddd;
  padding: 12px 16px;
  font-size: 15px;
  border-bottom: 1px solid #3a3a3a;
}
.drawer-empty { color: #888; padding: 16px; font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--overlay);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 46px;
}
.modal[hidden] { display: none; }
.login-card {
  width: min(310px, calc(100% - 48px));
  background: var(--login);
  color: #444;
  padding: 18px 18px 8px;
  border-radius: 0 0 2px 2px;
}
.field {
  display: flex;
  align-items: center;
  background: var(--input);
  border: 1px solid #c8c8c8;
  height: 46px;
  margin-bottom: 8px;
}
.field input {
  flex: 1;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 16px;
  color: #444;
  outline: none;
}
.field button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #888;
  font-size: 18px;
  display: grid;
  place-items: center;
  padding: 0;
}
.save-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #666;
  font-size: 15px;
}
.login-go {
  width: 100%;
  height: 44px;
  border: 0;
  background: var(--gold);
  color: #111;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}
.login-error {
  background: #fff;
  color: #a33;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.login-error[hidden] { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  z-index: 60;
  font-size: 13px;
  max-width: 90%;
}
.toast[hidden] { display: none; }
