@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
  background: linear-gradient(180deg, #0a1628 0%, #1a2a4a 40%, #2a4a6a 70%, #3a6a8a 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  color: #e0f0ff;
  overflow: hidden;
}

#game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 눈 파티클 */
#snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.snowflake {
  position: fixed;
  top: -10px;
  color: white;
  font-size: 10px;
  opacity: 0.7;
  animation: fall linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(360deg);
  }
}

/* 헤더 */
header {
  z-index: 1;
}

.penguin-logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.penguin-char {
  font-size: 36px;
  animation: waddle 1s ease-in-out infinite alternate;
}

.penguin-char:last-child {
  animation-delay: 0.5s;
}

@keyframes waddle {
  from { transform: rotate(-10deg); }
  to { transform: rotate(10deg); }
}

h1 {
  font-size: 24px;
  text-shadow: 0 0 20px #4af, 0 0 40px #28f;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff, #8cf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 게임 컨테이너 */
#game-container {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  z-index: 1;
}

/* 패널 */
.panel-box {
  background: rgba(10, 20, 40, 0.8);
  border: 2px solid rgba(100, 180, 255, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 15px rgba(40, 100, 200, 0.2), inset 0 0 15px rgba(40, 100, 200, 0.05);
}

.panel-box h3 {
  font-size: 10px;
  text-align: center;
  margin-bottom: 8px;
  color: #8cf;
  letter-spacing: 2px;
}

#hold-canvas, #next-canvas {
  display: block;
  margin: 0 auto;
}

/* 스탯 */
.stats {
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 8px;
  color: #6aa;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 10px #4af;
}

/* 펭귄 무드 */
.penguin-mood {
  text-align: center;
}

.mood-penguin {
  font-size: 40px;
  transition: transform 0.3s;
}

.mood-text {
  font-size: 8px;
  margin-top: 5px;
  color: #adf;
}

.mood-penguin.happy {
  animation: jump 0.4s ease-out;
}

.mood-penguin.sad {
  transform: rotate(180deg) scaleX(-1);
}

.mood-penguin.excited {
  animation: dance 0.5s ease-in-out 3;
}

@keyframes jump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes dance {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-15deg) scale(1.1); }
  75% { transform: rotate(15deg) scale(1.1); }
}

/* 보드 */
#board-wrapper {
  position: relative;
  border: 3px solid rgba(100, 180, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(40, 100, 200, 0.3), inset 0 0 30px rgba(40, 100, 200, 0.1);
  background: rgba(5, 10, 25, 0.9);
}

#game-canvas {
  display: block;
}

/* 오버레이 */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 10, 30, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 5px;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
}

.big-penguin {
  font-size: 64px;
  animation: waddle 0.8s ease-in-out infinite alternate;
  margin-bottom: 15px;
}

.overlay-content h2 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #8cf;
  text-shadow: 0 0 15px #4af;
}

.overlay-content p {
  font-size: 10px;
  margin-bottom: 20px;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.controls-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 8px;
  color: #6aa;
}

/* 펭귄 응원단 */
#cheerleaders {
  display: flex;
  gap: 20px;
  font-size: 28px;
  z-index: 1;
  margin-top: 5px;
}

.cheerleader {
  animation: cheer 2s ease-in-out infinite;
  transition: transform 0.3s;
}

.cheerleader:nth-child(1) { animation-delay: 0s; }
.cheerleader:nth-child(2) { animation-delay: 0.4s; }
.cheerleader:nth-child(3) { animation-delay: 0.8s; }
.cheerleader:nth-child(4) { animation-delay: 1.2s; }
.cheerleader:nth-child(5) { animation-delay: 1.6s; }

@keyframes cheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-5deg); }
  75% { transform: translateY(-8px) rotate(5deg); }
}

.cheerleader.celebrating {
  animation: celebrate 0.3s ease-out 4;
}

@keyframes celebrate {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.3); }
}

/* 콤보 */
.combo-display {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: #ff0;
  text-shadow: 0 0 20px #f80, 0 0 40px #f40;
  z-index: 100;
  pointer-events: none;
  animation: comboIn 1s ease-out forwards;
}

.combo-display.hidden {
  display: none;
}

@keyframes comboIn {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* 줄 클리어 이펙트 */
.line-clear-flash {
  animation: flash 0.3s ease-out;
}

@keyframes flash {
  0% { filter: brightness(3); }
  100% { filter: brightness(1); }
}

/* 반응형 */
@media (max-width: 700px) {
  h1 { font-size: 14px; }
  .penguin-char { font-size: 24px; }
  #left-panel, #right-panel { display: none; }
}
