* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #101a2c;
  color: #fff;
}
body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 14px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(circle at top, #263c5d, #101a2c 70%);
}
.machine {
  width: min(100%, 520px);
  padding: 22px;
  border: 3px solid #d5ad52;
  border-radius: 22px;
  background: linear-gradient(145deg, #17253d, #304b68);
  box-shadow: 0 18px 55px #0008, inset 0 0 22px #ffffff0b;
}
header { text-align: center; }
h1 { margin: 0; color: #ffdc7d; font-size: clamp(25px, 6vw, 34px); }
.subtitle { margin: 5px 0 20px; color: #d9e3f4; font-size: 12px; letter-spacing: 2px; }
.balance {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 15px; border-radius: 12px; background: #203550;
  font-weight: 800;
}
.balance strong { color: #ffdc7d; font-size: 28px; font-variant-numeric: tabular-nums; }
.bet-area { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
select {
  color: #18243a; background: #fff5d9; border: 0; border-radius: 9px;
  padding: 10px 14px; font-size: 16px; font-weight: 800;
}
.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reel-wrap { min-width: 0; text-align: center; font-size: 12px; font-weight: 800; }
.reel {
  height: clamp(85px, 22vw, 112px); margin-bottom: 8px;
  display: grid; place-items: center; border: 3px solid #e5bd60;
  border-radius: 13px; background: #fff5d9; color: #17253c;
  font-size: clamp(42px, 11vw, 58px);
  box-shadow: inset 0 0 9px #c5a66c;
}
.reel.rolling { animation: shake .11s linear infinite alternate; }
@keyframes shake { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
.status {
  min-height: 52px; margin: 15px 0; padding: 10px;
  display: grid; place-items: center; text-align: center;
  border-radius: 10px; background: #203550; color: #ffe18b; font-weight: 800;
}
.stop-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
button {
  border: 0; border-radius: 11px; padding: 13px 8px;
  font-size: 15px; font-weight: 900; cursor: pointer;
  transition: filter .15s, transform .15s;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:active:not(:disabled) { transform: scale(.97); }
button:focus-visible, select:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
button:disabled { opacity: .38; cursor: not-allowed; }
.stop { background: #d94b43; color: #fff; border: 2px solid #ffb2a5; }
.spin { width: 100%; margin-top: 13px; padding: 15px; background: linear-gradient(90deg, #f7ce62, #f3a92e); color: #38230a; font-size: 21px; border: 2px solid #ffe39b; }
.reset { width: 100%; margin-top: 9px; background: #53647c; color: white; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.stats div { padding: 11px; border: 1px solid #ffffff25; border-radius: 11px; background: #ffffff0b; }
.stats span { display: block; color: #d5dfed; font-size: 12px; }
.stats strong { display: block; margin-top: 4px; font-size: 19px; }
.rules { margin-top: 18px; padding: 14px; border: 1px solid #ffffff25; border-radius: 12px; background: #101d31aa; font-size: 13px; line-height: 1.6; }
.rules h2 { margin: 0 0 8px; color: #ffdc7d; font-size: 17px; }
.rules p { margin: 5px 0; }
.rules .note { margin-top: 10px; color: #c4d0df; font-size: 11px; }
@media (max-width: 380px) {
  .machine { padding: 15px; }
  .stop-buttons button { font-size: 13px; }
}
