/* 人間力バトル 共通スタイル（モバイル優先） */

:root {
  --color-primary: #ff3d68;
  --color-primary-dark: #e0264f;
  --color-secondary: #3d5afe;
  --color-secondary-dark: #2438c9;
  --color-accent: #ffc107;
  --color-success: #00c853;
  --color-danger: #ff1744;
  --color-bg: #fff8fb;
  --color-surface: #ffffff;
  --color-text: #22223b;
  --color-muted: #6b7280;
  --color-border: #f0d9e2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(34, 34, 59, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  scroll-behavior: smooth;
}

#login-form,
.section-heading {
  scroll-margin-top: 14px;
}

body {
  margin: 0;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  flex-shrink: 0;
}

a {
  color: var(--color-secondary-dark);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 14px 60px;
}

h1 {
  font-size: 1.4rem;
  margin: 0.6em 0 0.4em;
}

h2 {
  font-size: 1.15rem;
  margin: 1.2em 0 0.5em;
  border-left: 6px solid var(--color-primary);
  padding-left: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1512;
  color: #f1d9a8;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 12px 18px;
  border-radius: 0;
  box-shadow: var(--shadow);
  border-left: none;
}

.section-heading__icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* ナビゲーション */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #1a1512;
  border-bottom: 1px solid #4a3a25;
  flex-wrap: wrap;
}

.site-nav__brand {
  display: inline-block;
  color: #f1d9a8;
  font-weight: bold;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  background: rgba(241, 217, 168, 0.1);
  border: 1px solid rgba(241, 217, 168, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
}

.site-nav__brand:hover {
  background: rgba(241, 217, 168, 0.22);
}

.site-nav__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.streak-badge {
  color: #ffc107;
  font-size: 0.8rem;
  font-weight: bold;
  background: rgba(255, 193, 7, 0.15);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.site-nav__greeting {
  color: #f1d9a8;
  font-size: 0.8rem;
  background: rgba(241, 217, 168, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 217, 168, 0.25);
}

.site-nav__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav__links a {
  color: #f1e6cf;
  text-decoration: none;
  font-size: 0.9rem;
  background: rgba(241, 217, 168, 0.1);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 217, 168, 0.2);
}

.site-nav__links a:hover {
  background: rgba(241, 217, 168, 0.22);
}

.site-nav__logout {
  color: #f1e6cf;
  font-size: 0.9rem;
  background: rgba(241, 217, 168, 0.1);
  border: 1px solid rgba(241, 217, 168, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.login-music-prompt {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 90;
  background: #1a1512;
  color: #ffd76a;
  border: 2px solid #ffd76a;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: login-music-prompt-pulse 1.4s ease-in-out infinite;
}

@keyframes login-music-prompt-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.fab-upload {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #cfe0fa;
  color: #0d3b8c;
  border: 3px solid #0d3b8c;
  font-weight: bold;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(34, 34, 59, 0.35);
}

.fab-upload:hover {
  background: #b9d3f5;
}

.fab-upload--docked {
  position: static;
  display: inline-flex;
  margin: 0 auto 14px;
  box-shadow: none;
  order: -1;
}

.mobile-nav {
  display: none;
}

@media (max-width: 699px) {
  :root {
    --mobile-nav-height: 60px;
  }

  .fab-upload {
    display: none !important;
  }

  body:has(.mobile-nav) {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
  }

  .mobile-nav__panel {
    display: flex;
    background: #1a1512;
    border-top: 1px solid #3a2f22;
    transition: transform 0.25s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav.is-collapsed .mobile-nav__panel {
    transform: translateY(100%);
  }

  .mobile-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 4px;
    color: #cbb98f;
    text-decoration: none;
    font-size: 0.68rem;
  }

  .mobile-nav__item.is-active {
    color: #ffc107;
  }

  .mobile-nav__item-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  .mobile-nav__handle {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: 56px;
    height: 22px;
    background: #1a1512;
    border: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    color: #cbb98f;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.25);
    transition: bottom 0.25s ease;
    z-index: 71;
  }

  .mobile-nav.is-collapsed .mobile-nav__handle {
    bottom: 0;
  }

  .mobile-nav__handle-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
  }

  .mobile-nav.is-collapsed .mobile-nav__handle-arrow {
    transform: rotate(180deg);
  }
}

.site-nav__logout:hover {
  background: rgba(241, 217, 168, 0.22);
}

.site-nav__bell {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: bold;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}

/* 通知一覧 */

.notification-row {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notification-row--unread {
  border-left: 4px solid var(--color-primary);
}

.notification-row__time {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
}

/* 週間ランキング */

.ranking-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .ranking-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.ranking-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.ranking-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ranking-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.ranking-list li:last-child {
  border-bottom: none;
}

.ranking-list__rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-muted);
  font-weight: bold;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranking-list li:nth-child(1) .ranking-list__rank {
  background: #ffd54f;
  color: #7a5600;
}

.ranking-list li:nth-child(2) .ranking-list__rank {
  background: #e0e0e0;
  color: #555;
}

.ranking-list li:nth-child(3) .ranking-list__rank {
  background: #d7a06a;
  color: #4a2c0c;
}

.ranking-list__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list__value {
  flex-shrink: 0;
  font-weight: bold;
  color: var(--color-primary-dark);
  font-size: 0.8rem;
}

/* フッター */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 14px 30px;
  color: #cbb98f;
  font-size: 0.8rem;
  background: #1a1512;
  border-top: 1px solid #4a3a25;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.site-footer__links a {
  color: #f1e6cf;
}

.site-footer__copy {
  margin: 0;
  color: #9a8b6c;
}

/* 独自動画プレイヤー */

.player-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}

.player-wrap--single {
  width: auto;
  max-width: 100%;
  height: calc(100vh - 260px);
  min-height: 200px;
  margin-left: auto;
  margin-right: auto;
}

.player-wrap video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #000;
}

/* 投げ銭ギフトエフェクト */

.gift-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.gift-layer--fullscreen {
  position: fixed;
  overflow: visible;
  z-index: 999;
}

.gift-layer--fullscreen .gift-fx {
  bottom: 30%;
  font-size: 3.2rem;
}

.gift-layer--fullscreen .gift-fx--small {
  font-size: 2.6rem;
}

.gift-layer--fullscreen .gift-fx--medium {
  font-size: 3.6rem;
}

.gift-layer--fullscreen .gift-fx--large {
  font-size: 4.6rem;
}

.gift-layer--fullscreen .gift-fx--special {
  font-size: 5rem;
}

.gift-fx {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.gift-fx--small {
  font-size: 1.8rem;
  animation: gift-pop-small 2.2s ease-out forwards;
}

.gift-fx--medium {
  font-size: 2.6rem;
  animation: gift-pop-medium 2.2s ease-out forwards;
}

.gift-fx--large {
  font-size: 3.4rem;
  animation: gift-pop-large 2.4s ease-out forwards;
}

@keyframes gift-pop-small {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  15%  { opacity: 1; transform: translate(-50%, -10px) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -140px) scale(1); }
}

@keyframes gift-pop-medium {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6) rotate(-4deg); }
  15%  { opacity: 1; transform: translate(-50%, -20px) scale(1.25) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -200px) scale(1.05) rotate(-4deg); }
}

@keyframes gift-pop-large {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  20%  { opacity: 1; transform: translate(-50%, -30px) scale(1.5); }
  60%  { opacity: 1; transform: translate(-50%, -130px) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -260px) scale(1.1); }
}

.gift-fx--special {
  font-size: 3.6rem;
  animation: gift-pop-special 2.6s ease-out forwards;
  filter: drop-shadow(0 0 10px gold);
}

@keyframes gift-pop-special {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5) rotate(0deg); }
  20%  { opacity: 1; transform: translate(-50%, -40px) scale(1.6) rotate(-8deg); }
  40%  { transform: translate(-50%, -100px) scale(1.4) rotate(8deg); }
  70%  { opacity: 1; transform: translate(-50%, -180px) scale(1.3) rotate(-6deg); }
  100% { opacity: 0; transform: translate(-50%, -280px) scale(1.1) rotate(0deg); }
}

.player-bigplay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.player-bigplay::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--color-primary);
}

.player-bigplay[hidden] {
  display: none;
}

.player-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: player-spin 0.8s linear infinite;
}

.player-spinner.is-active {
  display: block;
}

@keyframes player-spin {
  to {
    transform: rotate(360deg);
  }
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.player-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

.player-seek {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  accent-color: var(--color-primary);
}

.player-time {
  color: #fff;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* 対戦一覧の行（バッジ→vs→終了日時の順で整列） */

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

.battle-row .badge {
  flex: 0 0 auto;
  min-width: 4.5em;
  text-align: center;
}

.battle-row__vs {
  flex: 1 1 auto;
  min-width: 140px;
}

.battle-row__end {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.countdown--soon {
  color: var(--color-danger) !important;
  font-weight: bold;
}

.view-all-battles {
  margin: 14px 0 24px;
  padding: 14px 20px;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(255, 61, 104, 0.4);
  animation: view-all-pulse 2s ease-in-out infinite;
}

@keyframes view-all-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* トップページ：3ステップ説明 */

.onboarding-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 10px;
  margin: 4px 0 16px;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 90px;
  text-align: center;
}

.onboarding-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: bold;
  font-size: 0.85rem;
}

.onboarding-step__label {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--color-text);
}

.onboarding-step__arrow {
  color: var(--color-muted);
  font-weight: bold;
  flex: 0 0 auto;
}

/* トップページ：ログイン／新規登録タブ */

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.auth-tab {
  flex: 1 1 0;
  padding: 12px 10px;
  border: none;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  color: var(--color-muted);
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
}

.auth-tab--active {
  background: none;
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

.auth-panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.register-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .register-choice {
    grid-template-columns: 1fr 1fr;
  }
}

.register-choice__card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.register-choice__title {
  font-weight: bold;
  margin-bottom: 4px;
}

.register-choice__desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0 0 10px;
}

/* 進行中の対戦カード（VSカード） */

.battle-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 700px) {
  .battle-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .battle-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 699px) {
  .battle-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .battle-strip .battle-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  /* 一覧ページでは件数が多いので横スクロールにせず縦積みグリッドのまま */
  .battle-strip--full {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
}

.battle-card {
  display: flex;
  flex-direction: column;
  background: var(--card-body, var(--color-surface));
  border: 2px solid var(--card-border, #d3c3cb);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  text-decoration: none;
  color: var(--card-text, var(--color-text));
}

.battle-card__badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.battle-card__activity {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.battle-card__vs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.battle-card__side {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.battle-card__side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.battle-card__mark {
  flex: 0 0 auto;
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--color-primary-dark);
}

.battle-card__hype {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.battle-card__hype-tag {
  font-size: 0.65rem;
}

.battle-card__titles {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.battle-card__titles span {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: bold;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card__titles small {
  display: block;
  font-size: 0.68rem;
  font-weight: normal;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card__end {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--color-muted);
  text-align: center;
}

.battle-card__end.countdown--soon {
  animation: battle-card-blink 1s step-start infinite;
}

@keyframes battle-card-blink {
  50% { opacity: 0.25; }
}

/* 本日の注目対戦 */

.featured-battle {
  background: var(--color-primary);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.featured-battle__label {
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.featured-battle__vs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 10px;
}

.featured-battle__side {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  text-decoration: none;
  display: block;
}

.featured-battle__video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  background: #000;
}

.featured-battle__hype {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
}

.featured-battle__title {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-battle__title small {
  display: block;
  font-weight: normal;
  color: var(--color-muted);
}

.featured-battle__mark {
  flex: 0 0 auto;
  font-weight: bold;
  color: var(--color-primary-dark);
}

.featured-battle__cta {
  margin-top: 10px;
}

.featured-battle__end {
  margin-top: 8px;
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}

/* ランクアップ演出 */

.rankup-banner {
  background: #ffc107;
  color: #4a3400;
  font-weight: bold;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  animation: rankup-pop 0.5s ease;
}

@keyframes rankup-pop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* トップページのロゴ */

.top-logo {
  display: block;
  text-align: center;
  margin-bottom: 10px;
  background: #0d0b09;
}

.top-logo img {
  margin: 0 auto;
}

/* ボタン */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--color-secondary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* フォーム */

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--color-surface);
}

textarea {
  resize: vertical;
}

/* アラート */

.alert {
  padding: 10px 14px;
  border-radius: 10px;
  margin: 10px 0;
  font-size: 0.9rem;
}

.alert-error {
  background: #ffe1e8;
  color: var(--color-danger);
}

.alert-success {
  background: #e0f9e8;
  color: #00874a;
}

.alert-info {
  background: #fff3cd;
  color: #8a6300;
}

/* カード・グリッド（動画一覧） */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  background: #000;
}

.card__title {
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: bold;
}

.card__genre {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  z-index: 1;
}

/* 対戦(vs)レイアウト */

.vs-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.viewer-count {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-secondary-dark);
  background: var(--color-surface);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  margin: 4px 0 10px;
}

.danmaku-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}

.danmaku-item {
  position: absolute;
  right: -10%;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.8);
  animation: danmaku-fly 8s linear forwards;
}

.danmaku-item--system {
  color: #ffe082;
}

@keyframes danmaku-fly {
  from { transform: translateX(0); }
  to   { transform: translateX(-1200%); }
}

@media (min-width: 700px) {
  .vs-wrap {
    grid-template-columns: 1fr auto 1fr;
  }
}

.vs-side {
  min-width: 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  border-top: 6px solid var(--color-side, var(--color-primary));
}

.vs-side--a {
  --color-side: var(--color-primary);
}

.vs-side--b {
  --color-side: var(--color-secondary);
}

.battle-frame--rare {
  box-shadow: 0 0 0 2px var(--color-secondary), var(--shadow);
}

.battle-frame--super_rare {
  box-shadow: 0 0 0 2px #9c27b0, 0 0 12px rgba(156, 39, 176, 0.4);
}

.battle-frame--ultra_rare {
  box-shadow: 0 0 0 2px #ffc107, 0 0 16px rgba(255, 193, 7, 0.5);
  animation: gacha-glow 1.6s ease-in-out infinite alternate;
}

.vs-side video {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

.vs-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--color-muted);
  font-size: 1.2rem;
}

.vote-count {
  font-weight: bold;
  color: var(--color-primary-dark);
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.reaction-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ジャンルバナー */

.genre-banners {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0 20px;
}

@media (min-width: 700px) {
  .genre-banners {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .genre-banners {
    grid-template-columns: repeat(3, 1fr);
  }
}

.genre-banner {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  aspect-ratio: 480 / 90;
  background: var(--color-primary);
}

.genre-banner--free {
  grid-column: 1 / -1;
}

.genre-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.genre-banner__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  padding: 0 10px;
}

/* リスト */

/* 人間力ステータス */

.stat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
}

.stat-row__name {
  flex: 1 1 auto;
  font-weight: bold;
}

.stat-row__detail {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}

.title-badge {
  display: inline-block;
  background: #22223b;
  color: #ffd76a;
  border: 1px solid #ffd76a;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.8rem;
  font-weight: bold;
  margin: 4px 0;
}

.champion-badge {
  background: #ffc107;
  color: #4a3400;
}

.human-score-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
  text-align: center;
}

.human-score-card__score {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-primary-dark);
}

.human-score-card__score strong {
  font-size: 1.8rem;
}

.human-score-card__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 10px 0;
  font-size: 0.85rem;
}

.human-score-card__stat {
  white-space: nowrap;
}

.human-score-card__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: bold;
}

.rank-S { background: #ffc107; }
.rank-A { background: var(--color-primary); }
.rank-B { background: var(--color-secondary); }
.rank-C { background: #00c853; }
.rank-D { background: #78909c; }
.rank-E { background: #b0bec5; }
.rank-none {
  background: var(--color-border);
  color: var(--color-muted);
}

.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-plain li {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #4a3400;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1.2;
}

.badge-danger {
  background: var(--color-danger);
  color: #fff;
}

a.badge {
  text-decoration: none;
}

/* BBS */

.bbs-post {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.battle-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.battle-filter select,
.battle-filter input[type="text"],
.battle-filter input[type="date"] {
  width: auto;
  flex: 1 1 160px;
}

.battle-filter label {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

#date-range-picker {
  background: var(--color-surface);
  cursor: pointer;
}

.flatpickr-calendar {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.flatpickr-day.selected.startRange + .endRange,
.flatpickr-day.startRange + .endRange {
  box-shadow: -10px 0 0 var(--color-primary);
}

.flatpickr-day.inRange {
  background: rgba(255, 61, 104, 0.15);
  border-color: transparent;
  box-shadow: -5px 0 0 rgba(255, 61, 104, 0.15), 5px 0 0 rgba(255, 61, 104, 0.15);
}

.flatpickr-day:hover {
  background: rgba(255, 61, 104, 0.2);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--color-text);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--color-primary);
}

.flatpickr-day.today {
  border-color: var(--color-secondary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 動画視聴ページの情報カード */

.watch-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 14px 0;
}

.watch-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.watch-card__title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.watch-card__author {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-secondary-dark);
  text-decoration: none;
  margin-bottom: 8px;
}

.watch-card__author:hover {
  text-decoration: underline;
}

.watch-card__message {
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: pre-line;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin: 8px 0 10px;
}

.watch-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* 対戦フィード（縦スワイプ） */

.feed-body {
  margin: 0;
  background: #000;
  overflow: hidden;
}

.feed-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.feed-topbar__back {
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
}

.feed-topbar__title {
  font-weight: bold;
}

.feed-container {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.feed-slide {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 60px 12px 16px;
  color: #fff;
  position: relative;
  box-sizing: border-box;
}

.feed-slide__badge {
  position: absolute;
  top: 56px;
  left: 12px;
  z-index: 3;
}

.feed-vs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.feed-side {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.feed-player {
  aspect-ratio: auto;
  height: 100%;
  margin-bottom: 0;
}

.feed-vs__mark {
  flex: 0 0 auto;
  font-weight: bold;
  color: #fff;
  align-self: center;
}

.feed-side__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46px;
  z-index: 2;
  padding: 16px 8px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.feed-side__title {
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-side__title small {
  display: block;
  font-weight: normal;
  color: #ccc;
}

.feed-vote-form {
  margin: 0;
}

.feed-reaction-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.feed-reaction-chip {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
  cursor: pointer;
}

.feed-reaction-chip__input {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.feed-reaction-chip:has(.feed-reaction-chip__input:checked) {
  background: var(--color-primary);
}

.feed-reaction-toast {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: bold;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.feed-reaction-toast.is-visible {
  animation: feed-reaction-toast-pop 1.1s ease-out forwards;
}

@keyframes feed-reaction-toast-pop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  25% { transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.feed-slide__more {
  display: block;
  flex-shrink: 0;
  text-align: center;
  margin-top: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.8rem;
}

.feed-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

/* ガチャ結果 */

.gacha-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.gacha-result-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  text-align: center;
  border: 2px solid var(--color-border);
}

.gacha-result-card__rarity {
  font-size: 0.65rem;
  color: var(--color-muted);
}

.gacha-result-card__icon {
  font-size: 2rem;
  margin: 4px 0;
}

.item-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.item-thumb--icon {
  font-size: 2rem;
}

.item-thumb img {
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.item-thumb--sm {
  font-size: 1.1rem;
}

.item-thumb--sm img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.item-thumb--md img {
  width: 64px;
  height: 64px;
}

.item-count-badge {
  background: var(--color-secondary);
  color: #fff;
}

.gift-form__search {
  position: relative;
  display: inline-block;
}

.gift-form__input {
  width: 12em;
}

.gift-form__results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 2px);
  left: 0;
  width: 220px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.gift-form__result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  cursor: pointer;
}

.gift-form__result:last-child {
  border-bottom: none;
}

.gift-form__result:hover {
  background: var(--color-bg);
}

.admin-user-picker__preview {
  flex-shrink: 0;
}

.gacha-result-card__name {
  font-size: 0.8rem;
  font-weight: bold;
}

.gacha-result-card--rare {
  border-color: var(--color-secondary);
}

.gacha-result-card--super_rare {
  border-color: #9c27b0;
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.4);
}

.achievement-card--locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.gacha-result-card--ultra_rare {
  border-color: #ffc107;
  box-shadow: 0 0 14px rgba(255, 193, 7, 0.6);
  animation: gacha-glow 1.4s ease-in-out infinite alternate;
}

@keyframes gacha-glow {
  from { box-shadow: 0 0 8px rgba(255, 193, 7, 0.4); }
  to   { box-shadow: 0 0 22px rgba(255, 193, 7, 0.9); }
}

/* ガチャ抽選演出 */

.gacha-suspense {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  margin: 16px 0;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.gacha-suspense__capsule {
  font-size: 4rem;
  animation: gacha-suspense-shake 0.5s ease-in-out infinite;
}

.gacha-suspense__text {
  font-weight: bold;
  color: var(--color-muted);
  margin: 0;
}

@keyframes gacha-suspense-shake {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1); }
}

.gacha-suspense--rare .gacha-suspense__capsule {
  animation-duration: 0.4s;
  filter: drop-shadow(0 0 12px var(--color-secondary));
}

.gacha-suspense--rare .gacha-suspense__text {
  color: var(--color-secondary-dark);
}

.gacha-suspense--super_rare .gacha-suspense__capsule {
  animation-duration: 0.3s;
  filter: drop-shadow(0 0 18px #9c27b0);
}

.gacha-suspense--super_rare .gacha-suspense__text {
  color: #9c27b0;
  font-size: 1.05em;
}

.gacha-suspense--ultra_rare .gacha-suspense__capsule {
  animation-duration: 0.2s;
  filter: drop-shadow(0 0 26px #ffc107);
}

.gacha-suspense--ultra_rare .gacha-suspense__text {
  color: #ffc107;
  font-size: 1.15em;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.gacha-flash {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #fff;
  opacity: 0.9;
  animation: gacha-flash-fade 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes gacha-flash-fade {
  from { opacity: 0.9; }
  to   { opacity: 0; }
}

.gacha-results-wrap.is-revealing .gacha-result-card {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  transition-delay: calc(var(--i, 0) * 0.08s);
}

.gacha-results-wrap.is-revealing.is-shown .gacha-result-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gacha-results-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

/* 広告枠 */

.ad-slot {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
}

.ad-slot--raw {
  padding-top: 22px;
}

.ad-slot__label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.65rem;
  color: var(--color-muted);
  background: var(--color-bg);
  padding: 1px 8px;
  border-radius: 999px;
  z-index: 1;
}

.ad-slot__image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  margin-top: 14px;
}

.ad-slot__body {
  margin-top: 8px;
}

.ad-slot__title {
  font-weight: bold;
  font-size: 0.95rem;
}

.ad-slot__desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.profile-message {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  white-space: pre-line;
}

.profile-header {
  border-radius: var(--radius);
  padding: 4px 2px;
}

.profile-frame--rare {
  border: 2px solid var(--color-secondary);
  padding: 10px 14px;
}

.profile-frame--super_rare {
  border: 2px solid #9c27b0;
  padding: 10px 14px;
  box-shadow: 0 0 12px rgba(156, 39, 176, 0.35);
}

.profile-frame--ultra_rare {
  border: 2px solid #ffc107;
  padding: 10px 14px;
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.5);
  animation: gacha-glow 1.6s ease-in-out infinite alternate;
}

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg);
  flex-shrink: 0;
  vertical-align: middle;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar .avatar__frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  pointer-events: none;
}


.avatar--xs {
  width: 50px;
  height: 50px;
}

.avatar--xs .avatar__initial {
  font-size: 0.7rem;
}

.avatar--sm {
  width: 80px;
  height: 80px;
}

.avatar--sm .avatar__initial {
  font-size: 1rem;
}

.avatar--md {
  width: 80px;
  height: 80px;
}

.avatar--md .avatar__initial {
  font-size: 1.4rem;
}

.avatar--lg {
  width: 135px;
  height: 135px;
}

.avatar--lg .avatar__initial {
  font-size: 2.8rem;
}

.profile-header .avatar--lg {
  display: flex;
  margin: 0 auto 10px;
}

.avatar--placeholder {
  background: var(--color-secondary);
  color: #fff;
}

.avatar__initial {
  font-weight: bold;
  line-height: 1;
}

.avatar-frame--rare::after,
.avatar-frame--super_rare::after,
.avatar-frame--ultra_rare::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 175%;
  height: 175%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.avatar-frame--rare::after {
  box-shadow: 0 0 0 3px var(--color-secondary);
}

.avatar-frame--super_rare::after {
  box-shadow: 0 0 0 3px #9c27b0, 0 0 10px rgba(156, 39, 176, 0.4);
}

.avatar-frame--ultra_rare::after {
  box-shadow: 0 0 0 3px #ffc107, 0 0 14px rgba(255, 193, 7, 0.5);
  animation: gacha-glow 1.6s ease-in-out infinite alternate;
}

.mypage-quicknav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.mypage-quicknav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.mypage-shop-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}

.mypage-shop-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 6px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: bold;
  text-align: center;
}

.mypage-shop-menu a .icon {
  font-size: 1.7rem;
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.avatar-crop-modal[hidden] {
  display: none;
}

.avatar-crop-modal__body {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 16px;
  width: 100%;
  max-width: 420px;
}

.avatar-crop-modal__image-wrap {
  width: 100%;
  max-height: 60vh;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.avatar-crop-modal__image-wrap img {
  display: block;
  max-width: 100%;
}

.avatar-crop-modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.avatar-crop-modal__actions .btn {
  flex: 1 1 0;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avatar-picker__option {
  cursor: pointer;
  border-radius: 50%;
  padding: 3px;
  border: 2px solid transparent;
}

.avatar-picker__option.is-selected {
  border-color: var(--color-primary);
}

.bbs-post--system {
  background: #ffedb8;
  border: 1px solid #ffc107;
  font-weight: bold;
}

.bbs-post--gift-medium {
  border-left: 4px solid var(--color-accent);
}

.bbs-stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
}

.bbs-stamp:active {
  filter: brightness(0.9);
}

.bbs-post--gift-large {
  border: 2px solid var(--color-accent);
  background: #ffe9b3;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.5);
}

.bbs-post__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.bbs-post__report {
  font-size: 0.7rem;
  margin-left: auto;
}

.pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.pager a,
.pager span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-size: 0.85rem;
}

.pager span.current {
  background: var(--color-primary);
  color: #fff;
  font-weight: bold;
}

/* テーブル（管理画面） */

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.85rem;
}

th {
  background: #fff0f4;
}

tbody tr:nth-child(even) {
  background: #fffafc;
}

tbody tr:hover {
  background: #fff0f4;
}

.emoji-picker-wrap {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.emoji-picker-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.emoji-picker-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}

.emoji-picker-search {
  width: 100%;
  margin-bottom: 8px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-picker-item {
  background: none;
  border: none;
  font-size: 1.4rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  width: auto;
}

.emoji-picker-item:hover {
  background: var(--color-bg);
}

.emoji-picker-empty {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--color-muted);
  text-align: center;
}

/* 管理画面のカード型セクション */

.admin-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-secondary);
  padding: 16px;
  margin-bottom: 16px;
}

.admin-card__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--color-secondary-dark);
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.checkbox-grid input[type="checkbox"] {
  width: auto;
}

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
