/* Modern Casino Theme for Bingo Bongo - Refined */

:root {
  --bg-main: #12161f;
  --bg-card: #1c2230;
  --text-main: #ffffff;
  --text-dim: #a0aab2;
  --primary-cyan: #00e5ff;
  --neon-cyan: #00e5ff;
  --neon-pink: #ff00e5;
  --secondary-blue: #82b1ff;
  --accent-purple: #b388ff;
  --danger: #ff5252;
  --success: #00e676;
  --warning: #ffd740;
}

* {
  touch-action: manipulation;
  box-sizing: border-box;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Poppins', sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1 {
  font-weight: 700;
  letter-spacing: 4px;
  margin: 24px 0;
  color: var(--primary-cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Card Style */
.gold-box {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 16px;
  margin: 16px auto;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: none;
  text-align: left;
}

.gold-box h2, .gold-box h3 {
  margin-top: 0;
  color: var(--warning);
  font-weight: 600;
  text-align: center;
  font-size: 20px;
  letter-spacing: 1px;
}

/* Buttons */
button {
  background: transparent;
  color: var(--secondary-blue);
  border: 1px solid var(--secondary-blue);
  font-weight: 600;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  margin: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  background: rgba(130, 177, 255, 0.1);
}

button:active {
  transform: translateY(1px);
}

/* Primary Action Button */
button.random-btn, button#autoDrawBtn.active, button.primary-btn {
  background: var(--primary-cyan);
  color: #000;
  border: none;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
  font-weight: 700;
}

button.random-btn:hover, button#autoDrawBtn.active:hover, button.primary-btn:hover {
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.6);
  background: var(--primary-cyan);
  filter: brightness(1.1);
}

button.random-btn:hover {
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

/* Muted buttons */
button.undo-btn {
  background: #3e4451;
  color: #fff;
}

button.reset-btn {
  background: #4a1c1c;
  color: var(--danger);
  border: 1px solid rgba(255, 82, 82, 0.2);
}

button.sound-btn {
  background: transparent;
  color: var(--primary-cyan);
  border: 1px solid var(--primary-cyan);
  padding: 8px 16px;
  font-size: 14px;
}

button.kick-btn {
  background-color: transparent;
  color: #ff4d4f;
  border: 1px solid #ff4d4f;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  margin: 0;
  box-shadow: none;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  gap: 6px;
}

button.kick-btn:hover {
  background-color: transparent;
  color: #ff7875;
  border-color: #ff7875;
  font-weight: 600;
  cursor: pointer;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 77, 79, 0.3);
}

button.kick-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

button.back-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  font-size: 14px;
  margin: 0;
}

button.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Inputs */
input, select {
  background: #0f121a;
  color: var(--text-main);
  font-size: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #2d3446;
  width: 100%;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary-cyan);
  background: #151924;
}

/* Layout Grids */
.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .game-layout {
    grid-template-columns: 1.8fr 1.2fr;
    align-items: start;
  }
}

/* Bingo Grid */
#bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-width: 450px;
  margin: 24px auto;
  aspect-ratio: 1;
}

.cell {
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  color: var(--text-dim);
}

.cell.marked {
  background: var(--primary-cyan);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.6);
  transform: scale(1.05);
  border: 2px solid var(--primary-cyan);
}

.cell.pattern-target {
  border: 2px dashed var(--accent-purple);
}

.cell.line-complete {
  background: var(--accent-purple) !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(179, 136, 255, 0.6);
  animation: win-glow 1.5s infinite alternate;
}

/* Current Number Display */
#current-number-display {
  font-size: 110px;
  font-weight: 700;
  color: var(--primary-cyan);
  background: #0b0e14;
  border-radius: 24px;
  padding: 20px;
  margin: 24px auto;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.3);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
}

/* Chat UI */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.chat-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  max-width: 85%;
  word-break: break-word;
  line-height: 1.4;
}

/* Player Bubble */
.chat-msg:not(.system) {
  background: #2a334a;
  color: #e0e6ed;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* System Bubble */
.chat-msg.system {
  background: #362a4a;
  color: var(--accent-purple);
  text-align: center;
  max-width: 95%;
  align-self: center;
  font-style: italic;
  font-weight: 500;
  border-radius: 10px;
}

.chat-msg .name {
  color: var(--secondary-blue);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.chat-input-area {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-area input {
  margin-bottom: 0;
  flex: 1;
  background: #0b0e14;
}

.chat-input-area button {
  margin: 0;
  background: var(--primary-cyan);
  padding: 8px 16px;
}

/* Leaderboard */
.leader-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.leader-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.06);
}

/* History */
.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.history-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #151924;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-ball.latest {
  background: var(--primary-cyan);
  color: #000;
  box-shadow: 0 0 12px var(--primary-cyan);
  border: none;
}

/* Modal */
#inspect-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 22, 31, 0.98);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

#inspect-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 350px;
  margin: 20px auto;
  aspect-ratio: 1;
}

#inspect-grid .cell {
  font-size: 16px;
  border-radius: 8px;
}

/* Animations */
@keyframes win-glow {
  from { box-shadow: 0 0 20px rgba(179, 136, 255, 0.4); }
  to { box-shadow: 0 0 40px rgba(179, 136, 255, 0.8); }
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  #bingo-grid {
    gap: 6px;
    max-width: 95vw;
    margin: 15px auto;
  }
  .cell {
    font-size: 18px;
    border-radius: 8px;
  }
  #current-number-display {
    width: 120px;
    height: 120px;
    font-size: 56px;
    margin: 15px auto;
    border-radius: 20px;
  }
  .gold-box {
    padding: 16px;
  }
  h1 {
    font-size: 24px;
    letter-spacing: 2px;
    margin: 16px 0;
  }
  .chat-container {
    height: 300px;
  }
  button {
    padding: 10px 18px;
    font-size: 14px;
  }
}

/* Global Footer Styles */
.site-footer {
  text-align: center;
  padding: 60px 20px 40px;
  color: var(--text-dim);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 60px;
}

.site-footer p {
  margin: 8px 0;
  text-align: center;
}

.site-footer a {
  color: var(--primary-cyan);
  text-decoration: none;
  margin: 0 10px;
  transition: all 0.2s ease;
}

.site-footer a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.site-footer .copyright {
  margin-top: 15px;
  font-size: 12px;
  opacity: 0.5;
}
