/* 投票ページ（vote-flow.js）：画面いっぱいの 3D。上の中央に「一覧／1点ずつ投票」と見ている範囲、右上に表示設定と投票履歴、右端に縦のボタン、左下に作品名 */
html:has(.vote-flow) {
  overflow: hidden;
}
.vote-flow {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: linear-gradient(#272e4e, #0f1322 78%);
  color: #fff;
}
#app > .vote-flow {
  animation: none;
}
/* お知らせはボタンと重ならないよう上に出す */
body:has(.vote-flow) #notice {
  top: 84px;
  bottom: auto;
}
.vote-flow-card,
.vote-flow-piece {
  position: absolute;
  inset: 0;
}
.vote-flow-stage.showcase-stage {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  cursor: grab;
}
.vote-flow-stage.is-turning {
  cursor: grabbing;
}
.vote-flow-stage .showcase-canvas {
  touch-action: none;
}
.vote-flow-stage .showcase-fallback {
  inset: 14% 25% 24%;
  width: 50%;
  height: 62%;
}
.vote-flow-stage .showcase-hint {
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  white-space: nowrap;
}
/* 上の中央：切り替えと範囲 */
.vote-flow-top {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}
.vote-flow-scope {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  background: #141a30b3;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #dfe3fb;
  font-size: 13px;
  white-space: nowrap;
}
/* 右上：表示設定と投票履歴 */
.vote-flow-tools {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vote-flow-tune {
  position: relative;
}
.vote-flow:not(.is-3d) .vote-flow-tune {
  display: none;
}
.vote-flow .showcase-tune {
  position: static;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff24;
  border-radius: 50%;
  background: #141a30b3;
  font-size: 22px;
}
.vote-flow .showcase-tune:hover,
.vote-flow .showcase-tune[aria-expanded='true'] {
  background: #141a30;
  transform: none;
}
.vote-flow .showcase-panel {
  top: 54px;
  right: 0;
  width: 240px;
  max-height: none;
}
.vote-flow-mine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  background: #141a30b3;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.vote-flow-mine:hover,
.vote-flow-mine[aria-expanded='true'] {
  background: #fff;
  color: #202437;
}
.vote-flow-mine[data-count]:not([data-count=''])::after {
  content: attr(data-count);
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff24;
  font-size: 11px;
}
.vote-flow-mine[aria-expanded='true']::after,
.vote-flow-mine:hover::after {
  background: #e8ebfc;
  color: #4758d9;
}
/* 左下：作品の情報。下にグラデーションを敷いて文字を読みやすく */
.vote-flow-piece::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 260px;
  background: linear-gradient(#0b0e1a00, #0b0e1ad9);
  pointer-events: none;
}
.vote-flow-info {
  position: absolute;
  left: 44px;
  bottom: 40px;
  z-index: 3;
  max-width: min(440px, calc(100% - 180px));
}
.vote-flow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vote-flow-tags span {
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff24;
  font-size: 12px;
  font-weight: 700;
}
.vote-flow-tags span:empty {
  display: none;
}
.vote-flow-info h2 {
  margin: 10px 0 6px;
  color: #fff;
  font-size: 26px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.vote-flow-info .meta {
  margin: 0;
  color: #c5cbe6;
}
.vote-flow-detail {
  margin-left: 8px;
  color: #fff;
  text-decoration: underline;
}
.vote-flow-note {
  margin: 10px 0 0;
  color: #aab0cc;
  font-size: 12px;
}
.vote-flow-info .showcase-shake {
  position: static;
  margin-bottom: 14px;
}
/* 右端：上から 前へ／Like／迷い中／Skip */
.vote-flow-rail {
  position: absolute;
  right: 36px;
  top: 50%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: translateY(-50%);
}
.vote-flow-rail button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.vote-flow-rail button span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 22px;
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}
.vote-flow-rail button:hover:not(:disabled) span {
  transform: scale(1.06);
}
.vote-flow-rail button:active:not(:disabled) span {
  transform: scale(0.96);
}
.vote-flow-rail button:focus-visible {
  outline: none;
}
.vote-flow-rail button:focus-visible span {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.vote-flow-back span {
  width: 48px !important;
  height: 48px !important;
  border: 1px solid #ffffff38;
  background: #ffffff1f;
  font-size: 18px !important;
}
.vote-flow-back:disabled {
  opacity: 0.35;
  cursor: default !important;
}
.vote-flow-like span {
  width: 76px !important;
  height: 76px !important;
  background: #5261ee;
  font-size: 30px !important;
  box-shadow: 0 10px 26px #5261ee66;
}
.vote-flow-later span {
  border: 1px solid #ffffff4d;
  background: #ffffff24;
}
.vote-flow-skip span {
  background: #fff;
  color: #d6334f;
}
/* 投票履歴を開いているあいだは、ボタンをその左へずらして押せるようにしておく */
.vote-flow:has(.vote-mine:not([hidden])) .vote-flow-rail {
  right: 404px;
}
/* いま選んでいる Like／Skip */
.vote-flow-rail [data-chosen] span {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
.vote-flow-rail [data-chosen]::after {
  content: '選択中';
  margin-top: -2px;
  color: #aab4ff;
  font-size: 10px;
}
/* 投票し終えたとき */
.vote-flow-done {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  padding: 8px 0;
  border-radius: 24px;
  background: #fff;
  color: #202437;
}
.vote-flow-done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
/* 投票履歴：右から出るパネル */
.vote-mine {
  position: absolute;
  top: 76px;
  right: 20px;
  bottom: 20px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 360px;
  box-sizing: border-box;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ffffff24;
  border-radius: 22px;
  background: #141a30e6;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px #05081a80;
  animation: fv-drop-in var(--motion-base, 0.2s) var(--motion-ease, ease);
}
.vote-mine[hidden] {
  display: none;
}
.vote-mine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vote-mine-head h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}
.vote-mine-head button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff1a;
  color: #fff;
}
.vote-mine-note {
  margin: 0;
  color: #aab0cc;
  font-size: 12px;
}
.vote-mine .empty {
  color: #dfe3fb;
}
.vote-mine .empty h3 {
  color: #fff;
}
.vote-mine-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.vote-mine-item {
  display: grid;
  gap: 6px;
}
.vote-mine-thumb {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 35%, #fff, #e9ecf8);
  cursor: pointer;
}
.vote-mine-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vote-mine .vote-switch button {
  border-color: #ffffff33;
  background: transparent;
  color: #c5cbe6;
}
.vote-mine .vote-switch .chosen {
  border-color: #fff;
  background: #fff;
  color: #202437;
}
/* 作品の入れ替え：Like／Skip／迷い中は静かに消えて、次がふわっと出る。前へは左から */
.vote-flow-rise {
  animation: vote-flow-in 0.35s ease;
}
.vote-flow-return {
  animation: vote-flow-return 0.35s ease;
}
[class*='vote-flow-out-'] {
  animation: vote-flow-out 0.26s ease forwards;
}
@keyframes vote-flow-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
}
@keyframes vote-flow-return {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}
@keyframes vote-flow-out {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}
@media (max-width: 720px) {
  .vote-flow-top {
    top: 12px;
    left: 12px;
    transform: none;
  }
  .vote-flow-scope {
    display: none;
  }
  .vote-flow .works-toggle > * {
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }
  .vote-flow .works-toggle svg {
    display: none;
  }
  .vote-flow-tools {
    top: 12px;
    right: 12px;
    gap: 6px;
  }
  .vote-flow-mine {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
  .vote-flow-mine > span,
  .vote-flow-mine::after {
    display: none;
  }
  .vote-flow-stage .showcase-hint {
    top: 66px;
    bottom: auto;
  }
  .vote-flow-info {
    left: 16px;
    bottom: 24px;
    max-width: calc(100% - 112px);
  }
  .vote-flow-info h2 {
    margin: 8px 0 4px;
    font-size: 19px;
  }
  .vote-flow-note {
    display: none;
  }
  .vote-flow-rail,
  .vote-flow:has(.vote-mine:not([hidden])) .vote-flow-rail {
    top: auto;
    right: 14px;
    bottom: 24px;
    gap: 12px;
    transform: none;
  }
  .vote-flow-rail button {
    font-size: 11px;
  }
  .vote-flow-rail button span {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .vote-flow-back span {
    width: 42px !important;
    height: 42px !important;
  }
  .vote-flow-like span {
    width: 60px !important;
    height: 60px !important;
    font-size: 24px !important;
  }
  .vote-flow-rail [data-chosen]::after {
    display: none;
  }
  .vote-mine {
    inset: 0;
    width: auto;
    border: 0;
    border-radius: 0;
  }
  .vote-mine-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vote-flow-rise,
  .vote-flow-return,
  [class*='vote-flow-out-'] {
    animation: none;
  }
}
