:root {
  --bg: #0e0e12;
  --card: #18181f;
  --card-hover: #22222c;
  --line: #2c2c36;
  --text: #f4f4f6;
  --muted: #9a9aa8;
  --accent: #ff4081;
  --accent-dim: rgba(255, 64, 129, 0.18);
}

.t-en {
  display: none;
}

html[lang="en"] .t-ja {
  display: none;
}

html[lang="en"] .t-en {
  display: inline;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
}

.page {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  flex: 1;
}

.top .kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.top h1 {
  margin: 6px 0 28px;
  font-size: 1.4rem;
  font-weight: 650;
}

.now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.cover {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  flex-shrink: 0;
}

.now .cover {
  width: var(--now-cover-w, 168px);
  aspect-ratio: var(--art-ratio, 1);
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #000 url("placeholder.svg?v=2") center / 40% no-repeat;
}

.cover img,
.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  background: #000;
  border: 0;
  border-radius: inherit;
}

.cover img[hidden] {
  display: none;
}

.now-meta h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.game, .creator {
  margin: 0 0 6px;
  color: var(--muted);
}

.ocr-link {
  display: inline-block;
}

.now-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 12px;
}

.like-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.like-btn .like-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.like-btn:disabled {
  cursor: default;
}

.like-btn[hidden] {
  display: none;
}

.progress-wrap {
  margin: 22px 0 36px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  min-width: 0;
}

.progress {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
}

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.volume-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 2;
}

#volume-btn {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

#volume-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 8px auto;
  fill: currentColor;
}

.volume-popover {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 44px;
  height: 148px;
  padding: 12px 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #2a2a34;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}

.volume-wrap.open .volume-popover {
  display: flex;
}

#volume {
  width: 8px;
  height: 120px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  appearance: slider-vertical;
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
}

.vote-section h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.candidates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.candidate {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  padding: 10px;
}

.candidate.selected {
  border-color: var(--accent);
}

.candidate .cover {
  width: 100%;
  aspect-ratio: var(--candidate-ratio, 16 / 9);
  border-radius: 8px;
}

.candidate-title {
  margin: 8px 0 4px;
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.candidate-game,
.candidate-creator,
.candidate-votes {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.candidate-game {
  color: var(--text);
}

.candidate .now-actions {
  margin-top: 10px;
}

.candidate-vote {
  margin-top: auto;
}

.candidate-votes {
  margin: 10px 0 6px;
}

.vote-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 650;
}

.vote-btn.voted {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 12, 0.86);
  backdrop-filter: blur(10px);
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(420px, calc(100% - 32px));
  text-align: center;
}

.overlay-kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.overlay-card h1 {
  margin: 8px 0 12px;
}

.overlay-copy {
  color: var(--muted);
  line-height: 1.6;
}

#listen-btn {
  appearance: none;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 14px 42px;
  background: var(--accent);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.overlay-error {
  margin-top: 14px;
  color: #ff8aa8;
}

@media (max-width: 720px) {
  .page {
    width: min(880px, calc(100% - 20px));
    padding: 12px 0 16px;
  }

  .top h1 {
    margin: 4px 0 12px;
    font-size: 1.15rem;
  }

  .now {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
  }

  .now .cover {
    width: var(--now-cover-w, 96px);
    border-radius: 8px;
  }

  .now-meta h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .game,
  .creator {
    margin: 0 0 2px;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .now-actions {
    margin-top: 8px;
    gap: 8px 10px;
  }

  .like-btn {
    padding: 4px 8px 4px 6px;
    font-size: 0.78rem;
  }

  .like-btn .like-icon {
    width: 14px;
    height: 14px;
  }

  .progress-wrap {
    margin: 12px 0 16px;
  }

  .vote-section h2 {
    margin: 0 0 8px;
    font-size: 0.95rem;
  }

  .candidates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .candidate {
    padding: 6px;
    border-radius: 10px;
  }

  .candidate-title {
    margin: 6px 0 2px;
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .candidate-game,
  .candidate-creator,
  .candidate-votes {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .candidate .now-actions {
    margin-top: 6px;
  }

  .candidate-votes {
    margin: 8px 0 4px;
  }

  .vote-btn {
    padding: 6px 8px;
    font-size: 0.72rem;
  }
}
