/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050505;
  --red:   #ff3355;
  --blue:  #33aaff;
  --green: #33ff88;
  --yellow:#33aaff;
  --glow-red:   0 0 8px #ff3355, 0 0 20px #ff335588;
  --glow-blue:  0 0 8px #33aaff, 0 0 20px #33aaff88;
  --glow-green: 0 0 8px #33ff88, 0 0 20px #33ff8888;
  --panel-bg: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.08);
  --text: #e8e8e8;
  --text-dim: #888;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
}

/* ===== LAYOUT ===== */
#app {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  gap: 16px;
  padding: 12px;
}

/* ===== PANELS ===== */
#left-panel, #right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 130px;
  flex-shrink: 0;
  align-self: flex-start;
}

.panel-section {
  background: var(--panel-bg);
  border: 1px solid rgba(51,170,255,0.25);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

#score, #level, #lines, #connects, #combo {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

#combo {
  color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow), 0 0 20px #ffee3355;
  font-size: 20px;
}

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

/* ===== BOARD ===== */
#board-wrapper {
  position: relative;
  flex-shrink: 0;
}

#game-canvas {
  display: block;
  border: 1px solid rgba(51,255,136,0.35);
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,0,0,0.8), inset 0 0 60px rgba(0,0,0,0.5),
              0 0 12px rgba(51,255,136,0.15);
  transition: box-shadow 0.3s, border-color 0.3s;
}

/* Time Freeze: ボード枠を青く */
#board-wrapper.frozen #game-canvas {
  border-color: var(--blue);
  box-shadow: 0 0 30px rgba(0,0,0,0.8),
              0 0 20px rgba(51,170,255,0.6),
              0 0 50px rgba(51,170,255,0.3);
  animation: freeze-pulse 1s ease-in-out infinite;
}

@keyframes freeze-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(51,170,255,0.5), 0 0 50px rgba(51,170,255,0.2); }
  50%       { box-shadow: 0 0 30px rgba(51,170,255,0.9), 0 0 70px rgba(51,170,255,0.5); }
}

/* ===== OVERLAY ===== */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,5,1.0);
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(255,51,85,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(51,170,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(51,255,136,0.06) 0%, transparent 60%);
  border-radius: 4px;
  gap: 16px;
  z-index: 10;
}
#overlay.hidden { display: none; }

#overlay-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(90deg, #ff3355 0%, #33aaff 50%, #33ff88 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 3s ease-in-out infinite alternate;
}
@keyframes titleGlow {
  0%   { filter: drop-shadow(0 0 10px rgba(255,51,85,0.9))  drop-shadow(0 0 20px rgba(51,170,255,0.5)); }
  50%  { filter: drop-shadow(0 0 14px rgba(51,170,255,1.0)) drop-shadow(0 0 28px rgba(51,255,136,0.6)); }
  100% { filter: drop-shadow(0 0 10px rgba(51,255,136,0.9)) drop-shadow(0 0 20px rgba(255,51,85,0.5)); }
}

#overlay-sub {
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
  background: linear-gradient(90deg, #ff3355, #33aaff, #33ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.85;
}

#overlay-btn.hidden { display: none !important; }

#overlay-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 12px 32px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  cursor: pointer;
  text-shadow: var(--glow-green);
  box-shadow: var(--glow-green);
  transition: background 0.2s;
}
#overlay-btn:hover { background: rgba(51,255,136,0.12); }

/* ===== GAUGES ===== */
.gauge-block {
  background: var(--panel-bg);
  border: 1px solid rgba(255,51,85,0.25);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gauge-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
}
.gauge-name {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

#gauge-red   .gauge-label { color: var(--red);   text-shadow: var(--glow-red); }
#gauge-blue  .gauge-label { color: var(--blue);  text-shadow: var(--glow-blue); }
#gauge-green .gauge-label { color: var(--green); text-shadow: var(--glow-green); }

.gauge-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.gauge-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

#gauge-red   .gauge-bar { background: var(--red);   box-shadow: var(--glow-red); }
#gauge-blue  .gauge-bar { background: var(--blue);  box-shadow: var(--glow-blue); }
#gauge-green .gauge-bar { background: var(--green); box-shadow: var(--glow-green); }

.skill-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  padding: 5px 0;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: not-allowed;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.skill-btn.ready {
  cursor: pointer;
  animation: pulse-btn 1.2s ease-in-out infinite;
}

#gauge-red   .skill-btn.ready { color: var(--red);   border-color: var(--red);   box-shadow: var(--glow-red); }
#gauge-blue  .skill-btn.ready { color: var(--blue);  border-color: var(--blue);  box-shadow: var(--glow-blue); }
#gauge-green .skill-btn.ready { color: var(--green); border-color: var(--green); box-shadow: var(--glow-green); }

/* スキル発動中: ゲージブロック全体を強調 */
.gauge-block.skill-active {
  animation: skill-active-pulse 0.5s ease-in-out infinite;
}
#gauge-red.skill-active   { border-color: var(--red);   box-shadow: var(--glow-red); }
#gauge-blue.skill-active  { border-color: var(--blue);  box-shadow: var(--glow-blue); }
#gauge-green.skill-active { border-color: var(--green); box-shadow: var(--glow-green); }

@keyframes skill-active-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.75; transform: scale(1.02); }
}

/* Laser選択モード中: REDゲージをさらに強調 */
#gauge-red.skill-active .gauge-label {
  animation: laser-label 0.4s ease-in-out infinite;
}
@keyframes laser-label {
  0%, 100% { letter-spacing: 2px; }
  50%       { letter-spacing: 4px; }
}

@keyframes pulse-btn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

#skill-info {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  min-height: 30px;
  letter-spacing: 0.5px;
  line-height: 1.5;
  padding: 4px;
}

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 8px 12px 12px;
  background: rgba(5,5,5,0.9);
  border-top: 1px solid var(--border);
  justify-content: center;
  gap: 8px;
  z-index: 20;
}

.mob-btn {
  width: 56px; height: 50px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
.mob-btn:active { background: rgba(255,255,255,0.12); }

.key-hint {
  font-size: 9px;
  opacity: 0.45;
  letter-spacing: 0;
  font-family: 'Share Tech Mono', monospace;
}
.skill-btn.ready .key-hint { opacity: 0.8; }

/* パネル非表示（タイトル時） */
#left-panel.hidden,
#right-panel.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#left-panel,
#right-panel {
  transition: opacity 0.3s;
}

/* ===== FLASH EFFECT ===== */
#flash-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.05s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  /* body全体を縦flexに */
  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
  height: 100dvh;
    overflow: hidden;
  }

  /* ③ #app: フィールドを中央基準に */
  #app {
    flex: 1 1 auto;
    gap: 6px;
    padding: 6px 4px 0;
    height: auto;
    align-items: flex-start;
    justify-content: center; /* ③ 横方向も中央 */
    overflow: visible;
  }

  /* 左パネル: コンパクト化 */
  #left-panel { width: 64px; gap: 5px; flex-shrink: 0; align-self: flex-start; }
  #left-panel .panel-section { padding: 5px 4px; }
  #score, #level, #lines, #connects { font-size: 14px; }
  #combo { font-size: 13px; }
  .label { font-size: 7px; letter-spacing: 1px; }

  /* 右パネル: コンパクト化 */
  #right-panel { width: 68px; gap: 5px; flex-shrink: 0; align-self: flex-start; }
  .gauge-block { padding: 5px 4px; }
  .gauge-label { font-size: 7px; }
  .gauge-name { font-size: 8px; }
  .skill-btn { font-size: 9px; padding: 3px 0; }
  #skill-info { display: none; }
  .next-section canvas { width: 60px !important; height: 44px !important; }
  .btn-pause-game { height: 28px; font-size: 0.9rem; }

  /* 操作ボタン：staticフロー、中央寄せ */
  #mobile-controls {
    display: flex;
    position: static;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 0;
    height: 56px;
    background: rgba(5,5,5,0.9);
  }

  /* スキルボタン：操作ボタン直下 */
  #mobile-skills {
    display: flex !important;
    position: static;
    flex: 0 0 auto;
    height: 48px;
    margin-top: 0;
    background: rgba(5,5,5,0.95);
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 12px 4px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  /* ① タイトル画面ではモバイルボタンを非表示 */
  body.on-title #mobile-controls,
  body.on-title #mobile-skills {
    display: none !important;
  }
}

@media (max-width: 400px) {
  #left-panel  { width: 56px; }
  #right-panel { width: 60px; }
  #app { gap: 4px; }
}

/* Scanline texture */
#board-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: 4px;
}

/* ===== NS MODALS ===== */
.ns-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.ns-modal.hidden { display: none; }

.ns-modal-box {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 2rem 2.4rem;
  min-width: 300px;
  max-width: 420px;
  width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.ns-modal-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #33ff88;
  letter-spacing: 3px;
  text-align: center;
}
.ns-modal-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin: 0;
}

.ns-name-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  padding: 0.55rem 0.8rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.ns-name-input:focus { border-color: #33ff88; }

.ns-name-error {
  font-size: 0.75rem;
  color: #ff3355;
  min-height: 1em;
}

.ns-btn-primary {
  background: transparent;
  border: 1px solid #33ff88;
  color: #33ff88;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  letter-spacing: 2px;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.ns-btn-primary:hover { background: rgba(51,255,136,0.12); box-shadow: 0 0 12px rgba(51,255,136,0.4); }

.ns-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 1px;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.ns-btn-secondary:hover { border-color: rgba(255,255,255,0.5); }

.ns-modal-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Settings rows */
.ns-setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ns-setting-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
}

/* Toggle */
.ns-toggle { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.ns-toggle input { display: none; }
.ns-toggle-track {
  width: 48px; height: 26px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
}
.ns-toggle input:checked ~ .ns-toggle-track { background: rgba(51,255,136,0.3); border-color: #33ff88; }
.ns-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: transform 0.2s, background 0.2s;
}
.ns-toggle input:checked ~ .ns-toggle-track::after {
  transform: translateX(22px);
  background: #33ff88;
}
.ns-toggle-labels {
  display: flex; gap: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* Ranking */
.ns-ranking-box { max-width: 480px; }
.ns-rank-empty { text-align: center; color: rgba(255,255,255,0.35); font-size: 0.9rem; }
.ns-rank-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.88rem;
}
.ns-rank-row.ns-rank-top { color: #ffd700; }
.ns-rank-pos { font-size: 1.1rem; text-align: center; }
.ns-rank-name { font-family: 'Share Tech Mono', monospace; color: rgba(255,255,255,0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-rank-score { font-family: 'Orbitron', monospace; font-weight: 700; color: #33ff88; white-space: nowrap; }
.ns-rank-date { font-size: 0.72rem; color: rgba(255,255,255,0.3); white-space: nowrap; }

/* Title player row */
.title-player-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--green);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(51,255,136,0.6);
}
.title-icon-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.title-icon-btn:hover { border-color: #33ff88; color: #33ff88; }

#title-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 0.6rem;
}
#title-player-row.hidden { display: none; }

/* ===== PAUSE BUTTON ===== */
.btn-pause-game {
  margin-top: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
  font-size: 1.1rem;
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, color 0.2s;
}
.btn-pause-game:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.8); }

/* ===== GAME OVER MODAL ===== */
.go-box { max-width: 400px; }
.go-emoji { font-size: 2.5rem; text-align: center; }
.go-title { color: #ff3355 !important; }
.go-score-table { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.go-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}
.go-label { color: rgba(255,255,255,0.5); }
.go-val   { font-family: 'Orbitron', monospace; font-weight: 700; color: #fff; }
.go-green { color: #33ff88; }
.go-yellow{ color: #ffee33; }
.go-big   { font-size: 1.3rem; color: #33ff88; text-shadow: 0 0 10px #33ff88; }
.go-bonus-row { opacity: 0.85; }
.go-final-row { padding-top: 0.4rem; }
.go-rank-row  { margin-top: 0.2rem; }
.go-divider   { height: 1px; background: rgba(255,255,255,0.1); margin: 0.4rem 0; }

/* ===== PAUSE MODAL ===== */
.pause-box { max-width: 320px; }
.pause-title { color: #ffee33 !important; }

/* ===== NEXT SECTION (right panel) ===== */
.next-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid rgba(51,255,136,0.2);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 12px;
}
.next-section canvas {
  display: block;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
}

.mob-skill-btn {
  width: 100px;
  height: 38px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  border: 1px solid;
}
.mob-skill-red   { color: var(--red);   border-color: rgba(255,51,85,0.4); }
.mob-skill-blue  { color: var(--blue);  border-color: rgba(51,170,255,0.4); }
.mob-skill-green { color: var(--green); border-color: rgba(51,255,136,0.4); }
.mob-skill-red:active   { background: rgba(255,51,85,0.15);   box-shadow: 0 0 10px rgba(255,51,85,0.4); }
.mob-skill-blue:active  { background: rgba(51,170,255,0.15);  box-shadow: 0 0 10px rgba(51,170,255,0.4); }
.mob-skill-green:active { background: rgba(51,255,136,0.15);  box-shadow: 0 0 10px rgba(51,255,136,0.4); }



/* ===== DIFFICULTY SELECT ===== */
#difficulty-select {
  margin: 12px 0 4px;
  text-align: center;
}
.diff-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}
.diff-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.diff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.18s;
  min-width: 80px;
}
.diff-sub {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
}
.diff-easy   { border: 1px solid rgba(51,255,136,0.45);  color: var(--green);  background: rgba(51,255,136,0.07);  box-shadow: 0 0 10px rgba(51,255,136,0.2); }
.diff-normal { border: 1px solid rgba(51,170,255,0.45);  color: var(--yellow); background: rgba(51,170,255,0.07);  box-shadow: 0 0 10px rgba(51,170,255,0.2); }
.diff-hard   { border: 1px solid rgba(255,51,85,0.45);   color: var(--red);    background: rgba(255,51,85,0.07);   box-shadow: 0 0 10px rgba(255,51,85,0.2); }
.diff-easy:hover,   .diff-easy.selected   { border-color: var(--green);  box-shadow: 0 0 18px rgba(51,255,136,0.55),  inset 0 0 12px rgba(51,255,136,0.08);  background: rgba(51,255,136,0.15);  transform: scale(1.05); }
.diff-normal:hover, .diff-normal.selected { border-color: var(--yellow); box-shadow: 0 0 18px rgba(51,170,255,0.55),  inset 0 0 12px rgba(51,170,255,0.08);  background: rgba(51,170,255,0.15);  transform: scale(1.05); }
.diff-hard:hover,   .diff-hard.selected   { border-color: var(--red);    box-shadow: 0 0 18px rgba(255,51,85,0.55),   inset 0 0 12px rgba(255,51,85,0.08);   background: rgba(255,51,85,0.15);   transform: scale(1.05); }

/* ===== RANKING TABS ===== */
.rank-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.rank-tab {
  flex: 1;
  padding: 6px 0;
  border-radius: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.18s;
}
/* 常時カラー（難易度ボタンと対応） */
#rank-tab-easy   { border: 1px solid rgba(51,255,136,0.4);  color: var(--green);  background: rgba(51,255,136,0.06);  box-shadow: 0 0 8px rgba(51,255,136,0.15); }
#rank-tab-normal { border: 1px solid rgba(51,170,255,0.4);  color: var(--yellow); background: rgba(51,170,255,0.06);  box-shadow: 0 0 8px rgba(51,170,255,0.15); }
#rank-tab-hard   { border: 1px solid rgba(255,51,85,0.4);   color: var(--red);    background: rgba(255,51,85,0.06);   box-shadow: 0 0 8px rgba(255,51,85,0.15); }
/* ホバー・アクティブ時 */
#rank-tab-easy:hover,   #rank-tab-easy.active   { border-color: var(--green);  color: var(--green);  box-shadow: 0 0 16px rgba(51,255,136,0.55);  background: rgba(51,255,136,0.15);  transform: scale(1.04); }
#rank-tab-normal:hover, #rank-tab-normal.active { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 0 16px rgba(51,170,255,0.55);  background: rgba(51,170,255,0.15);  transform: scale(1.04); }
#rank-tab-hard:hover,   #rank-tab-hard.active   { border-color: var(--red);    color: var(--red);    box-shadow: 0 0 16px rgba(255,51,85,0.55);   background: rgba(255,51,85,0.15);   transform: scale(1.04); }

/* ===== GAME OVER DIFFICULTY BADGE ===== */
.go-diff-badge {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--green);
  border: 1px solid rgba(51,255,136,0.4);
  border-radius: 4px;
  padding: 2px 10px;
  display: inline-block;
  margin: -6px auto 6px;
}

/* ===== P-2: GAME OVER FADE-IN ===== */
.fade-in-modal .ns-modal-box {
  animation: modalFadeIn 0.35s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
