/* ===== MUSCLE TETRIS - STYLE ===== */
:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --neon-pink: #ff1493;
  --neon-cyan: #00e5ff;
  --neon-green: #39ff14;
  --neon-gold: #ffd700;
  --text: #e0e0e0;
  --text-dim: #888;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== SCREEN SYSTEM ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: flex;
}

/* ===== BRAND ===== */
.brand {
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--neon-pink);
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--neon-pink);
}

/* ===== TITLE SCREEN ===== */
.game-title {
  text-align: center;
  margin-bottom: 10px;
}

.title-jp {
  display: block;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse-glow 2s ease-in-out infinite;
}

.title-en {
  display: block;
  font-size: clamp(14px, 3vw, 20px);
  color: var(--text-dim);
  letter-spacing: 3px;
}

.title-emoji {
  font-size: clamp(36px, 8vw, 60px);
  margin: 15px 0;
  animation: bounce 1.5s ease-in-out infinite;
}

.description {
  text-align: center;
  margin-bottom: 30px;
}

.desc-jp {
  display: block;
  font-size: clamp(14px, 3vw, 18px);
  color: var(--text);
  margin-bottom: 4px;
}

.desc-en {
  display: block;
  font-size: clamp(11px, 2vw, 14px);
  color: var(--text-dim);
}

.controls-info {
  margin-top: 20px;
  text-align: center;
}

.info-jp {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.info-en {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 60px;
  border: 2px solid var(--neon-cyan);
  background: transparent;
  color: var(--neon-cyan);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  text-shadow: 0 0 8px var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.btn-primary:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
  transform: scale(1.05);
}

.btn-primary .btn-en {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.btn-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s;
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}

.btn-secondary .btn-en {
  font-size: 10px;
  opacity: 0.6;
}

.btn-share {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border: 2px solid var(--neon-green);
  background: transparent;
  color: var(--neon-green);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  text-shadow: 0 0 8px var(--neon-green);
}

.btn-share:hover {
  background: rgba(57, 255, 20, 0.1);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

.btn-share .btn-en {
  font-size: 11px;
  color: var(--text-dim);
}

/* ===== PATREON ===== */
.patreon-link {
  margin-top: 30px;
}

.patreon-link a {
  color: var(--neon-gold);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  transition: all 0.3s;
  display: inline-block;
}

.patreon-link a:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  border-color: var(--neon-gold);
}

/* ===== GAME SCREEN ===== */
.game-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 15px;
  width: 100%;
  max-width: 600px;
}

.game-area {
  position: relative;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3), inset 0 0 20px rgba(0, 229, 255, 0.05);
  border-radius: 4px;
  line-height: 0;
}

#game-canvas {
  display: block;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 90px;
}

.panel-box {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.panel-label {
  margin-bottom: 6px;
}

.panel-label .label-jp {
  display: block;
  font-size: 12px;
  color: var(--neon-pink);
  font-weight: 700;
}

.panel-label .label-en {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.panel-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  font-variant-numeric: tabular-nums;
}

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

/* ===== OVERLAYS ===== */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.overlay-text-jp {
  font-size: 28px;
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow: 0 0 20px var(--neon-pink);
  animation: pulse-glow 1s ease-in-out infinite;
}

.overlay-text-en {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== COMBO DISPLAY ===== */
.combo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: 900;
  color: var(--neon-gold);
  text-shadow: 0 0 20px var(--neon-gold);
  pointer-events: none;
  z-index: 5;
  animation: combo-pop 0.8s ease-out forwards;
}

.combo.hidden {
  display: none;
}

.line-clear-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  pointer-events: none;
  z-index: 5;
  animation: flex-pop 0.6s ease-out forwards;
}

.line-clear-effect.hidden {
  display: none;
}

/* ===== MOBILE CONTROLS ===== */
.mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  width: 100%;
  max-width: 300px;
}

.mobile-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.mobile-btn {
  width: 64px;
  height: 54px;
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 229, 255, 0.05);
  color: var(--neon-cyan);
  font-size: 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-btn:active {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
  transform: scale(0.95);
}

.wide-btn {
  width: auto;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 700;
}

/* ===== RESULT SCREEN ===== */
.result-title {
  text-align: center;
  margin-bottom: 10px;
}

.result-title .title-jp {
  display: block;
  font-size: 32px;
  font-weight: 900;
  color: var(--neon-gold);
  text-shadow: 0 0 15px var(--neon-gold);
}

.result-title .title-en {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 3px;
}

.result-emoji {
  font-size: 48px;
  margin: 10px 0 20px;
}

.result-stats {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 30px;
  min-width: 260px;
  margin-bottom: 25px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label .label-jp {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.stat-label .label-en {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

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

@keyframes combo-pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@keyframes flex-pop {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(-20deg); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.5) rotate(10deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2) rotate(0deg); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .mobile-controls {
    display: flex;
  }

  .side-panel {
    min-width: 70px;
  }

  .panel-value {
    font-size: 18px;
  }

  .controls-info {
    display: none;
  }

  .game-layout {
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .left-panel .panel-box:not(.score-box) {
    display: none;
  }

  .side-panel {
    min-width: 55px;
  }
}
