/* ===== GLOBAL STYLES ===== */
:root {
  --primary-color: #0a5c36;
  --primary-dark: #07482a;
  --primary-light: #0d7a47;
  --accent-color: #ffd700;
  --text-color: #ffffff;
  --text-secondary: #cccccc;
  --background-dark: #121f17;
  --background-medium: #1a2c21;
  --background-light: #223a2b;
  --border-color: #2a4d38;
  --win-color: #4caf50;
  --lose-color: #f44336;
  --button-hover: #0d7a47;
  --button-active: #07482a;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--background-dark);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

/* ===== NAVBAR ===== */
.navbar {
  background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  padding: 0 20px;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  position: relative;
}

.logo {
  display: flex;
  flex-direction: column;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 4px;
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: white;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.balance {
  background-color: var(--background-medium);
  padding: 8px 15px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.balance-label {
  color: var(--text-secondary);
}

.balance-amount {
  color: var(--accent-color);
  font-weight: 700;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background-color: var(--primary-light);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-btn:hover {
  background-color: var(--button-hover);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--background-medium);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
}

.dropdown-content button {
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  border: none;
  background: none;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.dropdown-content button:hover {
  background-color: var(--background-light);
}

.dropdown:hover .dropdown-content {
  display: block;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* ===== MAIN CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 100px auto 40px auto;
  padding: 24px;
  flex: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 1024px) {
  .container {
    padding: 16px;
    margin-top: 90px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
    margin-top: 80px;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 4vw 2vw;
    margin-top: 70px;
    gap: 12px;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 2vw 1vw;
    margin-top: 60px;
    gap: 8px;
  }
}

.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-header h1 {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.game-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== GAME CONTROLS ===== */
.game-controls {
  background-color: var(--background-medium);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.bet-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.bet-amount {
  flex: 1;
  min-width: 220px;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group {
  display: flex;
}

.input-group input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  background-color: var(--background-light);
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  border-radius: 4px;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.multiplier-display {
  background-color: var(--background-light);
  padding: 12px 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  justify-content: center;
}

.multiplier-label {
  color: var(--text-secondary);
}

.multiplier-value {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1.2rem;
}

.action-buttons .spin-btn {
  padding: 12px 30px;
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-buttons .spin-btn:hover {
  background: linear-gradient(to bottom, var(--primary-light), var(--primary-color));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.action-buttons .spin-btn:active {
  transform: translateY(1px);
}

.action-buttons .spin-btn:disabled {
  background: var(--background-light);
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* ===== GAME AREA ===== */
.game-area {
  background-color: var(--background-medium);
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 390px;
  margin: 0 auto 20px;
  padding: 0 5px;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.3s ease;
}

.cell {
  aspect-ratio: 1/1;
  width: 100%;
  max-width: 80px;
  background-color: var(--background-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(5vw, 32px);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 5px rgba(0,0,0,0.2);
  transform-origin: center;
}

@media (hover: hover) {
  .cell:hover {
    background-color: #34495e;
    transform: scale(1.05);
  }
}

.cell:active {
  transform: scale(0.95);
}

.cell-click {
  transform: scale(0.9);
  background-color: #2980b9;
}

.cell-hover {
  background-color: #34495e;
  transform: translateY(-5px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.cell.revealed {
  background-color: #16a085;
  color: white;
  transform: scale(1);
}

.cell.bomb {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  animation: bombExplosion 0.5s;
}

@keyframes bombExplosion {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Animacja kliknięcia wyniku */
@keyframes result-appear {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.result-container {
  margin-top: 10px;
  text-align: center;
}

.result {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  min-height: 40px;
  padding: 10px;
  border-radius: 4px;
  transition: var(--transition);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.result.win {
  color: var(--win-color);
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  background: rgba(76, 175, 80, 0.08);
}

.result.lose {
  color: var(--lose-color);
  background: rgba(244, 67, 54, 0.08);
}

.result.info {
  color: var(--accent-color);
  background: rgba(255, 215, 0, 0.08);
}

.result.error {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.12);
}

/* ===== STATS ===== */
.game-stats {
  background-color: var(--background-medium);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-item {
  background-color: var(--background-light);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--accent-color);
  width: 50px;
  height: 50px;
  background-color: rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  flex: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
}

.modal-content {
  background-color: var(--background-medium);
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  position: relative;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--text-color);
}

.modal h2 {
  margin-bottom: 20px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 10px 0;
}

.modal-body h3 {
  margin: 20px 0 10px;
  color: var(--text-color);
}

.modal-body p {
  margin-bottom: 10px;
}

/* ===== FOOTER ===== */
.game-footer {
  background-color: var(--background-medium);
  padding: 20px;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-color);
}

.responsible-gambling {
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .board {
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-dark);
    flex-direction: column;
    padding: 15px 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    gap: 8px;
  }
  .nav-links.active {
    display: flex;
  }
  .nav-link {
    padding: 12px 15px;
    font-size: 0.98rem;
    padding: 8px 8px;
    gap: 5px;
  }
  .dropdown-btn {
    font-size: 0.98rem;
    padding: 8px 10px;
  }
  .spin-btn {
    padding: 10px 20px;
    font-size: 1rem;
    gap: 8px;
  }
  .bet-step {
    padding: 10px 10px;
    font-size: 1rem;
  }
  .quick-bet {
    font-size: 0.98rem;
    padding: 8px;
  }
  .stat-item {
    padding: 10px;
    gap: 8px;
  }
  .stat-icon {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
  }
  .stat-value {
    font-size: 1rem;
  }
  .mobile-menu-btn {
    display: block;
  }
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-header h1 {
    font-size: 2rem;
  }
  .bet-controls {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .game-area {
    padding: 8px 0;
    overflow-x: visible;
  }
  .board {
    gap: 2vw;
    max-width: none;
    width: 100%;
    min-width: 0;
    padding: 0;
    grid-template-columns: repeat(5, 1fr);
  }
  .cell {
    font-size: 7vw;
    border-radius: 3px;
    max-width: unset;
    min-width: 0;
    aspect-ratio: 1/1;
    padding: 0;
  }
  .nav-links {
    gap: 4px;
  }
  .nav-link {
    font-size: 0.93rem;
    padding: 7px 5px;
    gap: 4px;
  }
  .dropdown-btn {
    font-size: 0.93rem;
    padding: 7px 7px;
  }
  .spin-btn {
    padding: 10px 0;
    font-size: 1.05rem;
    width: 100%;
    max-width: 320px;
    margin: 8px auto;
    gap: 8px;
    display: flex;
    justify-content: center;
  }
  .bet-step {
    padding: 8px 7px;
    font-size: 0.95rem;
  }
  .quick-bet {
    font-size: 0.93rem;
    padding: 6px;
  }
  .stat-item {
    padding: 7px;
    gap: 5px;
  }
  .stat-icon {
    font-size: 0.95rem;
    width: 28px;
    height: 28px;
  }
  .stat-value {
    font-size: 0.93rem;
  }
}

@media (max-width: 400px) {
  .board {
    gap: 1vw;
  }
  .cell {
    font-size: 8vw;
  }
  .nav-link {
    font-size: 0.85rem;
    padding: 5px 2px;
    gap: 2px;
  }
  .dropdown-btn {
    font-size: 0.85rem;
    padding: 5px 3px;
  }
  .spin-btn {
    padding: 8px 0;
    font-size: 0.95rem;
    max-width: 98vw;
    gap: 5px;
  }
  .bet-step {
    padding: 6px 3px;
    font-size: 0.85rem;
  }
  .quick-bet {
    font-size: 0.85rem;
    padding: 3px;
  }
  .stat-item {
    padding: 4px;
    gap: 2px;
  }
  .stat-icon {
    font-size: 0.8rem;
    width: 18px;
    height: 18px;
  }
  .stat-value {
    font-size: 0.85rem;
  }
}

/* Efekt wybuchu */
.explosion {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,200,0,0.8) 0%, rgba(255,100,0,0.8) 50%, rgba(255,0,0,0) 100%);
  border-radius: 50%;
  animation: explode 0.5s forwards;
  z-index: 10;
}

.explosion-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
  z-index: 5;
}

@keyframes explode {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-5px, 0) rotate(-5deg); }
  20% { transform: translate(5px, 0) rotate(5deg); }
  30% { transform: translate(-5px, 0) rotate(-5deg); }
  40% { transform: translate(5px, 0) rotate(5deg); }
  50% { transform: translate(-5px, 0) rotate(-5deg); }
  60% { transform: translate(5px, 0) rotate(5deg); }
  70% { transform: translate(-5px, 0) rotate(-5deg); }
  80% { transform: translate(5px, 0) rotate(5deg); }
  90% { transform: translate(-5px, 0) rotate(-5deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti-fall 1s linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.multiplier-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #2ecc71;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: min(4vw, 18px);
  animation: pulse 1s infinite;
  z-index: 5;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.next-multiplier {
  margin: 10px 0;
  padding: 8px 12px;
  background-color: #2c3e50;
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  color: #ecf0f1;
  transition: all 0.3s ease;
}

.multiplier-highlight {
  color: #f1c40f;
  font-weight: bold;
  font-size: 1.1em;
}

.potential-win {
  color: #2ecc71;
  margin-left: 5px;
}

.high-gain {
  background-color: #27ae60;
  animation: pulse-high 1.5s infinite;
}

.medium-gain {
  background-color: #2980b9;
}

.low-gain {
  background-color: #2c3e50;
}

@keyframes pulse-high {
  0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

.multiplier-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(46, 204, 113, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  z-index: 1000;
  transition: opacity 0.5s;
}

.multiplier-notification.fade-out {
  opacity: 0;
}

.current-payout {
  margin: 10px 0;
  padding: 8px 12px;
  background-color: #223a2b;
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  color: #ecf0f1;
  font-weight: 600;
  transition: all 0.3s ease;
}

.current-payout .payout-value {
  color: #ffd700;
  font-weight: bold;
  font-size: 1.1em;
}

.high-profit {
  background-color: #27ae60;
  color: #fff;
}
.medium-profit {
  background-color: #2980b9;
  color: #fff;
}
.low-profit {
  background-color: #2c3e50;
  color: #fff;
}
.no-profit {
  background-color: #7f8c8d;
  color: #fff;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
