:root {
  --primary: #FF5252;
  --secondary: #4DB6AC;
  --bg-color: #F5F7FA;
  --card-bg: #FFFFFF;
  --text-main: #2D3436;
  --text-muted: #636E72;
  --border-color: #DFE6E9;
  --reel-bg: #F1F2F6;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
}

.main-header {
  width: 100%;
  background: var(--card-bg);
  border-bottom: 4px solid var(--text-main);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  margin-bottom: 40px;
}

.main-header .logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.main-header nav {
  display: flex;
  gap: 20px;
}

.main-header nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  border: 2px solid var(--text-main);
  padding: 5px 15px;
  background: var(--secondary);
  box-shadow: 4px 4px 0px var(--text-main);
  transition: transform 0.1s;
}

.main-header nav a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--text-main);
}

.game-container {
  background: var(--card-bg);
  border: 4px solid var(--text-main);
  border-radius: 0; /* Sharp flat design style */
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 12px 12px 0px var(--text-main); /* Brutalist/Flat shadow */
}

.paytable {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.pay-item {
  background: var(--reel-bg);
  border: 2px solid var(--text-main);
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pay-item span {
  font-size: 1.2rem;
}

h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
  color: var(--text-main);
}

.slot-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
  width: 100%;
  justify-content: center;
  margin: 10px 0;
}

.slot-machine {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--text-main);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.paylines-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    pointer-events: none;
    z-index: 20;
}

.paylines-overlay line {
    stroke: rgba(255, 0, 0, 0.3);
    stroke-width: 4;
    stroke-dasharray: 8;
    transition: stroke 0.3s;
    display: none;
}

.paylines-overlay line.active {
    display: block;
}

.paylines-overlay line.premium {
    stroke: rgba(52, 152, 219, 0.4);
}

.paylines-overlay line.winning {
    stroke: #FF5252;
    stroke-width: 8;
    stroke-dasharray: 0;
    filter: drop-shadow(0 0 10px rgba(255, 82, 82, 0.8));
    animation: flash 0.5s infinite alternate;
}

.paylines-overlay line.premium.winning {
    stroke: #3498DB;
    stroke-width: 8;
    filter: drop-shadow(0 0 10px rgba(52, 152, 219, 0.8));
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

.slot-machine::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    z-index: 10;
    transform: translateY(-50%);
}

.reel {
  width: 120px;
  height: 360px;
  background: var(--reel-bg);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.symbol-container {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
}

.symbol {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: var(--card-bg);
  border-bottom: 2px solid var(--border-color);
  box-sizing: border-box;
}

.controls {
  display: flex;
  gap: 20px;
  align-items: center;
  width: 100%;
}

.info-panel {
  flex: 1;
  background: var(--reel-bg);
  padding: 10px 15px;
  border: 2px solid var(--text-main);
  display: flex;
  flex-direction: column;
}

.bet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bet-controls button {
  background: var(--secondary);
  border: 2px solid var(--text-main);
  color: white;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0px var(--text-main);
}

.bet-controls button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--text-main);
}

.label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
}

#withdraw-btn {
  background: #2ECC71;
  border: 3px solid var(--text-main);
  padding: 8px 15px;
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.1s;
  box-shadow: 4px 4px 0px var(--text-main);
  margin-top: 10px;
  width: 100%;
}

#withdraw-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--text-main);
}

#withdraw-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--text-main);
}

#spin-btn {
  background: var(--accent);
  border: 4px solid var(--text-main);
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.1s;
  box-shadow: 6px 6px 0px var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

#spin-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px var(--text-main);
}

#spin-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0px var(--text-main);
}

#spin-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0px var(--text-main);
}


@media (max-width: 600px) {
  .slot-wrapper {
    flex-direction: column;
    gap: 20px;
  }
}

.win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: #FDD835; /* Yellow flat */
    padding: 30px 60px;
    border: 5px solid var(--text-main);
    z-index: 100;
    text-align: center;
}

.win-message h2 {
    color: var(--text-main);
    font-size: 3rem;
    margin: 0;
    font-weight: 900;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }
  
  .game-container {
    padding: 20px;
    width: 90%;
    gap: 20px;
  }

  h1 { font-size: 2rem; }

  .reel { width: 80px; height: 240px; }
  .symbol { width: 80px; height: 80px; font-size: 2.5rem; }

  .controls { flex-direction: column; width: 100%; }
  .info-panel { width: 100%; box-sizing: border-box; }
}

@media (max-width: 400px) {
    .reel { width: 70px; height: 210px; }
    .symbol { width: 70px; height: 70px; font-size: 2rem; }
}

.main-footer {
  width: 100%;
  background: var(--text-main);
  color: white;
  padding: 20px;
  text-align: center;
  margin-top: auto;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
