:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1d0c3d, #05030a 60%);
  color: #f8e9b0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.machine {
  width: min(1200px, 100%);
  background: linear-gradient(160deg, #2b0f52, #0e0922 55%, #2b0f52);
  border-radius: 32px;
  border: 2px solid #f9c94c;
  box-shadow: 0 0 40px rgba(249, 201, 76, 0.4), 0 0 120px rgba(57, 0, 118, 0.8);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.machine::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(120deg, #f9c94c, #ff62ad, #5be3ff, #f9c94c);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.machine__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

h1 {
  margin: 4px 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: 6px;
}

.tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 12px;
  color: #9be7ff;
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: #ffb3f7;
}

.scoreboard {
  display: grid;
  gap: 12px;
}

.scoreboard__item {
  background: #0f0b1f;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid #f9c94c;
  text-align: right;
  min-width: 140px;
}

.scoreboard__item span {
  display: block;
  font-size: 12px;
  color: #f9c94c;
}

.scoreboard__item strong {
  font-size: 24px;
  color: #ffffff;
}

.machine__controls {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 24px 0;
}

button {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f9c94c, #ff5f7d);
  color: #0b0716;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 16px rgba(249, 201, 76, 0.6);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: #d6c78c;
}

.machine__body {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.3fr);
  gap: 24px;
  align-items: start;
}

.slot {
  background: rgba(10, 8, 22, 0.8);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(249, 201, 76, 0.3);
  text-align: center;
}

.slot__label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f9c94c;
}

.slot__reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 12px;
}

.reel {
  height: 70px;
  border-radius: 16px;
  background: linear-gradient(90deg, #09121f, #1b2e41);
  border: 1px solid rgba(91, 227, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  color: #7bf9ff;
  text-shadow: 0 0 12px rgba(123, 249, 255, 0.8);
}

.reel.spin {
  animation: reelSpin 0.6s ease-in-out infinite;
}

@keyframes reelSpin {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    transform: translateY(0);
  }
}

.slot__result {
  font-size: 18px;
  color: #ffffff;
}

.card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  border: 1px solid rgba(249, 201, 76, 0.3);
}

.cell,
.cell--header {
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #f8e9b0;
}

.cell {
  background: #121024;
  border: 1px solid rgba(249, 201, 76, 0.2);
  position: relative;
}

.cell--header {
  background: linear-gradient(135deg, #f9c94c, #ff62ad);
  color: #2b0f52;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cell.matched {
  background: linear-gradient(160deg, #3d235d, #0e0922);
  border-color: #7bf9ff;
  box-shadow: 0 0 12px rgba(123, 249, 255, 0.6);
}

.cell.free {
  background: linear-gradient(160deg, #5b3a9c, #25133f);
  color: #ffffff;
}

.machine__draws,
.machine__last {
  margin-top: 24px;
}

.machine__draws h2,
.machine__last h2 {
  margin: 0 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: rgba(10, 8, 22, 0.75);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(249, 201, 76, 0.2);
}

th,
td {
  padding: 10px 12px;
  text-align: center;
}

th {
  background: rgba(249, 201, 76, 0.15);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

tr:nth-child(even) td {
  background: rgba(15, 10, 30, 0.6);
}

.last-draws {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.draw-chip {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid rgba(249, 201, 76, 0.4);
  background: rgba(10, 8, 22, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.draw-chip span {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 999px;
}

.draw-chip .anjo {
  background: #ffe783;
  color: #5a3c00;
}

.draw-chip .diamante {
  background: #7bf9ff;
  color: #00363b;
}

.draw-chip .diabinho {
  background: #ff6b6b;
  color: #200000;
}

.draw-chip .coringa {
  background: #7dff7d;
  color: #003100;
}

@media (max-width: 900px) {
  .machine__body {
    grid-template-columns: 1fr;
  }

  .machine__controls {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}
