/* styles.css - Chromastack styles with dark/light theme */

/* CSS Variables for theming */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #b4b4b4;
  --border-color: #3a3a5a;
  --shadow: rgba(0, 0, 0, 0.3);
  --btn-bg: #0f3460;
  --btn-hover: #16213e;
}

[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #666666;
  --border-color: #d0d0d0;
  --shadow: rgba(0, 0, 0, 0.1);
  --btn-bg: #e0e0e0;
  --btn-hover: #d0d0d0;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Sticky Status Bar */
.status-bar {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 14px;
}

.status-value {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  min-width: 50px;
}

.status-controls {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn {
  background: var(--btn-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

/* Game Container */
.game-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

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

.game-header h1 {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.game-description {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Game Board */
.game-board {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(5px, 1.5vw, 15px);
  padding: clamp(10px, 3vw, 30px);
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 30px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

/* Column */
.column {
  display: flex;
  flex-direction: column-reverse;
  gap: clamp(2px, 0.5vw, 5px);
  padding: clamp(5px, 1vw, 10px);
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  min-width: 0;
  flex-shrink: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.column:hover {
  border-color: #667eea;
  transform: translateY(-5px);
  box-shadow: 0 6px 12px var(--shadow);
}

.column.selected {
  border-color: #ffd700;
  border-width: 3px;
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.column.drag-over {
  border-color: #51cf66;
  border-width: 3px;
  background: rgba(81, 207, 102, 0.15);
  box-shadow: 0 0 20px rgba(81, 207, 102, 0.4);
  transform: translateY(-5px);
}

/* Ball Slot */
.ball-slot {
  width: clamp(25px, 6vw, 50px);
  height: clamp(25px, 6vw, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ball */
.ball {
  width: clamp(22px, 5.5vw, 45px);
  height: clamp(22px, 5.5vw, 45px);
  border-radius: 50%;
  transition: transform 0.2s ease;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 4.5vw, 36px);
  line-height: 1;
  background: var(--bg-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ball:hover {
  transform: scale(1.1);
}

.ball.draggable {
  cursor: grab;
}

.ball.draggable:active {
  cursor: grabbing;
}

.ball.touch-dragging {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 0.9;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.ball.dragging {
  opacity: 0.8;
}

.ball.drag-hidden {
  opacity: 0.3;
}

/* Game Instructions */
.game-instructions {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
}

.game-instructions h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.game-instructions ul {
  list-style-position: inside;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 16px;
}

.game-instructions li {
  margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .status-bar {
    padding: 10px 15px;
  }
  
  .status-value {
    font-size: 16px;
  }
  
  .game-header h1 {
    font-size: 36px;
  }
  
  .game-container {
    margin: 20px auto;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .status-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .status-controls {
    margin-left: 0;
    justify-content: center;
  }
  
  .game-header h1 {
    font-size: 28px;
  }
  
  .game-description {
    font-size: 14px;
  }
  
  .game-container {
    margin: 10px auto;
    padding: 5px;
  }
  
  .game-instructions {
    padding: 15px;
  }
  
  .game-instructions h3 {
    font-size: 18px;
  }
  
  .game-instructions ul {
    font-size: 14px;
  }
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 3px solid gold;
  border-radius: 20px;
  padding: 40px 60px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
  z-index: 1001;
  animation: modalPop 0.5s ease-out;
}

@keyframes modalPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content h2 {
  font-size: 36px;
  color: gold;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.modal-stats {
  font-size: 24px;
  margin: 20px 0;
}

.modal-stats p {
  margin: 10px 0;
}

.modal-stats span {
  font-weight: bold;
  color: gold;
}

.modal-next {
  font-size: 18px;
  color: var(--text-secondary);
  margin-top: 20px;
}

.modal-next span {
  font-weight: bold;
  color: gold;
}

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

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}
