* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Responsive game width ── */
:root {
  /* Mobile Normal default: same height as Easy, width = Easy×400/500 (JS overrides) */
  --game-w: min(calc((100vh - 200px) * 400 / 620), calc((100vw - 16px) * 400 / 500));
}
@media (min-width: 600px) {
  :root {
    --game-w: min(400px, 100vw, calc((100vh - 250px) * 400 / 620));
  }
}

/* ── Header ── */
#game-header {
  width: var(--game-w);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#score-display {
  width: var(--game-w);
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label {
  font-size: 10px;
  color: #888;
  letter-spacing: 0.05em;
}

#score-value {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  line-height: 1.2;
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#pause-btn {
  background: #d4820a;
  color: #fff;
  border: 1px solid #b86e08;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  min-width: 88px;
  transition: background 0.15s, color 0.15s;
}

#pause-btn:hover {
  background: #b86e08;
}

#pause-btn.active {
  background: #9a5c06;
  border-color: #7a4904;
}

#pause-btn.active:hover {
  background: #7a4904;
}

#restart-btn {
  background: #27ae60;
  color: #fff;
  border: 1px solid #1e8449;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#restart-btn:hover {
  background: #1e8449;
}

#restart-btn.gameover {
  background: #e74c3c;
  color: #fff;
  border-color: #c0392b;
  animation: pulse 1s ease-in-out infinite;
}

#restart-btn.gameover:hover {
  background: #c0392b;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

#easy-btn {
  background: #2980b9;
  color: #fff;
  border: 1px solid #1a6fa0;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  min-width: 80px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#easy-btn:hover {
  background: #1a6fa0;
}

#easy-btn.active {
  background: #5dade2;
  color: #fff;
  border-color: #3498db;
}

#easy-btn.active:hover {
  background: #3498db;
}


#demo-btn {
  background: #3a3a5c;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  min-width: 65px;
  transition: background 0.15s;
}

#demo-btn:hover {
  background: #555580;
}

#demo-btn.active {
  background: #e67e22;
  border-color: #d35400;
}

#demo-btn.active:hover {
  background: #d35400;
}

#exhibition-btn {
  background: #3a3a5c;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  min-width: 100px;
  transition: background 0.15s;
}

#exhibition-btn:hover {
  background: #555580;
}

#exhibition-btn.active {
  background: #e67e22;
  border-color: #d35400;
  animation: pulse 1s ease-in-out infinite;
}

#exhibition-btn.active:hover {
  background: #d35400;
}

/* BGM の ON/OFF。ON のときは緑（Easy の青、Demo/Exhibition のオレンジと区別する） */
#bgm-btn {
  background: #3a3a5c;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  min-width: 55px;
  transition: background 0.15s;
}

#bgm-btn:hover {
  background: #555580;
}

#bgm-btn.active {
  background: #27ae60;
  color: #fff;
  border-color: #1e8449;
}

#bgm-btn.active:hover {
  background: #1e8449;
}

/* ── Watermelon count display ── */
#watermelon-display {
  width: var(--game-w);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 0;
}

.wm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wm-divider {
  width: 1px;
  height: 30px;
  background: #444;
  margin: 0 4px;
}

#wm-born,
#wm-merged,
#wm-good {
  font-size: 18px;
  font-weight: bold;
  color: #5dade2;
  line-height: 1.2;
  transition: transform 0.4s ease-out;
}

/* ── Count ghost (burst large → settle to counter size) ── */
.count-ghost-excellent,
.count-ghost-ready,
.count-ghost-good {
  font-size: 18px;
  font-weight: bold;
  color: #5dade2;
  text-shadow: 0 0 7px #fff, 0 0 20px #5dade2, 0 0 40px #5dade2, 0 2px 4px rgba(0,0,0,0.6);
  animation: count-ghost-settle 0.8s ease-out forwards;
}

@keyframes count-ghost-settle {
  0%   { transform: scale(2.2); opacity: 1; }
  80%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1.0); opacity: 0; }
}

/* ── Count animation (post-ghost, synchronized with toast) ── */
.count-blink-active {
  animation: ready-blink-anim 1.1s ease-in-out -850ms infinite;
}

.count-fadeout-active {
  animation: ready-fadeout-anim 0.55s ease-out forwards;
}

.count-glow-fade-active {
  animation: count-glow-fade-short 4150ms ease-out forwards;
}

@keyframes count-glow-fade-short {
  0%   { text-shadow: 0 0 5px rgba(255,255,255,0.7), 0 0 14px rgba(255,255,255,0.5), 0 0 28px rgba(255,255,255,0.2); }
  70%  { text-shadow: 0 0 5px rgba(255,255,255,0.7), 0 0 14px rgba(255,255,255,0.5), 0 0 28px rgba(255,255,255,0.2); }
  100% { text-shadow: 0 0 5px rgba(255,255,255,0),   0 0 14px rgba(255,255,255,0),   0 0 28px rgba(255,255,255,0); }
}

/* ── Toast area ── */
#toast-area {
  position: relative;
  width: var(--game-w);
  height: 52px;
  pointer-events: none;
  z-index: 101;
}

#merge-toast,
#ready-toast {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  letter-spacing: 0.08em;
  opacity: 0;
}

#merge-toast {
  font-size: 44px;
  color: #FFD600;
  text-shadow: 0 0 7px #fff, 0 0 20px #FFD600, 0 0 40px #FFC400, 0 0 70px #FFAB00, 0 2px 4px rgba(0,0,0,0.6);
}

#ready-toast {
  font-size: 32px;
}

#ready-toast.good-mode {
  color: #00C853;
  text-shadow: 0 0 7px #fff, 0 0 20px #00C853, 0 0 40px #00C853, 0 0 70px #00E676, 0 2px 4px rgba(0,0,0,0.6);
}

#ready-toast.ready-mode {
  color: #00B0FF;
  text-shadow: 0 0 7px #fff, 0 0 20px #00B0FF, 0 0 40px #00B0FF, 0 0 70px #0091EA, 0 2px 4px rgba(0,0,0,0.6);
}

#merge-toast.toast-active {
  animation: toast-pop 10s ease-out forwards;
}

#ready-toast.toast-active {
  animation: ready-pop 5s ease-out forwards;
}

@keyframes toast-pop {
  0%   { opacity: 1; transform: scale(1.5) translateY(0); }
  8%   { opacity: 1; transform: scale(1.0) translateY(0); }
  80%  { opacity: 1; transform: scale(1.0) translateY(-6px); }
  100% { opacity: 0; transform: scale(0.95) translateY(-18px); }
}

@keyframes ready-pop {
  0%   { opacity: 1; transform: scale(1.2) translateY(0); }
  12%  { opacity: 1; transform: scale(1.0) translateY(0); }
  80%  { opacity: 1; transform: scale(1.0) translateY(-4px); }
  100% { opacity: 0; transform: scale(0.97) translateY(-12px); }
}

#ready-toast.ready-blink,
#merge-toast.merge-blink {
  animation: ready-blink-anim 1.1s ease-in-out infinite;
}

@keyframes ready-blink-anim {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.1; }
}

#ready-toast.ready-fadeout,
#merge-toast.ready-fadeout {
  animation: ready-fadeout-anim 0.55s ease-out forwards;
}

@keyframes ready-fadeout-anim {
  from { opacity: 1; }
  to   { opacity: 0; }
}

#asset-warning-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #c0392b;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  padding: 6px 12px;
}

#asset-warning-banner.hidden {
  display: none;
}

/* ── Event flash overlay ── */
#event-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: 0 0 6px 6px;
  z-index: 10;
}

#event-flash.flash-good {
  animation: flash-good-anim 0.55s ease-out forwards;
}

#event-flash.flash-ready {
  animation: flash-ready-anim 0.65s ease-out forwards;
}

#event-flash.flash-excellent {
  animation: flash-excellent-anim 0.85s ease-out forwards;
}

@keyframes flash-good-anim {
  0%   { opacity: 0.4; background: #00C853; }
  100% { opacity: 0;   background: #00C853; }
}

@keyframes flash-ready-anim {
  0%   { opacity: 0.45; background: #00B0FF; }
  100% { opacity: 0;    background: #00B0FF; }
}

@keyframes flash-excellent-anim {
  0%   { opacity: 0.55; background: #FFD600; }
  100% { opacity: 0;    background: #FFD600; }
}

/* ── Shake (Excellent) ── */
#game-area.shake-excellent {
  animation: shake-excellent-anim 0.45s ease-out;
}

@keyframes shake-excellent-anim {
  0%   { transform: translate(0,    0   ); }
  15%  { transform: translate(-8px, -4px); }
  30%  { transform: translate( 8px,  4px); }
  45%  { transform: translate(-6px,  2px); }
  60%  { transform: translate( 6px, -2px); }
  75%  { transform: translate(-3px,  1px); }
  100% { transform: translate(0,    0   ); }
}

/* ── Pause overlay ── */
#pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.52);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  border-radius: 0 0 6px 6px;
}

#pause-overlay.hidden {
  display: none;
}

#pause-text {
  font-size: 44px;
  font-weight: bold;
  color: #7f8c8d;
  letter-spacing: 0.2em;
  font-family: 'Courier New', monospace;
  animation: pause-blink 1.4s ease-in-out infinite;
}

@keyframes pause-blink {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.15; }
}

.gameover-blink {
  animation: gameover-blink-anim 0.8s ease-in-out infinite;
}

@keyframes gameover-blink-anim {
  0%, 100% { opacity: 1;   color: #FF6B6B; text-shadow: 0 0 8px #FF6B6B, 0 0 20px #FF4444; }
  50%       { opacity: 0.2; color: #FF6B6B; text-shadow: none; }
}

/* ── Game area ── */
#game-area {
  position: relative;
}

@media (max-width: 599px) {
  #app {
    width: 100vw;
  }

  #game-header {
    width: calc(100vw - 16px);
    justify-content: space-between;
    align-items: center;
  }

  .btn-row {
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
  }

  #restart-btn, #pause-btn, #easy-btn, #demo-btn, #exhibition-btn {
    padding: 5px 5px;
    font-size: 11px;
    min-width: unset;
  }

  #pause-btn {
    min-width: 58px;
  }

  #easy-btn {
    min-width: 58px;
  }

  #demo-btn {
    min-width: 44px;
  }

  #exhibition-btn {
    min-width: 72px;
  }

  #mobile-next {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 0 0 auto;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    min-width: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-tap-highlight-color: transparent;
  }

  #mobile-next:active {
    background: rgba(255, 255, 255, 0.14);
  }

  #mobile-next-canvas {
    display: block;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
  }

  #mobile-evo-hint {
    font-size: 9px;
    color: #aaa;
    letter-spacing: 0.05em;
  }

  #ranking-display {
    width: 100vw;
    align-self: flex-start;
  }
}

@media (min-width: 600px) {
  #mobile-next {
    display: none;
  }
}

#right-panel {
  position: absolute;
  top: 8px;
  right: -150px;
  width: 94px; /* Lv5(最大ドロップ)直径 = radius47×2 で固定 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform-origin: top right;
  transform: scale(clamp(0.5, calc(100vw / 550px), 1));
}

@media (max-width: 599px) {
  #right-panel {
    display: none;
  }
}

/* ── Mobile EVO overlay ── */
#mobile-evo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
}

#mobile-evo-overlay.hidden {
  display: none;
}

#mobile-evo-content {
  background: #2a2a4e;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-evo-title {
  color: #888;
  font-size: 10px;
  letter-spacing: 0.2em;
}

#next-display,
#evolution-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #888;
  font-size: 10px;
  gap: 4px;
}

#next-display {
  /* ラベル(~14px) + gap(4px) + Lv5最大キャンバス(94px) = 112px、余裕を持たせて固定 */
  min-height: 120px;
  justify-content: flex-start;
}

#game-canvas {
  display: block;
  cursor: crosshair;
  border-radius: 0 0 6px 6px;
  width: var(--game-w);
  aspect-ratio: 400 / 620;
}

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: #fff;
  border-radius: 14px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.overlay-content h2 {
  font-size: 34px;
  margin-bottom: 12px;
  color: #c0392b;
}

.overlay-content p {
  font-size: 20px;
  margin-bottom: 24px;
  color: #555;
}

/* ── Name input overlay ── */
#name-input-overlay .overlay-content h2 {
  color: #c0392b;
}

/* ランクイン通知。判定中の「Calculating...」(黄色18px)より目立たせる */
#name-input-rank {
  font-size: 22px;
  font-weight: bold;
  line-height: 1.3;
  color: #ff9f43;
  text-shadow: 0 0 10px rgba(255, 159, 67, 0.55);
  margin-bottom: 8px;
  animation: rank-pop 0.35s ease-out;
}

@keyframes rank-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ランキング判定中はスロットとボタンを隠し、集計中の表示を出す */
#name-input-overlay.pending .name-slots,
#name-input-overlay.pending .name-input-actions,
#name-input-overlay.pending #name-input-rank {
  display: none;
}

.name-input-pending {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 16px 0 12px;
}

#name-input-overlay.pending .name-input-pending {
  display: flex;
}

.pending-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid rgba(241, 196, 15, 0.25);
  border-top-color: #f1c40f;
  border-radius: 50%;
  animation: pending-spin 0.8s linear infinite;
}

.pending-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #f1c40f;
}

.pending-dots span {
  animation: pending-dot 1.2s infinite;
}
.pending-dots span:nth-child(2) { animation-delay: 0.2s; }
.pending-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pending-spin {
  to { transform: rotate(360deg); }
}

@keyframes pending-dot {
  0%, 20%  { opacity: 0.2; }
  50%      { opacity: 1; }
  100%     { opacity: 0.2; }
}

.name-slots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.name-slot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.slot-window {
  width: 40px;
  height: 120px;
  overflow: hidden;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  position: relative;
  background: #fff;
  touch-action: none;
}

.slot-window.active {
  border-color: #c0392b;
}

.slot-window::after {
  content: '';
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  height: 40px;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  pointer-events: none;
}

.slot-window.active::after {
  border-color: rgba(192, 57, 43, 0.3);
  background: rgba(192, 57, 43, 0.04);
}

.slot-drum {
  position: absolute;
  width: 100%;
  will-change: transform;
}

.slot-item {
  font-family: monospace;
  font-size: 24px;
  font-weight: bold;
  height: 40px;
  line-height: 40px;
  text-align: center;
  color: #bbb;
}

.slot-item.current {
  color: #222;
}


.name-input-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#name-submit-btn {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

#name-submit-btn:hover {
  background: #a93226;
}

/* 判定中と、名前入力中の両方で表示する。ランキングに登録せずに、オーバーレイから離脱する */
.name-input-skip {
  margin-top: 8px;
}

#name-skip-btn {
  background: #555;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

#name-skip-btn:hover {
  background: #444;
}


/* ── Clear overlay ── */
#clear-overlay .overlay-content h2 {
  color: #27ae60;
}

#clear-retry-btn {
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

#clear-retry-btn:hover {
  background: #219a52;
}

/* ── Timer ── */
/* タイマーを中央に置いたまま、右に BGM ボタンを並べる（左右の列を同じ幅にして、タイマーがずれないようにする） */
#timer-display {
  width: var(--game-w);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 2px 0;
}

#timer-value {
  grid-column: 2;
}

#bgm-btn {
  grid-column: 3;
  justify-self: start;
}

#timer-value {
  font-size: 20px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  color: #ccc;
  letter-spacing: 0.05em;
}

/* ── Ranking ── */
#ranking-display {
  width: min(100vw, calc((100vh - 250px) * 500 / 620));
  padding: 4px 0;
}

#rank-announce {
  height: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #f1c40f;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

#rank-announce.visible {
  opacity: 1;
  visibility: visible;
}

/* API失敗の通知は、ランクイン通知(黄色)と区別しつつ控えめな色にする */
#rank-announce.error {
  color: #d98a80;
  font-weight: normal;
}

#ranking-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.rank-toggle-group {
  display: flex;
  gap: 3px;
}

.rank-toggle {
  background: #2a2a3e;
  color: #666;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.rank-toggle:hover {
  color: #aaa;
}

.rank-toggle.active {
  background: #3a3a5e;
  color: #c8d0e0;
  border-color: #666;
}

.rank-toggle:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ランキング取得中のさりげないオーバーレイ(短時間で終わる場合はちらつかないよう遅延表示) */
#ranking-body {
  position: relative;
}

#ranking-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #8a93a8;
  background: rgba(20, 20, 35, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#ranking-display.loading #ranking-loading {
  opacity: 1;
  transition-delay: 0.2s;
}

.ranking-loading-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(138, 147, 168, 0.3);
  border-top-color: #8a93a8;
  border-radius: 50%;
  animation: pending-spin 0.8s linear infinite;
}

#ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  color: #c8d0e0;
}

#ranking-table thead tr {
  border-bottom: 1px solid #444;
}

#ranking-table th {
  padding: 3px 4px;
  color: #666;
  font-weight: normal;
  text-align: center;
  white-space: nowrap;
}

#ranking-table th:last-child,
#ranking-table td:last-child {
  text-align: left;
  padding-left: 6px;
}

#ranking-table td {
  padding: 3px 4px;
  text-align: center;
  border-bottom: 1px solid #2a2a3e;
  white-space: nowrap;
}

#ranking-table tbody tr:first-child td {
  color: #FF6B6B;
}

#ranking-table tbody tr:nth-child(2) td {
  color: #FF9F43;
}

#ranking-table tbody tr:nth-child(3) td {
  color: #FFD93D;
}

/* ── Ranking new entry ── */
.ranking-row-new {
  animation: ranking-row-blink 0.8s ease-in-out infinite;
}

@keyframes ranking-row-blink {
  0%, 100% { background: rgba(241, 196, 15, 0.35); }
  50%       { background: rgba(241, 196, 15, 0.04); }
}

.ranking-row-easy td {
  color: #ddd;
}

.rank-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-easy-badge {
  color: #aaa;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.rank-new-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ── Rotate overlay ── */
#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  z-index: 200;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  color: #fff;
  font-size: 18px;
  text-align: center;
}

#rotate-overlay .rotate-icon {
  font-size: 56px;
}

@media (orientation: landscape) and (max-height: 500px) {
  #rotate-overlay {
    display: flex;
  }
}
