/* Unified Game Panel - Mobile-First Optimized Design */

/* Mobile-First Container Styles */
.unified-panel {
  display: flex;
  flex-direction: column;
  width: calc(100% - 16px);
  max-width: 100%;
  margin: 8px auto 16px;
  background: linear-gradient(135deg, 
    rgba(10, 15, 30, 0.95) 0%, 
    rgba(15, 25, 40, 0.92) 100%);
  border: 1px solid rgba(0, 226, 255, 0.25);
  border-radius: 12px;
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 226, 255, 0.1);
  overflow: hidden;
  position: relative;
}

/* Remove rotating border glow animation completely */
.unified-panel::before {
  display: none;
}

/* Mobile-Optimized Panel Sections */
.panel-section {
  padding: 12px 14px;
  position: relative;
}

.panel-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(0, 226, 255, 0.15);
}

.panel-section:last-child::after {
  display: none;
}

/* Top Section - Mobile Optimized */
.top-section {
  background: rgba(0, 226, 255, 0.04);
  padding-top: 14px;
  padding-bottom: 10px;
}

/* Character Stats - Mobile Touch Friendly */
.character-stats-scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.character-value {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  /* Minimum touch target size */
  min-height: 44px;
  flex: 0 1 auto;
}

.character-value .char-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-value .char-number {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Audiowide', cursive;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Score and Combo - Mobile Layout */
.score-combo-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
}

/* Mobile Score Display */
.score-display {
  flex: 1;
  text-align: center;
  background: rgba(255, 204, 0, 0.08);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 204, 0, 0.15);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-label {
  font-size: 10px;
  color: #ffce00;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2px;
  font-weight: 600;
  opacity: 0.8;
}

.score-display .score-value {
  font-size: 32px;
  font-weight: 800;
  color: #ffce00;
  text-shadow: 0 2px 6px rgba(255, 204, 0, 0.4);
  font-family: 'Audiowide', cursive;
  line-height: 1;
}

/* Mobile Combo Display */
.combo-display {
  background: rgba(0, 226, 255, 0.08);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 226, 255, 0.15);
  min-width: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.combo-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  font-family: 'Audiowide', cursive;
}

.combo-counter .combo-value {
  font-size: 26px;
  font-weight: 700;
  color: #00e2ff;
  text-shadow: 0 2px 4px rgba(0, 226, 255, 0.4);
  line-height: 1;
}

.combo-counter .combo-x {
  font-size: 16px;
  color: rgba(0, 226, 255, 0.6);
  font-weight: 600;
}

.combo-tier {
  font-size: 10px;
  font-weight: 600;
  color: #00e2ff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
  text-align: center;
  opacity: 0.8;
}

/* Middle Section - Compact Mobile Layout */
.middle-section {
  background: rgba(0, 0, 0, 0.15);
  padding: 12px 14px;
}

.difficulty-threshold-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.section-label {
  font-size: 10px;
  color: #8899bb;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 600;
  text-align: center;
  opacity: 0.8;
}

/* Mobile Difficulty Section */
.difficulty-section {
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.difficulty-meter-container {
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.difficulty-meter {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #4cff00, #ffce00, #ff4f65);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.difficulty-value {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Audiowide', cursive;
}

/* Mobile Threshold Section */
.threshold-section {
  background: rgba(255, 50, 50, 0.1);
  border: 1px solid rgba(255, 50, 50, 0.25);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Simplified animation for mobile */
.threshold-section::before {
  display: none;
}

.threshold-section .section-label {
  color: #ff8888;
}

.threshold-value {
  font-size: 22px;
  font-weight: 700;
  color: #ff4444;
  text-shadow: 0 2px 4px rgba(255, 0, 0, 0.4);
  font-family: 'Audiowide', cursive;
  position: relative;
  z-index: 1;
}

.threshold-warning {
  font-size: 9px;
  color: #ffbb00;
  background: rgba(255, 165, 0, 0.12);
  border: 1px solid rgba(255, 165, 0, 0.25);
  border-radius: 4px;
  padding: 3px 8px;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Mobile Combo Timer */
.combo-timer-container {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.combo-timer {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00e2ff, #0066ff);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Bottom Section - Mobile Optimized */
.bottom-section {
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
}

/* Mobile Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  min-height: 32px;
}

.stat-label {
  color: #7788aa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.stat-value {
  font-weight: 700;
  color: #ffffff;
  font-family: 'Audiowide', cursive;
  font-size: 12px;
}

/* Mobile Recent Scores */
.recent-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 100px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Thin scrollbar for mobile */
.recent-scores::-webkit-scrollbar {
  width: 3px;
}

.recent-scores::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 2px;
}

.recent-scores::-webkit-scrollbar-thumb {
  background: rgba(0, 226, 255, 0.3);
  border-radius: 2px;
}

/* Mobile Score Entries */
.score-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 11px;
  border-left: 2px solid;
  min-height: 32px;
}

.score-entry-action {
  color: #99aabb;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

.score-entry-points {
  font-weight: 700;
  color: #ffffff;
  font-size: 11px;
  font-family: 'Audiowide', cursive;
}

/* Score Entry Types */
.score-entry-success {
  border-left-color: #4cff00;
}

.score-entry-failure {
  border-left-color: #ff4f65;
}

.score-entry-combo {
  border-left-color: #ffce00;
}

.score-entry-powerup {
  border-left-color: #00e2ff;
}

/* Simplified animations for mobile */
@keyframes score-entry-slide {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.value-change {
  animation: value-pulse 0.3s ease;
}

@keyframes value-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Mobile-specific danger state */
.threshold-section.danger {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.4);
  animation: danger-pulse 2s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
  }
  50% { 
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
  }
}

/* Enhanced 16:9 Mobile Optimization - Sidebar Layout */
@media (max-width: 768px) and (min-aspect-ratio: 16/9) {
  .unified-panel {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: 
      -2px 0 8px rgba(0, 0, 0, 0.4),
      0 0 20px rgba(0, 226, 255, 0.1) !important;
    background: linear-gradient(135deg, 
      rgba(10, 15, 30, 0.98) 0%, 
      rgba(15, 25, 40, 0.95) 100%) !important;
    border-left: 2px solid rgba(0, 226, 255, 0.3) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  .panel-section {
    padding: 6px 10px !important;
  }
  
  .top-section {
    padding-top: 8px !important;
    padding-bottom: 6px !important;
  }
  
  /* Character stats - 2x2 grid for compact display */
  .character-stats-scoreboard {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3px !important;
    margin-bottom: 6px !important;
  }
  
  .character-value {
    padding: 3px 5px !important;
    min-height: 28px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  
  .character-value .char-icon {
    width: 14px !important;
    height: 14px !important;
  }
  
  .character-value .char-number {
    font-size: 12px !important;
  }
  
  /* Score/combo vertical stack for sidebar */
  .score-combo-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  
  .score-display,
  .combo-display {
    padding: 4px 6px !important;
    min-height: 32px !important;
    border-radius: 6px !important;
  }
  
  .score-display .score-value {
    font-size: 16px !important;
  }
  
  .combo-counter .combo-value {
    font-size: 14px !important;
  }
  
  .combo-counter .combo-x {
    font-size: 10px !important;
  }
  
  .score-label,
  .combo-tier {
    font-size: 8px !important;
  }
  
  /* Difficulty/threshold vertical stack */
  .difficulty-threshold-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
  }
  
  .section-label {
    font-size: 8px !important;
    margin-bottom: 3px !important;
  }
  
  .difficulty-section,
  .threshold-section {
    padding: 4px 6px !important;
    border-radius: 6px !important;
  }
  
  .difficulty-meter-container {
    height: 3px !important;
    margin: 3px 0 !important;
  }
  
  .difficulty-value,
  .threshold-value {
    font-size: 12px !important;
  }
  
  .threshold-warning {
    font-size: 7px !important;
    padding: 1px 3px !important;
    margin-top: 2px !important;
  }
  
  /* Bottom section ultra-compact */
  .bottom-section {
    padding: 4px 10px 6px !important;
    gap: 4px !important;
  }
  
  .stats-section {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2px !important;
  }
  
  .stat-row {
    padding: 2px 4px !important;
    font-size: 9px !important;
    min-height: 20px !important;
    border-radius: 4px !important;
  }
  
  .stat-label {
    font-size: 8px !important;
  }
  
  .stat-value {
    font-size: 9px !important;
  }
  
  /* Recent scores ultra-compact */
  .recent-scores {
    max-height: 50px !important;
    gap: 1px !important;
  }
  
  .score-entry {
    padding: 2px 4px !important;
    font-size: 8px !important;
    min-height: 16px !important;
    border-radius: 3px !important;
  }
  
  .score-entry-action {
    font-size: 7px !important;
    max-width: 40px !important;
  }
  
  .score-entry-points {
    font-size: 8px !important;
  }
  
  /* Combo timer minimal */
  .combo-timer-container {
    height: 1px !important;
  }
  
  /* Enhanced scrollbar for sidebar */
  .unified-panel::-webkit-scrollbar {
    width: 3px !important;
  }
  
  .unified-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 226, 255, 0.5) !important;
    border-radius: 2px !important;
  }
  
  .unified-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1) !important;
  }
  
  /* Remove section dividers for cleaner look */
  .panel-section::after {
    display: none !important;
  }
  
  /* Add subtle separation between sections */
  .panel-section:not(:last-child) {
    border-bottom: 1px solid rgba(0, 226, 255, 0.1) !important;
    margin-bottom: 2px !important;
    padding-bottom: 4px !important;
  }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 767px) {
  .unified-panel {
    max-width: 460px;
    margin: 12px auto 20px;
  }
  
  .panel-section {
    padding: 14px 16px;
  }
  
  .score-display .score-value {
    font-size: 36px;
  }
  
  .combo-counter .combo-value {
    font-size: 30px;
  }
  
  .bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .stats-section {
    grid-template-columns: 1fr;
  }
}

/* Small Desktop and up */
@media (min-width: 768px) {
  .unified-panel {
    max-width: 480px;
    margin: 0 auto 20px;
    border-radius: 24px;
    box-shadow: 
      0 10px 40px rgba(0, 0, 0, 0.8),
      0 0 80px rgba(0, 226, 255, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
  }
  
  .panel-section {
    padding: 18px 20px;
  }
  
  .panel-section::after {
    background: linear-gradient(90deg, 
      transparent,
      rgba(0, 226, 255, 0.2) 20%,
      rgba(0, 226, 255, 0.2) 80%,
      transparent);
  }
  
  .character-value {
    padding: 10px 16px;
  }
  
  .character-value .char-number {
    font-size: 22px;
    text-shadow: 
      0 0 10px rgba(0, 226, 255, 0.5),
      0 2px 4px rgba(0, 0, 0, 0.8);
  }
  
  .score-display .score-value {
    font-size: 44px;
    background: linear-gradient(180deg, #ffea00, #ff9500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(255, 204, 0, 0.5));
  }
  
  .combo-counter .combo-value {
    font-size: 32px;
    background: linear-gradient(180deg, #00e2ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 6px rgba(0, 226, 255, 0.5));
  }
  
  .bottom-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    padding: 18px 20px 20px;
  }
  
  .stats-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .threshold-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(255, 100, 100, 0.2) 50%, 
      transparent 100%);
    transform: translateX(-100%);
    animation: threshold-sweep 3s linear infinite;
    display: block;
  }
  
  @keyframes threshold-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .game-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    align-items: start;
  }
  
  .unified-panel {
    width: 100%;
    max-width: none;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: 0;
  }
  
  #game-board {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
  }
}

/* High-DPI Screen Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .unified-panel {
    border-width: 0.5px;
  }
  
  .panel-section::after {
    height: 0.5px;
  }
} 