/* Helix Games Theme for 2048 */
/* Theme color: #3cd2a5 (cyan/turquoise) */

:root {
  --helix-primary: #3cd2a5;
  --helix-primary-dark: #2ab88c;
  --helix-primary-light: #5ddbb5;
  --helix-bg-dark: #1a1f23;
  --helix-bg-card: #273136;
  --helix-text: #ffffff;
  --helix-text-muted: rgba(255, 255, 255, 0.6);
}

/* Container styling */
#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  padding: 20px;
  margin: 0 auto;
}

.game-title {
  color: var(--helix-primary);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(60, 210, 165, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Stats Bar - Above Game */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px auto;
  padding: 15px 30px;
  background: var(--helix-bg-card);
  border-radius: 12px;
  border: 1px solid rgba(60, 210, 165, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 550px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.stat-label {
  color: var(--helix-text-muted);
  font-size: 0.9rem;
}

/* Score containers - Integrated into stat-value */
.stat-value.score-container,
.stat-value.best-container {
  background: transparent;
  color: var(--helix-primary);
  font-weight: 700;
  font-size: 1.8rem;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  min-width: 80px;
  position: relative;
}

.stat-value.score-container:after,
.stat-value.best-container:after {
  display: none;
}

/* Buttons */
.restart-button {
  background: var(--helix-primary) !important;
  color: #000 !important;
  font-weight: 600;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(60, 210, 165, 0.3);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.restart-button:hover {
  background: var(--helix-primary-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(60, 210, 165, 0.4);
}

.restart-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(60, 210, 165, 0.3);
}

/* Game container */
.game-container {
  background: var(--helix-bg-card);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Grid cells */
.grid-cell {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

/* Tile styling - Updated color scheme */
.tile .tile-inner {
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tile 2 - Light cyan */
.tile.tile-2 .tile-inner {
  background: linear-gradient(135deg, #e0f7f1 0%, #d0f4ea 100%);
  color: #1a1f23;
  box-shadow: 0 2px 8px rgba(60, 210, 165, 0.15);
}

/* Tile 4 - Cyan tint */
.tile.tile-4 .tile-inner {
  background: linear-gradient(135deg, #b3ede1 0%, #99e7d6 100%);
  color: #1a1f23;
  box-shadow: 0 2px 8px rgba(60, 210, 165, 0.2);
}

/* Tile 8 - Primary theme color */
.tile.tile-8 .tile-inner {
  background: linear-gradient(135deg, #5ddbb5 0%, #3cd2a5 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(60, 210, 165, 0.3);
}

/* Tile 16 - Darker cyan */
.tile.tile-16 .tile-inner {
  background: linear-gradient(135deg, #3cd2a5 0%, #2ab88c 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(60, 210, 165, 0.4);
}

/* Tile 32 - Deep cyan */
.tile.tile-32 .tile-inner {
  background: linear-gradient(135deg, #2ab88c 0%, #24a07a 100%);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(42, 184, 140, 0.4);
}

/* Tile 64 - Teal */
.tile.tile-64 .tile-inner {
  background: linear-gradient(135deg, #24a07a 0%, #1e8968 100%);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(36, 160, 122, 0.4);
}

/* Tile 128 - Gold accent (achievement tier) */
.tile.tile-128 .tile-inner {
  background: linear-gradient(135deg, #ffd93d 0%, #f9c622 100%);
  color: #1a1f23;
  box-shadow: 0 4px 16px rgba(255, 217, 61, 0.5);
  font-size: 45px;
}

/* Tile 256 - Deeper gold */
.tile.tile-256 .tile-inner {
  background: linear-gradient(135deg, #f9c622 0%, #e6b31e 100%);
  color: #1a1f23;
  box-shadow: 0 4px 16px rgba(249, 198, 34, 0.6);
  font-size: 45px;
}

/* Tile 512 - Orange-gold */
.tile.tile-512 .tile-inner {
  background: linear-gradient(135deg, #ff9f1c 0%, #ff8c00 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(255, 159, 28, 0.6);
  font-size: 45px;
}

/* Tile 1024 - Vibrant orange */
.tile.tile-1024 .tile-inner {
  background: linear-gradient(135deg, #ff6f3c 0%, #ff5722 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 111, 60, 0.7);
  font-size: 35px;
}

/* Tile 2048 - Victory! Purple/Pink gradient */
.tile.tile-2048 .tile-inner {
  background: linear-gradient(135deg, #c44569 0%, #9b3ab5 100%);
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(196, 69, 105, 0.8);
  font-size: 35px;
  animation: victory-glow 1.5s ease-in-out infinite;
}

@keyframes victory-glow {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(196, 69, 105, 0.8);
  }
  50% {
    box-shadow: 0 8px 32px rgba(196, 69, 105, 1);
  }
}

/* Tile super (4096+) - Epic tier */
.tile.tile-super .tile-inner {
  background: linear-gradient(135deg, #5b247a 0%, #2c1656 100%);
  color: var(--helix-primary);
  box-shadow: 0 6px 24px rgba(91, 36, 122, 0.8);
  font-size: 30px;
  animation: super-glow 2s ease-in-out infinite;
}

@keyframes super-glow {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(91, 36, 122, 0.8);
  }
  50% {
    box-shadow: 0 8px 32px rgba(60, 210, 165, 0.6);
  }
}

/* Game message styling */
.game-container .game-message {
  background: rgba(26, 31, 35, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
}

.game-container .game-message p {
  color: var(--helix-primary);
  text-shadow: 0 2px 8px rgba(60, 210, 165, 0.5);
}

.game-container .game-message a {
  background: var(--helix-primary);
  color: #1a1f23;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(60, 210, 165, 0.3);
}

.game-container .game-message a:hover {
  background: var(--helix-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(60, 210, 165, 0.4);
}

.game-container .game-message.game-won {
  background: rgba(60, 210, 165, 0.15);
  border: 2px solid var(--helix-primary);
}

.game-container .game-message.game-won p {
  color: var(--helix-text);
}

/* Game explanation text */
.game-explanation {
  color: var(--helix-text-muted);
  margin-top: 30px;
  line-height: 1.8;
}

.game-explanation strong {
  color: var(--helix-primary);
  font-weight: 600;
}

/* Info Panels - Below Game */
.info-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 600px;
  margin: 20px auto;
  width: 100%;
}

.controls-panel {
  padding: 20px;
  background: var(--helix-bg-card);
  border-radius: 12px;
  border: 1px solid rgba(60, 210, 165, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.controls-panel h3,
.howto-panel h3 {
  margin-top: 0;
  color: var(--helix-primary);
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.control-list div {
  padding: 5px 0;
}

.control-key {
  background: var(--helix-primary);
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 8px;
}

.howto-panel {
  padding: 20px;
  background: var(--helix-bg-card);
  border-radius: 12px;
  border: 1px solid rgba(60, 210, 165, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.howto-panel p {
  margin: 10px 0;
  line-height: 1.6;
  color: var(--helix-text);
  font-size: 0.95rem;
}

/* Responsive adjustments */
@media screen and (max-width: 520px) {
  #game-container {
    padding: 10px;
  }
  
  .game-container {
    margin-top: 20px;
  }
  
  .info-panels {
    grid-template-columns: 1fr;
  }
  
  .stats-bar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .stat-item {
    justify-content: space-between;
    width: 100%;
  }
  
  .game-title {
    font-size: 2rem;
  }
}

/* Score addition animation - positioned above stats bar */
.score-container .score-addition,
.best-container .score-addition {
  position: absolute;
  color: var(--helix-primary) !important;
  font-weight: bold;
  font-size: 0.9rem;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
  animation: score-pop 1s ease-out;
  pointer-events: none;
}

@keyframes score-pop {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px);
  }
}

/* Smooth tile appearance */
.tile-new .tile-inner {
  animation: appear 200ms ease 100ms;
}

.tile-merged .tile-inner {
  animation: pop 200ms ease 100ms;
}

/* Add subtle hover effect to tiles */
.tile .tile-inner {
  transition: all 0.1s ease;
}
