* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #121213;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* ====== BACK BUTTON ====== */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(83, 141, 78, 0.2);
  border: 2px solid #538d4e;
  border-radius: 8px;
  color: #538d4e;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 100;
}

.back-button:hover {
  background: #538d4e;
  color: #121213;
  transform: translateX(-4px);
}

.back-button svg {
  transition: transform 0.2s ease;
}

.back-button:hover svg {
  transform: translateX(-4px);
}

/* ====== GAME CONTAINER ====== */
.game-container {
  background: #1a1a1b;
  padding: 30px 25px;
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

h1 {
  letter-spacing: 4px;
  font-size: 22px;
  margin-bottom: 10px;
}

#roundText {
  opacity: 0.7;
  font-size: 14px;
  margin-bottom: 15px;
}

/* ====== ATTEMPT INDICATOR ====== */
.attempt-indicator {
  margin-bottom: 20px;
}

.attempt-bar {
  width: 100%;
  height: 8px;
  background: #3a3a3c;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.attempt-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #538d4e, #6aaa64);
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

.attempt-fill.warning {
  background: linear-gradient(90deg, #b59f3b, #c9b458);
}

.attempt-fill.danger {
  background: linear-gradient(90deg, #d32f2f, #e57373);
}

#attemptText {
  font-size: 12px;
  opacity: 0.8;
  margin: 0;
  transition: color 0.3s ease;
}

#attemptText.warning {
  color: #c9b458;
}

#attemptText.danger {
  color: #e57373;
}

/* ====== PLAY SECTION ====== */
.play-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: #538d4e;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

.play-btn:hover {
  background: #6aaa64;
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.95);
}

.play-btn.playing {
  background: #b59f3b;
  animation: none;
  cursor: not-allowed;
  pointer-events: none;
}

.play-btn.playing:hover {
  transform: none;
}

.play-btn.disabled {
  background: #3a3a3c;
  cursor: default;
  animation: none;
}

.play-btn.disabled:hover {
  transform: none;
  background: #3a3a3c;
}

.play-icon {
  width: 36px;
  height: 36px;
  margin-left: 4px;
}

/* ====== TIMELINE ====== */
.timeline-container {
  width: 100%;
  margin-top: 20px;
}

.timeline-bar {
  width: 100%;
  height: 12px;
  background: #3a3a3c;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.timeline-fill {
  height: 100%;
  width: 6.67%;
  background: linear-gradient(90deg, #538d4e, #6aaa64);
  border-radius: 6px;
  transition: width 0.4s ease;
  position: relative;
}

.timeline-playhead {
  position: absolute;
  top: 50%;
  left: 6.67%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #6aaa64;
  border: 3px solid #fff;
  border-radius: 50%;
  transition: left 0.4s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 2;
}

.timeline-playhead.animating {
  transition: left linear;
}

.timeline-markers {
  position: relative;
  height: 28px;
  margin-top: 8px;
}

.marker {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  color: #666;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

/* Position markers based on actual time: 1/15, 2/15, 4/15, 7/15, 15/15 */
.marker[data-length="1"] { left: 6.67%; }
.marker[data-length="2"] { left: 13.33%; }
.marker[data-length="4"] { left: 26.67%; }
.marker[data-length="7"] { left: 46.67%; }
.marker[data-length="15"] { left: 100%; }

.marker::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: #3a3a3c;
  border-radius: 1px;
}

.marker.active {
  color: #6aaa64;
  background: rgba(83, 141, 78, 0.2);
}

.marker.active::before {
  background: #6aaa64;
}

.marker.used {
  color: #b59f3b;
}

.marker.used::before {
  background: #b59f3b;
}

.snippet-info {
  margin: 12px 0 0 0;
  font-size: 14px;
  opacity: 0.8;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(83, 141, 78, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(83, 141, 78, 0); }
}

/* ====== GUESS BOX ====== */
.guess-box {
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 15px;
  background: #2a2a2b;
  color: white;
  transition: border-color 0.2s ease;
}

input:focus {
  outline: none;
  border-color: #538d4e;
}

#guessBtn {
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  background: #538d4e;
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#guessBtn:hover {
  background: #6aaa64;
  transform: translateY(-2px);
}

#guessBtn:active {
  transform: translateY(0);
}

/* ====== MESSAGE ====== */
#message {
  margin-top: 20px;
  font-size: 15px;
  min-height: 20px;
  font-weight: 500;
}

#message .song-title {
  display: block;
  font-size: 18px;
  font-weight: bold;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#message.correct {
  color: #6aaa64;
  animation: bounceIn 0.5s ease;
}

#message.wrong {
  color: #e57373;
  animation: shake 0.4s ease;
}

/* ====== CONTINUE BUTTON ====== */
#continueBtn {
  margin-top: 15px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: #538d4e;
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  animation: fadeIn 0.3s ease;
}

#continueBtn:hover {
  background: #6aaa64;
  transform: translateY(-2px);
}

#continueBtn:active {
  transform: translateY(0);
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-8px); }
}

/* ====== REWARD ====== */
.hidden {
  display: none;
}

#reward {
  margin-top: 25px;
  padding: 18px;
  background: rgba(83, 141, 78, 0.15);
  border: 2px solid #538d4e;
  border-radius: 10px;
  animation: fadeIn 0.5s ease;
}

#reward h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #6aaa64;
}

#reward p {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== MOBILE ====== */
@media (max-width: 400px) {
  .back-button {
    top: 10px;
    left: 10px;
    padding: 8px 12px;
  }
  
  .back-button span {
    display: none;
  }
  
  .game-container {
    padding: 20px 15px;
  }
  
  .play-btn {
    width: 70px;
    height: 70px;
  }
  
  .play-icon {
    width: 30px;
    height: 30px;
  }
  
  .timeline-container {
    margin-top: 15px;
  }
  
  .timeline-playhead {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }
  
  .marker {
    font-size: 9px;
    padding: 2px 4px;
  }
}
