/* Whack-a-Gopher Game Styles */
:root {
  --primary: #bb86fc; /* Updated to match template */
  --secondary: #4286f5;
  --accent: #9c42f5;
  --dark: #121212; /* Updated to match template */
  --bg-secondary: #1e1e1e;
  --bg-card: #2a2a2a;
  --text-color: #e0e0e0; /* Updated to match template */
  --text-light: #a0a0a0;
  --text-white: #ffffff;
  --grass-color: #5da94f;
  --dirt-color: #8c6239;
  --gopher-color: #b08159;
  --gopher-nose: #5e3a20;
  --gopher-tooth: #ffffff;
  --border-radius: 12px;
  --shadow-light: 0 3px 10px rgba(0, 0, 0, 0.2);
  --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

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

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Game Page Header */
.game-page-header {
  background-color: #1f1f1f;
  padding: 0.8rem 0;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-color);
}

/* Main Game Content Area */
.game-content {
  padding: 2rem 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(187, 134, 252, 0.3);
  background: linear-gradient(to right, var(--primary), #9d70d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The Game Container */
#game-container {
  width: 100%;
  max-width: 800px;
  min-height: 500px;
  background-color: var(--bg-card);
  border: 2px solid #444;
  border-radius: 8px;
  margin: 0 auto 2rem auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

/* Game Instructions Area */
.game-instructions {
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem 1.5rem;
  max-width: 700px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

.game-instructions h2 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.game-instructions p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Footer Styles */
.site-footer {
  background-color: #1f1f1f;
  color: var(--text-light);
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

.site-footer p {
  margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .game-title {
    font-size: 1.8rem;
  }
  #game-container {
    min-height: 400px;
  }
  .game-instructions {
    width: 95%;
    padding: 0.8rem 1rem;
  }
  .game-instructions h2 {
    font-size: 1.2rem;
  }
  .game-instructions p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.6rem;
  }
  #game-container {
    min-height: 300px;
    border-width: 1px;
  }
  .back-link {
    font-size: 0.9rem;
  }
}

/* ================= Game-specific styles below ================= */

.game-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  background: #1a1a1a;
  border-radius: 15px;
  padding: 15px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.left-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.score, .time {
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 15px;
  border-radius: 50px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.time {
  margin: 0 auto;
}

.score span, .time span {
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(187, 134, 252, 0.5);
}

.buttons {
  position: relative;
  width: 150px;
  height: 44px;
  line-height: 0;
  display: block;
}

.game-status {
  font-weight: 700;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 5px 15px;
  border-radius: 50px;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
  animation: pulse 1.5s infinite;
  white-space: nowrap;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.hidden {
  display: none !important;
}

/* Special class for buttons that prevents layout shifts */
.button-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.primary-btn {
  background: linear-gradient(90deg, var(--primary), #9d70d8);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(187, 134, 252, 0.3);
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  text-align: center;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(187, 134, 252, 0.4);
}

.primary-btn:active {
  transform: translateY(1px);
}

.game-board {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--grass-color);
  padding: 15px 20px 0px 20px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 60% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, #5da94f, #4a8c3f);
  background-size: 70px 70px, 100px 100px, 80px 80px, 90px 90px, 100% 100%;
}

.game-board::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px 15px 0 0;
}

.hole-container {
  display: flex;
  justify-content: space-around;
  gap: 15px;
}

.hole {
  width: 100px;
  height: 75px;
  background: var(--dirt-color);
  border-radius: 50% 50% 45% 45% / 25% 25% 80% 80%;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Gopher using image instead of CSS */
.gopher {
  position: absolute;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 70px;
  background: url('../assets/images/gopher.png') no-repeat center center;
  background-size: contain;
  transition: bottom 0.1s ease-out;
  z-index: 5;
}

/* Remove all the CSS-based gopher parts since we're using an image now */
.gopher::before,
.gopher::after,
.gopher .nose::before,
.gopher .nose::after,
.nose::before,
.nose::after,
.nose {
  display: none;
}

/* Reset the hole before/after that were being used for ears */
.hole::before,
.hole::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to bottom, 
    rgba(0, 0, 0, 0.3), 
    rgba(0, 0, 0, 0.5));
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  transform: none;
  top: auto;
  z-index: 3;
}

/* Adjust for mobile */
@media (max-width: 768px) {
  .gopher {
    width: 50px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .gopher {
    width: 40px;
    height: 50px;
  }
}

.gopher.active {
  bottom: 0;
  animation: popUp 0.5s ease-out;
}

@keyframes popUp {
  0% { bottom: -100%; }
  40% { bottom: 5px; }
  55% { bottom: -5px; }
  70% { bottom: 2px; }
  85% { bottom: -2px; }
  100% { bottom: 0; }
}

.gopher.whacked {
  animation: whackEffect 0.3s ease-out;
}

@keyframes whackEffect {
  0% { transform: translateX(-50%) scale(1); }
  10% { transform: translateX(-50%) scale(1.2); }
  30% { transform: translateX(-50%) scale(0.8) rotateX(30deg); }
  50% { transform: translateX(-50%) scale(0.95) rotateX(10deg); }
  100% { transform: translateX(-50%) scale(1); }
}

.hole.whack {
  animation: scorePopUp 0.5s ease-out;
}

@keyframes scorePopUp {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.score-pop {
  position: absolute;
  color: white;
  font-weight: bold;
  font-size: 20px;
  animation: float 0.8s ease-out forwards;
  z-index: 10;
  text-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
}

/* Bonus points popup styling */
.score-pop.bonus-pop {
  color: #ffcc00;
  font-size: 26px;
  font-weight: bold;
  text-shadow: 
    0 0 10px rgba(255, 204, 0, 0.7),
    0 2px 5px rgba(0, 0, 0, 0.5);
  animation: floatBonus 1s ease-out forwards;
}

@keyframes floatBonus {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  10% {
    transform: translateY(-5px) scale(1.5);
    opacity: 1;
  }
  20% {
    transform: translateY(-10px) scale(1.3) rotate(-5deg);
  }
  40% {
    transform: translateY(-20px) scale(1.3) rotate(5deg);
  }
  60% {
    transform: translateY(-30px) scale(1.2) rotate(-3deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-60px) scale(1);
    opacity: 0;
  }
}

/* Streak effect styling */
.streak-effect {
  animation: streakPulse 0.5s ease-out;
}

@keyframes streakPulse {
  0% {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 30px 5px rgba(255, 204, 0, 0.7);
  }
  100% {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  }
}

@keyframes float {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  10% {
    transform: translateY(-5px) scale(1.2);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-50px) scale(1);
    opacity: 0;
  }
}

.game-started {
  animation: gameStartPulse 0.5s;
}

@keyframes gameStartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.game-over-effect {
  animation: gameOverShake 0.5s;
}

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

.time-warning {
  animation: timeWarning 0.5s infinite;
}

@keyframes timeWarning {
  0%, 100% { color: white; }
  50% { color: #ff6b6b; }
}

@media (max-width: 768px) {
  .hole {
    width: 80px;
    height: 70px;
  }
  
  .game-info {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .left-section {
    width: 100%;
    justify-content: center;
  }
  
  .score, .time {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hole {
    width: 65px;
    height: 55px;
  }
  
  .score, .time {
    padding: 4px 10px;
    font-size: 0.9rem;
  }
} 