/* ドット絵選考会ページ共通スタイル */
/* design-allow-start: color-literal */
/* ドット絵選考会はコンテストの暗背景プレビュー前提配色。pixel_art_editor と同様にパレット・モーダル等の固定色はテーマ非依存 */

.pac-section {
  margin-bottom: 2rem;
}

.pac-section-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.pac-section-title i {
  color: var(--lh-accent);
}

.pac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.pac-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pac-card:hover {
  transform: translateY(-2px);
  border-color: var(--lh-accent);
}

.pac-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #222;
  overflow: hidden;
}

.pac-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pac-card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  /* ⚠️ 同じ要素の .pac-card-thumb が #222 を敷く。#666 はその上で 2.77（非テキスト 3:1 も未達） */
  color: #8a8a8a;
  font-size: 2rem;
}

.pac-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  /* ⚠️ 意味色を地にして #fff を載せる形は 2.36〜3.07。
     地は中立の --tag-bg にして意味は文字色で示す（計画書 182 Phase 3-3 の轍） */
  color: var(--text-secondary);
  background: var(--tag-bg);
  backdrop-filter: blur(4px);
}

.pac-badge-accepting { color: var(--color-success); }
.pac-badge-voting    { color: var(--color-info); }
.pac-badge-closed    { color: var(--text-secondary); }

.pac-card-body {
  padding: 0.5rem 0.75rem 0.75rem;
}

.pac-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.pac-card-period {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pac-loading,
.pac-empty,
.pac-error {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  grid-column: 1 / -1;
}

.pac-error {
  color: var(--lh-danger);
  /* 共通ルールの bg-secondary のままだと danger が 4.03 で AA 割れ（計画書 178 §8） */
  background: var(--card-bg);
}

/* --- 詳細ページ --- */

.pac-hero {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.pac-hero-thumb {
  flex: 0 0 40%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  border: 1px solid var(--border-color);
}

.pac-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pac-hero-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pac-hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pac-hero-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pac-hero-period > div + div {
  margin-top: 0.15rem;
}

.pac-hero .pac-badge {
  position: static;
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.pac-guide-note {
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 204, 34, 0.08);
  border: 1px solid rgba(255, 204, 34, 0.3);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pac-voter-status {
  margin-bottom: 1rem;
}

.pac-voter-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.4rem 0;
}

.pac-voter-note a {
  color: var(--lh-accent);
  font-weight: 600;
}

.pac-voter-note-awaiting {
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.25);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pac-voter-note-awaiting i {
  /* ⚠️ 同系色の薄い tint(0.08) の上に同じ青を置いていて 2.04。地は据え置き、文字だけテーマ追従に */
  color: var(--color-info);
}

.pac-entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.5rem;
}

.pac-entry-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.pac-entry-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  min-height: 90px;
}

/* エフェクトアニメーション（pixel_art_manager / venue-deco と同等の定義を inline） */
@keyframes pac-fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pac-fx-pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes pac-fx-sway { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@keyframes pac-fx-sparkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes pac-fx-roll { 0% { transform: rotate(0deg); } 33% { transform: rotate(360deg); } 100% { transform: rotate(2160deg); } }
@keyframes pac-fx-shine {
  0%, 88%, 100% { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4)) brightness(1); }
  92%           { filter: drop-shadow(0 0 8px rgba(255, 245, 200, 0.95)) brightness(1.5); }
  96%           { filter: drop-shadow(0 0 5px rgba(255, 235, 140, 0.5)) brightness(1.15); }
}
@keyframes pac-fx-bounce {
  0%   { transform: translateY(0) scaleY(0.95); }
  5%   { transform: translateY(-2px) scaleY(1); }
  13%  { transform: translateY(-12px) scaleY(1.05); }
  22%  { transform: translateY(-2px) scaleY(1); }
  26%  { transform: translateY(0) scaleY(0.85); }
  30%  { transform: translateY(0) scaleY(0.95); }
  100% { transform: translateY(0) scaleY(0.95); }
}
@keyframes pac-fx-twirl {
  0%, 100% { transform: scaleX(1); }
  25%      { transform: scaleX(0); }
  50%      { transform: scaleX(-1); }
  75%      { transform: scaleX(0); }
}
@keyframes pac-fx-neon {
  0%, 47.5%, 48.5%, 100% {
    filter:
      drop-shadow(0 0 2px rgba(255, 80, 220, 1))
      drop-shadow(0 0 6px rgba(255, 80, 220, 0.85))
      drop-shadow(0 0 10px rgba(80, 200, 255, 0.6))
      brightness(1.15);
  }
  48% {
    filter:
      drop-shadow(0 0 1px rgba(255, 80, 220, 0.4))
      drop-shadow(0 0 2px rgba(80, 200, 255, 0.2))
      brightness(0.85);
  }
}
@keyframes pac-fx-neon-cyan {
  0%, 47.5%, 48.5%, 100% {
    filter:
      drop-shadow(0 0 2px rgba(80, 220, 255, 1))
      drop-shadow(0 0 6px rgba(80, 220, 255, 0.85))
      drop-shadow(0 0 10px rgba(80, 100, 255, 0.6))
      brightness(1.15);
  }
  48% {
    filter:
      drop-shadow(0 0 1px rgba(80, 220, 255, 0.4))
      drop-shadow(0 0 2px rgba(80, 100, 255, 0.2))
      brightness(0.85);
  }
}
@keyframes pac-fx-neon-green {
  0%, 47.5%, 48.5%, 100% {
    filter:
      drop-shadow(0 0 2px rgba(120, 255, 80, 1))
      drop-shadow(0 0 6px rgba(120, 255, 80, 0.85))
      drop-shadow(0 0 10px rgba(220, 255, 80, 0.6))
      brightness(1.15);
  }
  48% {
    filter:
      drop-shadow(0 0 1px rgba(120, 255, 80, 0.4))
      drop-shadow(0 0 2px rgba(220, 255, 80, 0.2))
      brightness(0.85);
  }
}
@keyframes pac-fx-neon-purple {
  0%, 47.5%, 48.5%, 100% {
    filter:
      drop-shadow(0 0 2px rgba(180, 80, 255, 1))
      drop-shadow(0 0 6px rgba(180, 80, 255, 0.85))
      drop-shadow(0 0 10px rgba(255, 80, 220, 0.6))
      brightness(1.15);
  }
  48% {
    filter:
      drop-shadow(0 0 1px rgba(180, 80, 255, 0.4))
      drop-shadow(0 0 2px rgba(255, 80, 220, 0.2))
      brightness(0.85);
  }
}

.pac-fx-float        { animation: pac-fx-float 2s ease-in-out infinite; display: inline-block; }
.pac-fx-pulse        { animation: pac-fx-pulse 1.5s ease-in-out infinite; display: inline-block; }
.pac-fx-sway         { animation: pac-fx-sway 1.8s ease-in-out infinite; display: inline-block; transform-origin: center bottom; }
.pac-fx-sparkle      { animation: pac-fx-sparkle 2s ease-in-out infinite; display: inline-block; }
.pac-fx-roll         { animation: pac-fx-roll 6s linear infinite; display: inline-block; }
.pac-fx-shine        { animation: pac-fx-shine 4s ease-in-out infinite; display: inline-block; }
.pac-fx-bounce       { animation: pac-fx-bounce 3s ease-in-out infinite; display: inline-block; }
.pac-fx-twirl        { animation: pac-fx-twirl 3s ease-in-out infinite; display: inline-block; }
.pac-fx-neon         { animation: pac-fx-neon 2.5s ease-in-out infinite; display: inline-block; }
.pac-fx-neon_cyan    { animation: pac-fx-neon-cyan 2.5s ease-in-out infinite; display: inline-block; }
.pac-fx-neon_green   { animation: pac-fx-neon-green 2.5s ease-in-out infinite; display: inline-block; }
.pac-fx-neon_purple  { animation: pac-fx-neon-purple 2.5s ease-in-out infinite; display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .pac-fx-float,
  .pac-fx-pulse,
  .pac-fx-sway,
  .pac-fx-sparkle,
  .pac-fx-roll,
  .pac-fx-shine,
  .pac-fx-bounce,
  .pac-fx-twirl,
  .pac-fx-neon,
  .pac-fx-neon_cyan,
  .pac-fx-neon_green,
  .pac-fx-neon_purple {
    animation: none;
  }
}

/* 現在採用中バッジ（トロフィーアイコン、右上） */
.pac-entry-adopted-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 204, 34, 0.92);
  color: #1a1a1a;
  border-radius: 50%;
  font-size: 0.7rem;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.pac-rank-badge {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  padding: 0.1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  /* .pac-entry-preview（rgba(0,0,0,.25)）とドット絵画像の上に載るので、
     画像の上のラベルの既定解 --card-overlay-* を使う（計画書 182 Phase 3-3） */
  background: var(--card-overlay-bg);
  color: var(--card-overlay-fg);
  border-radius: 3px;
}

.pac-rank-badge-adopted {
  background: rgba(255, 204, 34, 0.9);
  color: #222;
}

.pac-entry-body {
  padding: 0.5rem 0.75rem;
}

.pac-entry-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  word-break: break-all;
}

.pac-entry-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pac-entry-author {
  padding: 0.3rem 0.5rem 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pac-entry-author a {
  color: var(--lh-accent);
  text-decoration: none;
}

.pac-entry-author a:hover {
  text-decoration: underline;
}

.pac-entry-action {
  padding: 0 0.75rem 0.75rem;
}

.pac-vote-btn {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--lh-accent);
  border-radius: 6px;
  background: transparent;
  color: var(--lh-accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pac-vote-btn:hover:not(:disabled) {
  background: rgba(255, 204, 34, 0.12);
}

.pac-vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pac-vote-btn-voted {
  background: rgba(255, 204, 34, 0.85);
  color: #222;
  border-color: rgba(255, 204, 34, 0.85);
}

.pac-vote-btn-voted:hover:not(:disabled) {
  background: rgba(255, 204, 34, 0.95);
}

.pac-vote-note {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

/* --- LiveEvent一覧に表示するバナー --- */

.pac-banner {
  background: rgba(255, 204, 34, 0.06);
  border: 1px solid rgba(255, 204, 34, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
}

.pac-banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.pac-banner-header i {
  color: var(--lh-accent);
}

.pac-banner-more {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--lh-accent);
  text-decoration: none;
}

.pac-banner-sections {
  display: flex;
  flex-direction: row;
  gap: 0.5rem 0.75rem;
}

.pac-banner-section {
  flex: 1 1 0;
  min-width: 0;
}

.pac-banner-section-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pac-banner-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
}

.pac-banner-card {
  flex: 0 1 100%;
  min-width: 0;
  max-width: 120px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.pac-banner-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--lh-track-bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pac-banner-card:hover .pac-banner-card-thumb,
.pac-banner-card:focus-visible .pac-banner-card-thumb {
  border-color: var(--lh-accent);
  box-shadow: 0 0 0 2px rgba(255, 204, 34, 0.25);
}

.pac-banner-card:focus {
  outline: none;
}

.pac-banner-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- 応募モーダル（マイドット絵ページから起動） --- */

.pac-submission-modal .pxm-modal {
  max-width: 420px;
}

.pac-submission-intro {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pac-submission-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pac-submission-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
  color: inherit;
}

.pac-submission-card:hover:not(:disabled) {
  border-color: var(--lh-accent);
}

.pac-submission-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pac-submission-card-done {
  background: rgba(128, 128, 128, 0.1);
}

.pac-submission-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 45px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
}

.pac-submission-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pac-submission-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}

.pac-submission-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.pac-submission-deadline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pac-submission-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  /* ⚠️ この行は .pxm-modal の中だけに出る（pixel_art_contest_submission_controller.js:54 が
     .pxm-modal-body に描く）。.pxm-modal は --text-* / --card-bg をダーク値に局所上書きするが
     --tag-bg は上書きしていないので、地に --tag-bg を使うと light テーマの明るい地に
     ダークの文字が乗る。**上書き済みのトークンだけで組む**（#b0b0b0 on #2a2a44 = 6.5）。
     元の #ddd on rgba(128,128,128,.3) は 1.41 だった */
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: 3px;
  font-size: 0.7rem;
  align-self: flex-start;
}

/* --- 選考会履歴モーダル --- */

.pac-history-modal .pxm-modal {
  max-width: 480px;
}

.pac-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pac-history-card {
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.pac-history-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pac-history-contest-link {
  font-weight: 600;
  color: var(--lh-accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.pac-history-contest-link:hover {
  text-decoration: underline;
}

.pac-history-status {
  position: static;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
}

.pac-history-rank {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.15rem 0;
}

.pac-history-rank-adopted {
  color: var(--lh-accent);
  font-weight: 600;
}

.pac-history-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0;
}

.pac-history-meta-highlight {
  color: var(--text-primary);
  font-weight: 600;
}

.pac-history-note {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- 応募 CTA --- */

.pac-submit-cta {
  margin: 0.75rem 0;
  display: flex;
  justify-content: center;
}

.pac-submit-btn {
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--lh-accent);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: filter 0.15s ease;
}

.pac-submit-btn:hover {
  filter: brightness(0.95);
}

.pac-submit-note {
  padding: 0.6rem 0.9rem;
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.25);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.pac-submit-note a {
  color: var(--lh-accent);
  font-weight: 600;
}

.pac-submit-note-easy {
  background: rgba(var(--warning-soft-bg-rgb), 0.08);
  border-color: rgba(var(--warning-soft-bg-rgb), 0.3);
}

/* --- 作品選択 picker モーダル --- */

.pac-picker-modal .pxm-modal {
  max-width: 560px;
}

.pac-picker-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pac-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}

.pac-picker-card {
  position: relative;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  min-height: 110px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pac-picker-card[role="button"]:hover,
.pac-picker-card[role="button"]:focus-visible {
  border-color: var(--lh-accent);
  transform: translateY(-2px);
  outline: none;
}

/* 応募済みカードは選択カーソル無効、枠を強調 */
.pac-picker-card-entered {
  cursor: default;
  border-color: rgba(255, 204, 34, 0.5);
  background: rgba(255, 204, 34, 0.06);
}

.pac-picker-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 204, 34, 0.9);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 3px;
}

.pac-picker-withdraw-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  background: transparent;
  color: var(--lh-danger);
  border: 1px solid rgba(255, 102, 102, 0.5);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pac-picker-withdraw-btn:hover {
  background: rgba(255, 102, 102, 0.12);
}

/* design-allow-end: color-literal */
