:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel2: #21252f;
  --line: #2c313c;
  --text: #e9ecf1;
  --muted: #8a92a3;
  --gold: #ffc53d;
  --gold2: #f0a500;
  --red: #ff4d4f;
  --green: #52c41a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.head { text-align: center; margin-bottom: 14px; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: .3px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- слот ---------- */
.machine {
  background: linear-gradient(180deg, #262b36, #1b1f28);
  border: 1px solid #343a48;
  border-radius: 20px;
  padding: 16px 14px 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  position: relative;
}
.machine-top {
  text-align: center;
  font-size: 26px;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.reels {
  display: flex;
  gap: 8px;
  justify-content: center;
  position: relative;
}
.reel {
  width: 84px;
  height: 288px;          /* 3 * 96 */
  overflow: hidden;
  border-radius: 12px;
  background: #10131a;
  border: 1px solid #2b303c;
  box-shadow: inset 0 0 18px rgba(0,0,0,.7), inset 0 0 3px rgba(255,255,255,.03);
  position: relative;
}
.strip { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; }
.sym {
  height: 96px;
  line-height: 96px;
  text-align: center;
  font-size: 54px;
}
.reel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 96px;
  height: 96px;
  border-top: 2px solid rgba(255,197,61,.35);
  border-bottom: 2px solid rgba(255,197,61,.35);
  background: linear-gradient(180deg, rgba(255,197,61,.06), transparent 30%, transparent 70%, rgba(255,197,61,.06));
  pointer-events: none;
}

.payline {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 6px 14px 12px;
  opacity: .7;
}

.spin {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2b1a00;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(240,165,0,.35), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .06s ease, filter .15s ease;
}
.spin:active { transform: translateY(2px); }
.spin:disabled { filter: grayscale(.5) opacity(.7); }

.result {
  text-align: center;
  min-height: 24px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 700;
}
.result.win { color: var(--green); }
.result.jackpot { color: var(--gold); }

/* ---------- донат ---------- */
.donate, .top {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-top: 16px;
}
.donate h2, .top h2 { font-size: 16px; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 12px; margin-bottom: 12px; }

.tiers { display: flex; gap: 8px; }
.tier {
  flex: 1;
  padding: 12px 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s ease;
}
.tier:active { background: #2a2f3a; }

.custom { display: flex; gap: 8px; margin-top: 10px; }
.custom input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.custom button {
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  color: #2b1a00;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.fallback {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.fallback:hover { color: var(--text); }

/* ---------- топ ---------- */
.total { color: var(--gold); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.board { list-style: none; }
.board li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.board li:last-child { border-bottom: none; }
.pos {
  width: 22px; height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--panel2);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.board li:nth-child(1) .pos { background: var(--gold); color: #2b1a00; }
.board li:nth-child(2) .pos { background: #c0c8d4; color: #1a1d24; }
.board li:nth-child(3) .pos { background: #cd7f32; color: #1a1d24; }
.name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum { font-weight: 700; color: var(--gold); }
.board .empty { color: var(--muted); border: none; justify-content: center; }

.me { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }
