:root {
  color-scheme: light;
  --text-black: #000000;
  --text-white: #ffffff;
  --text-label: #626264;
  --text-link: #0017c1;
  --bg-standard: #f8f8fb;
  --bg-highlight: #0055ad;
  --bg-control: #f1f1f4;
  --blue-1200: #00234b;
  --blue-900: #0055ad;
  --blue-600: #008bf2;
  --blue-400: #57b8ff;
  --blue-200: #c0e4ff;
  --blue-50: #f0f9ff;
  --yellow-800: #a58000;
  --yellow-600: #d2a400;
  --yellow-400: #ffc700;
  --gray-800: #333333;
  --gray-600: #666666;
  --gray-400: #999999;
  --gray-200: #cccccc;
  --red-600: #fe3939;
  --red-200: #ffbbbb;
  --red-50: #fdeeee;
  --success: #197a4b;
  --error: #ce0000;
  --page-bg: radial-gradient(circle at top, var(--blue-50) 0%, var(--bg-standard) 45%, #eef8f3 100%);
  --panel-bg: rgba(255, 255, 255, 1.0);
  --panel-border: rgba(20, 27, 44, 0.08);
  --panel-shadow: 0 24px 48px rgba(25, 40, 80, 0.12);
  --text-primary: var(--text-black);
  --text-muted: var(--gray-600);
  --accent: var(--blue-600);
  --accent-soft: rgba(0, 139, 242, 0.18);
  --footer-text: var(--gray-600);
  --bg-card: rgba(255, 255, 255, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "LINE Seed JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--page-bg);
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 32px;
  gap: 24px;
  background-image: linear-gradient(120deg, rgba(0, 139, 242, 0.12), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(46, 193, 124, 0.12), transparent 40%);
}

.site-header {
  width: min(92vw, 900px);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
}

.site-header__brand:hover,
.site-header__brand:focus {
  color: inherit;
  text-decoration: none;
}

.site-header__brand:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-radius: 16px;
}

.site-header__logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.site-header__brand-text {
  line-height: 1;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__user {
  color: var(--text-muted);
  font-weight: 600;
}

.site-header__logout-form {
  margin: 0;
}

.site-header__judge-link {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.site-header__judge-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.site-header__judge-link:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.site-header__logout-button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.site-header__logout-button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.site-header__logout-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.page-content {
  width: min(92vw, 900px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-content--wide {
  width: min(98vw, 1800px);
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
}

.page-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.about-list {
  margin: 0 0 8px;
  padding-left: 1.4em;
  line-height: 2;
}

.about-contact,
.about-meta {
  margin: 8px 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  align-items: baseline;
}

.about-contact dt,
.about-meta dt {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.about-contact dd,
.about-meta dd {
  margin: 0;
  font-family: monospace;
  font-size: 0.95rem;
}

.breadcrumb-bar {
  background: var(--bg-control);
  border-radius: 24px 24px 0 0;
  padding: 10px 24px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -28px -24px 20px;
}

.breadcrumb-bar a {
  color: var(--text-link);
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.breadcrumb-bar__sep {
  margin: 0 4px;
  color: var(--gray-400);
  font-size: 13px;
}

.breadcrumb-bar__current {
  color: var(--text-primary);
  font-weight: 600;
}

.section-title {
  margin: 22px 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  border-left: 6px solid var(--blue-1200);
  padding-left: 8px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.form-field input,
.form-field select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  font-weight: 500;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--blue-200);
  box-shadow: 0 0 0 3px var(--blue-400);
  outline: none;
}

.primary-button {
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 85, 173, 0.25);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.primary-button:hover {
  background: var(--blue-900);
  box-shadow: 0 14px 28px rgba(0, 85, 173, 0.35);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--gray-400);
  background: var(--bg-control);
  color: var(--gray-800);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 70, 90, 0.12);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.secondary-button:hover {
  background: var(--gray-200);
  border-color: var(--gray-600);
  box-shadow: 0 10px 22px rgba(60, 70, 90, 0.18);
}

.secondary-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(153, 153, 153, 0.35);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: #d9534f;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(217, 83, 79, 0.25);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.danger-button:hover {
  background: #c9302c;
  box-shadow: 0 14px 28px rgba(217, 83, 79, 0.35);
}

.danger-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.35);
}

.danger-zone {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid rgba(217, 83, 79, 0.4);
  border-radius: 12px;
  background: rgba(217, 83, 79, 0.06);
}

.danger-zone__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #c9302c;
}

.danger-zone__description {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--gray-800);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.form-fieldset {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.form-fieldset legend {
  font-weight: 700;
  padding: 0 6px;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.form-fieldset__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 16px;
  margin-top: 6px;
}

.form-fieldset__grid .form-checkbox {
  margin-top: 0;
}

.form-fieldset__hint {
  margin: 4px 6px 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.category-edit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-edit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--panel-border);
}

.category-edit-row__select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

.category-edit-row__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-edit-row__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.category-edit-row__count input[type="number"] {
  width: 64px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: #fff;
  font-size: 0.95rem;
  text-align: right;
}

@media (max-width: 560px) {
  .category-edit-row {
    grid-template-columns: 1fr;
  }
}

.challenge-card-row {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.challenge-card {
  background: transparent;
  border-radius: 16px;
}

.challenge-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 18px;
  min-height: 120px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.82));
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 22px rgba(25,40,80,0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.challenge-card__link:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

a.challenge-card__link:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0,85,173,0.12);
  border-color: var(--accent);
}

.challenge-card__link--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.challenge-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.challenge-card__count {
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
}

.challenge-card__link--disabled .challenge-card__count {
  color: var(--text-muted);
  font-size: 1rem;
}

@media (max-width: 480px) {
  .challenge-card-row {
    grid-template-columns: 1fr;
  }
}

.category-menu {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-menu__item {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--panel-border);
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.category-menu__item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.category-menu__item:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-error {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(217, 83, 79, 0.12);
  border: 1px solid rgba(217, 83, 79, 0.35);
  color: #a23a36;
  font-weight: 600;
}

.form-success {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(85, 201, 149, 0.16);
  border: 1px solid rgba(85, 201, 149, 0.45);
  color: #2c8a64;
  font-weight: 600;
}

.import-results {
  margin-top: 16px;
}

.import-results__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.import-results__item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
}

.import-results__label {
  flex: 1;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.import-results__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.import-results__badge--ok {
  background: rgba(85, 201, 149, 0.18);
  color: #2c8a64;
}

.import-results__badge--ng {
  background: rgba(217, 83, 79, 0.12);
  color: #a23a36;
}

.import-results__badge--warn {
  background: rgba(255, 193, 7, 0.18);
  color: #7a6000;
}

.import-results__note {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

html.dark .import-results__badge--ok { color: #55c995; background: rgba(85, 201, 149, 0.18); }
html.dark .import-results__badge--ng { color: #ff7070; background: rgba(217, 83, 79, 0.18); }
html.dark .import-results__badge--warn { color: #ffc107; background: rgba(255, 193, 7, 0.15); }

.visibility-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visibility-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.65;
  vertical-align: middle;
}

.visibility-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--panel-border);
}

.visibility-row__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.visibility-row__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visibility-row__select select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .visibility-row {
    grid-template-columns: 1fr;
  }
}

.competition-pick-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comp-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.comp-search__input {
  flex: 1;
  padding: 8px 36px 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: #fff;
  font-size: 0.95rem;
}

.comp-search__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.comp-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: var(--gray-200);
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comp-search__clear:hover {
  background: var(--gray-400);
  color: #fff;
}

.comp-row {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
}

.comp-row__details {
  /* allow native open/close */
}

.comp-row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.comp-row__head::-webkit-details-marker {
  display: none;
}

.comp-row__select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.comp-row__name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-row__season {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.comp-row__chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] > .comp-row__head .comp-row__chevron {
  transform: rotate(180deg);
}

.comp-row__body {
  padding: 4px 12px 12px 38px;
  border-top: 1px dashed var(--panel-border);
}

.comp-row__body-hint {
  margin: 8px 0 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.comp-row__empty-hit {
  margin: 12px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .comp-row__season {
    display: none;
  }
}

.assigned-comp-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assigned-comp-row {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assigned-comp-row__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.assigned-comp-row__name {
  font-weight: 700;
  color: var(--text-primary);
}

.assigned-comp-row__season {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.assigned-comp-row__regu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
}

.badge--muted {
  background: var(--gray-200);
  color: var(--gray-600, #666);
}

.image-preview {
  display: block;
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 6px;
  object-fit: contain; /* 画像が全て収まるように調整 */
  object-position: center; /* 中央に配置 */
}

.site-footer {
  width: min(92vw, 720px);
  padding: 10px 0;
  text-align: center;
  color: var(--footer-text);
  font-weight: 500;
}

@media (min-height: 900px) {
  .page-shell {
    padding-top: 36px;
    padding-bottom: 48px;
  }

  .page-title {
    font-size: 2.2rem;
  }
}

/* Dashboard: season / competition card styles */
.season-list,
.competition-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr; /* 縦並び（1列）に固定 */
  gap: 16px;
}

.season-card,
.competition-card {
  background: transparent;
  border-radius: 16px;
  overflow: visible;
  min-width: 0;
}

.competition-card.is-sortable {
  cursor: grab;
}
.competition-card.is-sortable:active {
  cursor: grabbing;
}
.competition-card.is-dragging {
  opacity: 0.35;
}
.competition-card.drag-over {
  outline: 2px dashed var(--accent-color, #5b8dee);
  outline-offset: 3px;
  border-radius: 16px;
}

.season-card__link,
.competition-card__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.82));
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 22px rgba(25,40,80,0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
  min-width: 0;
}

.season-card__link:focus,
.competition-card__link:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.season-card__link:hover,
.competition-card__link:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,85,173,0.12);
  border-color: var(--accent);
}

.competition-card__link--disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.competition-card__link--disabled .competition-card__image,
.competition-card__link--disabled .competition-card__body {
  opacity: 0.45;
}

.season-card__image,
.competition-card__image {
  width: 160px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: contain; /* 画像が全て収まるように調整 */
  object-position: center; /* 中央に配置 */
}

.season-card__image--placeholder,
.competition-card__image--placeholder {
  width: 160px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-control);
  color: var(--text-muted);
  border-radius: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.season-card__body,
.competition-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.competition-card__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.season-card__name,
.competition-card__name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.competition-card__name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.competition-access-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(37, 45, 58, 0.18);
  background: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(60, 70, 90, 0.12);
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease,
    transform 0.22s ease;
}

.competition-access-indicator--public {
  background: #2fbf71;
  border-color: rgba(47, 191, 113, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(47, 191, 113, 0.18);
}

.competition-access-indicator--private {
  background: #e25151;
  border-color: rgba(226, 81, 81, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(226, 81, 81, 0.18);
}

.season-card__year,
.competition-card__meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.season-card__description {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.category-tags__group {
  display: inline-flex;
  gap: 4px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  /* font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; */
  font-family: "LINE Seed JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--gray-200);
  color: var(--gray-400);
  letter-spacing: 0.04em;
  transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease,
    transform 0.22s ease;
  width: 36px;
}

.category-tag.is-active {
  color: var(--gray-800);
  box-shadow: 0 6px 14px rgba(60, 70, 90, 0.12);
}

.category-tag--eS.is-active { background: #86b9e9; }
.category-tag--eJ.is-active { background: #ffd864; }
.category-tag--eE.is-active { background: #ffb786; }
.category-tag--mS.is-active { background: #bddda7; }
.category-tag--mJ.is-active { background: #f5bcfc; }
.category-tag--mE.is-active { background: #55c995; }
.category-tag--C1.is-active { background: #c0a4ff; }
.category-tag--C2.is-active { background: #ffc1c1; }
.category-tag--C3.is-active { background: #b5e8d8; }


.category-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.category-card {
  background: transparent;
  border-radius: 16px;
  overflow: visible;
}

.category-card__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  height: 100%;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.82));
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 22px rgba(25,40,80,0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.category-card__link:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

a.category-card__link:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0,85,173,0.12);
  border-color: var(--accent);
}

.category-card__link--disabled {
  cursor: not-allowed;
}

.category-card__link--disabled .category-card__image,
.category-card__link--disabled .category-card__header,
.category-card__link--disabled .category-card__challenges {
  opacity: 0.45;
}

.category-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.category-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-card__name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.category-card__image {
  width: 160px;
  height: 96px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: var(--bg-control);
  flex-shrink: 0;
}

.category-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.category-card__challenges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.category-card__notice {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 83, 79, 0.12);
  color: #a23a36;
  font-size: 0.78rem;
  font-weight: 700;
}

.challenge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.challenge-item.is-on {
  color: var(--gray-800);
}

.challenge-item.is-off {
  color: var(--gray-400);
}

.challenge-item__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.challenge-item.is-on .challenge-item__mark {
  background: rgba(85, 201, 149, 0.18);
  color: #2c8a64;
}

.challenge-item.is-off .challenge-item__mark {
  background: var(--gray-200);
  color: var(--gray-400);
}

.season-hero-image {
  display: block;
  width: 320px;
  object-fit: cover;
  border-radius: 16px;
  margin: 16px 0 8px;
}

.season-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.season-heading__image {
  width: 160px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: contain; /* 画像が全て収まるように調整 */
  object-position: center; /* 中央に配置 */
}

.season-heading__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.season-heading__text .page-title {
  margin: 0;
}

.season-heading__text .page-subtitle {
  margin-top: 4px;
}

/* Dashboard: super user tools */
.admin-tools {
  margin-top: 40px;
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.admin-tools__section {
  margin-top: 14px;
}

.admin-tools__section-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-tools__list {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
}

.admin-tools__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s ease;
}

.admin-tools__item::after {
  content: ">";
  color: var(--text-muted);
}

.admin-tools__item + .admin-tools__item {
  border-top: 1px solid var(--panel-border);
}

.admin-tools__item:hover {
  background: rgba(0, 139, 242, 0.08);
}

.admin-tools__item--danger {
  color: #a23a36;
}

.admin-tools__item--danger:hover {
  background: rgba(217, 83, 79, 0.1);
}

.reset-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
  cursor: pointer;
}

.reset-option:last-child {
  border-bottom: none;
}

.reset-option .form-checkbox__input {
  margin-bottom: 2px;
}

.reset-option__note {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  padding-left: 30px;
}

@media (max-width: 420px) {
  .season-list,
  .competition-list {
    grid-template-columns: 1fr;
  }
  .season-card__image,
  .season-card__image--placeholder {
    width: 120px;
    height: 72px;
  }
}

/* ─── User list ─────────────────────────────── */
.user-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
  transition: background 0.18s ease;
}

.user-row:hover {
  background: rgba(0, 139, 242, 0.06);
}

.user-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-row__name {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.user-row__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-row__login-id {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.user-row__detail-btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.role-badge--0 {
  background: rgba(173, 12, 0, 0.158);
  color: var(--red-600);
}

.role-badge--1 {
  background: rgba(0, 139, 242, 0.14);
  color: #006ab3;
}

.role-badge--2 {
  background: rgba(153, 153, 153, 0.18);
  color: var(--gray-800);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge--active {
  background: rgba(25, 122, 75, 0.14);
  color: var(--success);
}

.status-badge--inactive {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* User detail info list */
.user-info-list {
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.user-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
}

.user-info-row:last-child {
  border-bottom: none;
}

.user-info-row__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
}

.user-info-row__value {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* User detail menu list */
.user-menu-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.user-menu-item {
  border-bottom: 1px solid var(--panel-border);
}

.user-menu-item:last-child {
  border-bottom: none;
}

.user-menu-item__link {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  transition: background 0.18s ease;
}

.user-menu-item__link:hover {
  background: rgba(0, 139, 242, 0.08);
}

.user-menu-item__label {
  flex: 1;
}

.user-menu-item__arrow {
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .user-row {
    flex-wrap: wrap;
  }
  .user-info-row__label {
    width: 80px;
  }
}

/* ─── Season-level bulk settings ────────────── */
.bulk-av-section {
  margin-top: 20px;
}

.bulk-av-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--blue-1200);
  margin-bottom: 8px;
}

.bulk-av-section__image {
  max-height: 28px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.bulk-av-section__name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.bulk-av-section__empty {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Team edit form ─────────────────────────── */
.form-field textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  font-weight: 500;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field textarea:focus {
  border-color: var(--blue-200);
  box-shadow: 0 0 0 3px rgba(192, 228, 255, 0.6);
  outline: none;
}

.form-required {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(206, 0, 0, 0.12);
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
  width: fit-content;
  text-align: center;
}

.team-edit-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.team-edit-row .form-field {
  flex: 1;
  min-width: 100px;
  max-width: 180px;
}

.team-member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.team-member-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--panel-border);
}

.team-member-block__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

@media (max-width: 600px) {
  .team-member-grid {
    grid-template-columns: 1fr;
  }
  .team-edit-row .form-field {
    max-width: none;
  }
}

/* ─── Team list table ────────────────────────── */
.team-table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.7);
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  white-space: nowrap;
}

.team-table__th {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 35, 75, 0.05);
  border-bottom: 2px solid var(--panel-border);
  text-align: left;
}

.team-table__th--id {
  width: 56px;
  text-align: center;
}

.team-table__th--action {
  width: 64px;
}

.team-table__row:hover {
  background: rgba(0, 139, 242, 0.05);
}

.team-table__row + .team-table__row {
  border-top: 1px solid var(--panel-border);
}

.team-table__td {
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-primary);
  vertical-align: middle;
}

.team-table__td--id {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}

.team-table__td--name {
  font-weight: 800;
}

.team-table__grade {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.team-table__edit-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(0, 139, 242, 0.12);
  color: var(--blue-900);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease;
}

.team-table__edit-btn:hover {
  background: rgba(0, 139, 242, 0.22);
}

.team-table__delete-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(217, 83, 79, 0.1);
  color: #a23a36;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease;
  font-family: inherit;
}

.team-table__delete-btn:hover {
  background: rgba(217, 83, 79, 0.22);
}

.team-table__delete-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.team-table__count {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}

/* ─── Results page ───────────────────────────── */
.result-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  white-space: nowrap;
}

.result-table__th {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 35, 75, 0.05);
  border-bottom: 2px solid var(--panel-border);
  text-align: left;
}

.result-table__subhead th {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 35, 75, 0.03);
  border-bottom: 1px solid var(--panel-border);
  text-align: center;
}

.result-table__th--rank,
.result-table__th--id {
  text-align: center;
  width: 48px;
}

.result-table__th--pt,
.result-table__th--tm {
  text-align: right;
  width: 60px;
}

.result-table__th--score {
  text-align: center;
}

.result-table__row:hover {
  background: rgba(0, 139, 242, 0.04);
}

.result-table__row + .result-table__row {
  border-top: 1px solid var(--panel-border);
}

.result-table__row--gold   { background: rgba(255, 199, 0,   0.10); }
.result-table__row--silver { background: rgba(180, 180, 190, 0.14); }
.result-table__row--bronze { background: rgba(205, 127, 50,  0.10); }

.result-table__row--gold:hover   { background: rgba(255, 199, 0,   0.18); }
.result-table__row--silver:hover { background: rgba(180, 180, 190, 0.22); }
.result-table__row--bronze:hover { background: rgba(205, 127, 50,  0.18); }

.result-table__row--exhibition {
  opacity: 0.7;
  font-style: italic;
}

.result-table__td {
  padding: 9px 12px;
  font-weight: 600;
  color: var(--text-primary);
  vertical-align: middle;
}

.result-table__td--rank {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-muted);
}

.result-table__td--id {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}

.result-table__td--name {
  font-weight: 800;
}

.result-table__td--pt {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-table__td--tm {
  text-align: right;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.result-table__td--total {
  color: var(--blue-900);
  font-weight: 800;
}

.result-table__td--date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.result-table__td--detail {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.record-detail {
  cursor: default;
}

.result-table__td--del {
  width: 56px;
  text-align: center;
}

.record-del-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(217, 83, 79, 0.4);
  background: rgba(217, 83, 79, 0.08);
  color: #c9302c;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease;
}

.record-del-btn:hover {
  background: rgba(217, 83, 79, 0.2);
}

.record-challenge-title {
  margin: 20px 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}

.record-attempt {
  margin-top: 10px;
}

.record-attempt__label {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(0, 35, 75, 0.07);
  color: var(--blue-1200);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-table__td--action {
  width: 56px;
  text-align: center;
}

.record-detail-btn {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 8px;
  background: rgba(0, 139, 242, 0.10);
  color: var(--blue-900);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease;
}

.record-detail-btn:hover {
  background: rgba(0, 139, 242, 0.20);
}

/* ─── Record detail view ─────────────────────── */
.record-detail-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue-900);
}

.record-exhibition-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(153, 153, 153, 0.18);
  color: var(--gray-600);
  font-size: 0.78rem;
  font-weight: 700;
}

.record-detail-pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 35, 75, 0.04);
  border: 1px solid var(--panel-border);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────
   フォーム定義エディタ
───────────────────────────────────────────────────────── */

.form-stack--inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-field--inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.form-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--bg-control);
  font-size: 0.95rem;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
  border-color: var(--blue-200);
  box-shadow: 0 0 0 3px var(--blue-400);
  outline: none;
}

.form-input--sm {
  padding: 6px 10px;
  font-size: 0.88rem;
  border-radius: 8px;
}

.form-input--short {
  width: 120px;
}

.form-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.form-required {
  color: var(--danger);
  margin-left: 2px;
  font-size: 0.85rem;
}

.form-field-group {
  margin-bottom: 0;
}

.secondary-button--sm,
.danger-button--sm {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 8px;
}

.form-def-section {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: var(--bg-card);
}

.form-def-section__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.form-def-section__title-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.form-def-section__title-input {
  flex: 1 1 160px;
}

.form-def-section__title-input--en {
  color: var(--text-primary);
}

.form-def-section__del-form {
  flex-shrink: 0;
}

.form-def-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 8px 0;
}

.form-def-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.form-def-table__th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
}

.form-def-table__th--no    { width: 36px; }
.form-def-table__th--action{ width: 220px; }

.form-def-table__td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.form-def-table__td--no {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.form-def-table__td--title {
  line-height: 1.5;
}

.form-def-table__td--pts {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.form-def-table__td--action {
  white-space: nowrap;
}

.form-def-action-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.form-def-mission-ja {
  display: block;
  font-weight: 500;
}

.form-def-mission-en {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-def-inline-form {
  display: inline;
}

.form-def-section__add-mission {
  margin-top: 10px;
}

.form-type-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background: var(--bg-control);
  color: var(--text-primary);
}

.form-type-badge--1 { background: #d1fae5; color: #065f46; }
.form-type-badge--2 { background: #dbeafe; color: #1e40af; }
.form-type-badge--3 { background: #ede9fe; color: #5b21b6; }
.form-type-badge--4 { background: #fef3c7; color: #92400e; }

.icon-button {
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.15s;
}

.icon-button:hover {
  background: var(--bg-control);
}

.icon-button:disabled {
  opacity: 0.3;
  cursor: default;
}

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

.form-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.form-inline__input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--input-bg, var(--panel-bg));
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-inline__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ─────────────────────────────────────────────────────────
   採点フォーム
───────────────────────────────────────────────────────── */

.form-label-ja,
.form-label-en {
  display: block;
}

.form-label-en {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scoring-round-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.scoring-round-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

.scoring-round-radio {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  margin-top: 0;
}

.scoring-round-radio:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.scoring-round-radio:checked::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.scoring-round-radio:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}

.form-checkbox__input {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-400);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-checkbox__input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.form-checkbox__input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  /* top: 2px; */
  width: 7px;
  height: 12px;
  border: 2.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-checkbox__input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-checkbox__label-ja {
  font-weight: 500;
}

.form-checkbox__label-en {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.scoring-section {
  margin-bottom: 28px;
}

.scoring-section__heading {
  padding: 8px 14px;
  background: var(--bg-control);
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.scoring-section__title-ja {
  font-weight: 700;
  font-size: 1.125rem;
}

.scoring-section__title-en {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scoring-mission {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-card);
}

.scoring-mission__info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.scoring-mission__num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 32px;
}

.scoring-mission__title-ja {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.scoring-mission__title-en {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.scoring-mission__input-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.scoring-mission__input-area {
  flex: 1 1 auto;
}

.scoring-mission__score-display {
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.scoring-mission__score-val {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
}

.scoring-mission__score-unit {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.scoring-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.scoring-radio-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.scoring-radio-label:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.scoring-radio {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  margin-top: 0;
}

.scoring-radio:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.scoring-radio:checked::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.scoring-radio:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input--select {
  width: auto;
  min-width: 120px;
}

.scoring-direct-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-input--time {
  width: 180px;
}

.scoring-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.scoring-total-box {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--bg-control);
}

.scoring-total-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.scoring-total-row:last-child {
  margin-bottom: 0;
}

.scoring-total-row--max {
  opacity: 0.65;
}

.scoring-total-label-ja {
  font-weight: 600;
  min-width: 60px;
}

.scoring-total-label-en {
  font-size: 0.95rem;
  color: var(--text-muted);
  min-width: 80px;
}

.scoring-total-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 60px;
  text-align: right;
}

.scoring-total-unit {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.form-checkbox--confirm .form-checkbox__label-ja {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-black);
}

.lang-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.lang-toggle-bar__back {
  margin-top: 0;
  font-size: 0.9rem;
  padding: 8px 14px;
}

.lang-toggle-btn {
  position: relative;
  width: 72px;
  height: 36px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  padding: 0;
  background: var(--gray-200);
  transition: background 0.25s;
  flex-shrink: 0;
  outline: none;
}

.lang-toggle-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lang-toggle-btn[aria-pressed="true"] {
  background: var(--accent);
}

.lang-toggle-btn__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gray-800);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  letter-spacing: 0.02em;
}

.lang-toggle-btn[aria-pressed="true"] .lang-toggle-btn__thumb {
  left: 40px;
}

.lang-btn-ja { display: block; }
.lang-btn-en { display: none; }

.lang-toggle-btn[aria-pressed="true"] .lang-btn-ja { display: none; }
.lang-toggle-btn[aria-pressed="true"] .lang-btn-en { display: block; }

.scoring-form--lang-en .scoring-section__title-ja,
.scoring-form--lang-en .scoring-mission__title-ja,
.scoring-form--lang-en .form-checkbox__label-ja,
.scoring-form--lang-en .scoring-total-label-ja,
.scoring-form--lang-en .form-label-ja {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.scoring-form--lang-en .scoring-section__title-en,
.scoring-form--lang-en .scoring-mission__title-en,
.scoring-form--lang-en .form-checkbox__label-en,
.scoring-form--lang-en .scoring-total-label-en,
.scoring-form--lang-en .form-label-en {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────
   送信確認ページ
───────────────────────────────────────────────────────── */

.confirm-table .confirm-table__section-row td {
  background: var(--bg-control);
  padding: 6px 10px;
  font-weight: 600;
}

.confirm-section-ja {
  display: inline;
  font-weight: 700;
}

.confirm-section-en {
  display: inline;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.confirm-mission-ja {
  display: block;
  font-weight: 500;
}

.confirm-mission-en {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.confirm-th-ja {
  display: block;
}

.confirm-th-en {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.user-info-label-ja {
  display: block;
  font-size: 0.9rem;
}

.user-info-label-en {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── 入力制限リスト（フォームエディタ）── */
.constraint-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.constraint-item {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--bg-control);
}

.constraint-item__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.constraint-item__label {
  flex: 1 1 auto;
  font-weight: 600;
  color: var(--text-primary);
}

.constraint-item__max {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.constraint-item__actions {
  display: flex;
  gap: 8px;
}

.constraint-item__missions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.constraint-mission-badge {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: #e8f0fe;
  color: #1a56c4;
  border-radius: 20px;
  font-weight: 500;
}

.constraint-mission-badge--none {
  background: var(--bg-control);
  color: var(--text-muted);
}

.form-actions--left {
  justify-content: flex-start;
}

/* ── 入力制限警告（採点フォーム）── */
#constraint-warnings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.constraint-warning-box {
  border-radius: 10px;
  padding: 12px 16px;
  background: #fff8e1;
  border: 1px solid #f9a825;
  color: #6d4c00;
}

.constraint-warning-box__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.constraint-warning-box__body {
  font-size: 0.9rem;
}

/* ── 入力制限編集フォーム（fieldset）── */
.form-fieldset {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px 16px;
  background: var(--bg-control);
}

.form-fieldset__legend {
  font-weight: 600;
  padding: 0 6px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.form-fieldset__group {
  margin-top: 12px;
}

.form-fieldset__group + .form-fieldset__group {
  margin-top: 16px;
}

.form-fieldset__group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.page-subtitle--sm {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── ミッション判定例画像トグル（採点フォーム）── */
.judgment-image-area {
  margin-top: 8px;
}

.judgment-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--bg-control);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.judgment-toggle-btn:hover {
  background: var(--gray-200);
}

.judgment-toggle-btn__icon {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.judgment-image-box {
  margin-top: 10px;
}

.judgment-image {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--panel-border);
}

/* ── ミッション画像アップロード（フォーム編集）── */
.form-image-preview {
  margin-bottom: 8px;
}

.form-image-preview__img {
  max-width: 320px;
  max-height: 200px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  display: block;
}

.form-input-file {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.form-field__sublabel {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── エクスポート / インポート ── */
.export-import-row {
  margin-bottom: 16px;
}

.form-stack--import {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--bg-control);
}

.csv-col-toggle{
  margin-top: 10px;
}

/* ── CSV ダウンロード / 印刷ボタン行 ── */
.csv-download-row,
.print-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

/* ─────────────────────────────────────────────────────────
   印刷スタイル
───────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .breadcrumb-bar,
  .season-heading,
  .form-actions,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    font-size: 10pt;
  }

  .page-shell {
    padding: 0;
    gap: 0;
    background: none;
    background-image: none;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}

/* ─────────────────────────────────────────────────────────
   設定ページ
───────────────────────────────────────────────────────── */

.settings-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row__name {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
}

.setting-row__desc {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  padding: 0;
  background: var(--gray-200);
  transition: background 0.25s;
  flex-shrink: 0;
  outline: none;
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-toggle[aria-pressed="true"] {
  background: var(--accent);
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle[aria-pressed="true"] .theme-toggle__thumb {
  left: 27px;
}

/* ─────────────────────────────────────────────────────────
   ダークモード
───────────────────────────────────────────────────────── */

html.dark {
  color-scheme: dark;
  --bg-standard: #1c1e24;
  --bg-control: #26282f;
  --bg-highlight: #1a3a6b;
  --blue-50: #0d1520;
  --gray-800: #e4e4ec;
  --gray-600: #9898a8;
  --gray-400: #56565e;
  --gray-200: #3a3c44;
  --red-50: #2a1010;
  --page-bg: radial-gradient(circle at top, #0d1520 0%, #1c1e24 45%, #0e1a14 100%);
  --panel-bg: rgba(26, 28, 36, 0.96);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  --text-primary: #e4e4ec;
  --text-muted: #9898a8;
  --accent-soft: rgba(0, 139, 242, 0.28);
  --bg-card: #20222a;
  --text-link: #57b8ff;
}

html.dark .form-field input,
html.dark .form-field select,
html.dark .form-input {
  background: #43454d;
  color: #e4e4ec;
  border-color: #3a3c44;
}

html.dark .scoring-radio,
html.dark .scoring-round-radio,
html.dark .form-checkbox__input {
  background: #26282f;
  border-color: #56565e;
}

html.dark .scoring-section__heading {
  background: #4b4f5a;
}

html.dark .scoring-total-box {
  background: #3e414b;
}

html.dark .scoring-mission {
  background: #20222a;
}

html.dark .breadcrumb-bar {
  background: #26282f;
}

html.dark .admin-tools {
  /* background: #20222a; */
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .admin-tools__item {
  background: #26282f;
  color: #e4e4ec;
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .admin-tools__item:hover {
  background: #2e3040;
}

html.dark .admin-tools__item--danger {
  color: #ff7070;
}

html.dark .admin-tools__item--danger:hover {
  background: rgba(217, 83, 79, 0.18);
}

html.dark .competition-card,
html.dark .season-card,
html.dark .user-menu-item {
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .season-card__image--placeholder,
html.dark .competition-card__image--placeholder {
  background: #26282f;
  color: #56565e;
}

html.dark .scoring-radio-label {
  border-color: #3a3c44;
}

html.dark .scoring-radio-label:has(input:checked) {
  background: rgba(0, 139, 242, 0.18);
  border-color: var(--accent);
}

/* ── カード系リンク（白グラデーション → ダーク）── */
html.dark .season-card__link,
html.dark .competition-card__link,
html.dark .category-card__link,
html.dark .challenge-card__link {
  background: linear-gradient(180deg, #2e3040, #272932);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
}

html.dark .season-card__link:hover,
html.dark .competition-card__link:hover,
html.dark .category-card__link:hover,
html.dark .challenge-card__link:hover {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
  border-color: var(--accent);
}

/* ── ロゴ切り替え ── */
.site-header__logo--dark { display: none; }
html.dark .site-header__logo--light { display: none; }
html.dark .site-header__logo--dark  { display: block; }

/* ── ユーザーメニュー ── */
html.dark .user-menu-list {
  background: #26282f;
}

html.dark .user-menu-item__link {
  color: #e4e4ec;
}

html.dark .user-menu-item__link:hover {
  background: #2e3040;
}

/* ── カテゴリメニュー（competition_detail）── */
html.dark .category-menu__item {
  background: #26282f;
  color: #e4e4ec;
}
html.dark .category-menu__item:hover {
  background: #2e3040;
  border-color: var(--accent);
}

/* ── 観客公開設定行 ── */
html.dark .visibility-row {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.07);
}
html.dark .bulk-av-section__header {
  border-bottom: 3px solid var(--blue-600);
}
html.dark .visibility-row__select select {
  background: #26282f;
  color: #e4e4ec;
  border-color: #3a3c44;
}

/* ── 大会公開設定・ユーザー検索行 ── */
html.dark .comp-search__input {
  background: #26282f;
  color: #e4e4ec;
}
html.dark .comp-row,
html.dark .assigned-comp-row {
  background: #20222a;
}

/* ── カテゴリ編集行（edit_competition 等）── */
html.dark .category-edit-row {
  background: #26282f;
}
html.dark .category-edit-row__count input[type="number"] {
  background: #26282f;
  color: #e4e4ec;
  border-color: #3a3c44;
}

/* ── 制約警告ボックス ── */
html.dark .constraint-warning-box {
  background: #2a2010;
  border-color: #c87800;
  color: #f0c060;
}

/* ── フォームエディター ── */
html.dark .form-def-section {
  background: #20222a;
}

/* ── select 要素全般（form-input でカバーしきれない箇所）── */
html.dark select {
  background: #26282f;
  color: #e4e4ec;
  border-color: #3a3c44;
}

/* ── テーブルラッパー（チーム一覧・競技結果）── */
html.dark .team-table-wrapper,
html.dark .result-table-wrapper {
  background: #20222a;
  border-color: rgba(255, 255, 255, 0.09);
}

html.dark .team-table__th {
  background: rgba(255, 255, 255, 0.05);
  color: #9898a8;
  border-color: rgba(255, 255, 255, 0.09);
}

html.dark .team-table__row:hover {
  background: rgba(0, 139, 242, 0.1);
}

html.dark .team-table__row + .team-table__row {
  border-color: rgba(255, 255, 255, 0.07);
}

/* ── フォームフィールドset・テキストエリア ── */
html.dark .form-fieldset {
  background: #26282f;
}

html.dark .form-field input,
html.dark .form-field select,
html.dark .form-field textarea {
  background: #26282f;
  color: #e4e4ec;
  border-color: #3a3c44;
}

/* ── admin-tools 内部リスト ── */
html.dark .admin-tools__list {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.07);
}

/* ── ユーザー関連要素 ── */
html.dark .user-row {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .user-info-list {
  background: #20222a;
  border-color: rgba(255, 255, 255, 0.09);
}

/* ── visibility アイコン（ダークモード：白版を使用）── */
html.dark img.visibility-icon[src$="visibility.svg"] {
  content: url('/images/icons/visibility_white.svg');
}
html.dark img.visibility-icon[src$="visibility_off.svg"] {
  content: url('/images/icons/visibility_off_white.svg');
}

/* ── チャレンジ開催インジケータ（緑丸）── */
html.dark .challenge-item.is-on .challenge-item__mark {
  background: rgba(85, 201, 149, 0.28);
  color: #55c995;
}

/* ── 必須バッジ（--danger未定義で白色継承になるため明示指定）── */
html.dark .form-required {
  color: #ff7070;
  background: rgba(206, 0, 0, 0.22);
}

/* ── チームメンバーブロック ── */
html.dark .team-member-block {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.09);
}

/* ── section-title 左ボーダー ── */
html.dark .section-title {
  border-left-color: var(--accent);
}

/* ── 競技結果の合計点 ── */
html.dark .result-table__td--total {
  color: var(--blue-600);
}

/* ── 走行記録ラベル（第1走・第2走）── */
html.dark .record-attempt__label {
  background: rgba(0, 139, 242, 0.18);
  color: var(--blue-400);
}

/* ── 詳細ボタン・チーム編集ボタン ── */
html.dark .record-detail-btn,
html.dark .team-table__edit-btn {
  color: var(--blue-400);
  background: rgba(0, 139, 242, 0.15);
}

html.dark .team-table__delete-btn {
  color: #ff7070;
  background: rgba(217, 83, 79, 0.14);
}

html.dark .team-table__delete-btn:hover {
  background: rgba(217, 83, 79, 0.26);
}

html.dark .record-detail-btn:hover,
html.dark .team-table__edit-btn:hover {
  background: rgba(0, 139, 242, 0.28);
}

/* ── 削除ボタン ── */
html.dark .record-del-btn {
  color: #ff7070;
  background: rgba(217, 83, 79, 0.14);
  border-color: rgba(217, 83, 79, 0.5);
}

html.dark .record-del-btn:hover {
  background: rgba(217, 83, 79, 0.28);
}

/* ── 確認チェックボックスラベル（黒固定 → ダーク時は明色に）── */
html.dark .form-checkbox--confirm .form-checkbox__label-ja {
  color: var(--text-primary);
}

/* ── JA/EN トグルの丸内テキスト（白背景上なので常に暗色）── */
html.dark .lang-toggle-btn__thumb {
  color: #1a1a1a;
}

/* ── カテゴリタグ（アクティブ時はパステル背景なので文字を常に暗色に）── */
html.dark .category-tag.is-active {
  color: #1a1a1a;
}

/* 非アクティブタグは背景・文字ともに少し明るく読みやすく */
html.dark .category-tag:not(.is-active) {
  background: #3a3c44;
  color: #78788a;
}

/* ═══════════════════════════════════════════════
   モバイル: アカウントボタン + ポップアップ
═══════════════════════════════════════════════ */

.site-header__account-wrap {
  position: relative;
  display: none;
}

.site-header__account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--bg-control);
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease;
}

.site-header__account-btn:hover {
  background: var(--accent-soft);
}

.site-header__account-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.site-header__account-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0);
}

.site-header__account-popup {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--panel-shadow);
  padding: 12px;
  backdrop-filter: blur(12px);
  z-index: 200;
}

.site-header__account-popup.is-open {
  display: block;
}

.site-header__account-popup-name {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 8px;
}

.site-header__account-popup-logout {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-header__account-popup-logout:hover {
  background: rgba(217, 83, 79, 0.1);
  color: #a23a36;
}

.site-header__account-popup-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.18s ease;
}

.site-header__account-popup-link:hover {
  background: var(--accent-soft);
}

/* ═══════════════════════════════════════════════
   レスポンシブ: スマートフォン (max-width: 640px)
═══════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* ヘッダー */
  .site-header {
    height: 70px;
    padding: 0 16px;
  }

  .site-header__logo {
    height: 24px;
  }

  .site-header__user,
  .site-header__logout-form,
  .site-header__judge-link {
    display: none;
  }

  .site-header__account-wrap {
    display: block;
  }

  /* カード余白を縮小 */
  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .breadcrumb-bar {
    margin: -20px -16px 16px;
    border-radius: 16px 16px 0 0;
    padding: 8px 16px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  /* シーズン・大会・カテゴリ画像を非表示 */
  .season-hero-image,
  .season-heading__image,
  .season-card__image,
  .season-card__image--placeholder,
  .competition-card__image,
  .competition-card__image--placeholder,
  .category-card__image,
  .category-card__image--placeholder {
    display: none;
  }

  .result-table{
    font-size: 0.75rem;
  }
}

/* ダークモード: アカウントボタン */
html.dark .site-header__account-icon {
  filter: brightness(0) invert(1);
}

html.dark .site-header__account-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark .site-header__account-popup {
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .site-header__account-popup-name {
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark .site-header__account-popup-logout:hover {
  background: rgba(217, 83, 79, 0.15);
  color: #ff7070;
}

/* ════════════════════════════════════════════════
   呼び出しドロワー（採点フォーム）
   ════════════════════════════════════════════════ */

.call-drawer__toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  background: var(--blue-900);
  color: #fff;
  border: none;
  border-radius: 0 10px 10px 0;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  transition: background 0.18s;
}

.call-drawer__toggle:hover {
  background: var(--blue-600);
}

.call-drawer__toggle-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.call-drawer__toggle-label {
  writing-mode: vertical-rl;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.call-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1098;
  display: none;
}

.call-drawer__backdrop.is-open {
  display: block;
}

.call-drawer__panel {
  position: fixed;
  left: -380px;
  top: 0;
  height: 100%;
  width: 360px;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.call-drawer__panel.is-open {
  left: 0;
}

.call-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.call-drawer__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.call-drawer__close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}

.call-drawer__close:hover {
  background: var(--bg-control);
}

.call-drawer__body {
  overflow-y: auto;
  flex: 1;
  padding: 12px 10px;
}

.call-drawer__empty {
  padding: 24px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── 呼び出しテーブル ── */
.call-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.call-table__th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--panel-border);
  background: transparent;
  white-space: nowrap;
}

.call-table__th--team {
  width: 100%;
}

.call-table__row:not(:last-child) .call-table__td {
  border-bottom: 1px solid var(--panel-border);
}

.call-table__td {
  padding: 10px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.call-table__td--team {
  white-space: normal;
  word-break: break-all;
  font-weight: 600;
}

/* ── 呼び出しボタン ── */
.call-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: var(--blue-900);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.1s;
}

.call-btn:hover {
  background: var(--blue-600);
}

.call-btn:active {
  transform: scale(0.95);
}

.call-btn--active {
  background: var(--success);
}

@media (max-width: 600px) {
  .call-drawer__toggle {
    display: none;
  }
}

.form-field__team-label-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.call-drawer__toggle--inline {
  display: none;
}

@media (max-width: 600px) {
  .call-drawer__toggle--inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--blue-900);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s;
  }

  .call-drawer__toggle--inline:hover {
    background: var(--blue-600);
  }
}

/* ════════════════════════════════════════════════
   呼び出し表示画面（call_display）
   ════════════════════════════════════════════════ */

/* ─── コート設定トグル ──────────────────────────────────────────────────────── */

.call-settings-details {
  margin-top: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--bg-control);
}

.call-settings-details__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  user-select: none;
  list-style: none;
}

.call-settings-details__summary::-webkit-details-marker {
  display: none;
}

.call-settings-details__arrow {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}

.call-settings-details[open] .call-settings-details__arrow {
  transform: rotate(90deg);
}

.call-settings-details__count {
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
}

.call-settings-details__body {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--panel-border);
}

.call-settings-details__hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.call-court-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.call-court-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.call-court-check:has(input:checked) {
  background: var(--blue-900);
  color: #fff;
  border-color: var(--blue-900);
}

.call-court-check input {
  display: none;
}

/* ─── コートテーブル ─────────────────────────────────────────────────────────── */

.call-court-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.call-court-row {
  display: grid;
  grid-template-columns: 72px 110px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.call-court-row--flash {
  animation: call-row-flash 0.7s ease;
}

@keyframes call-row-flash {
  0%   { box-shadow: 0 0 0 0 rgba(0, 139, 242, 0.65); }
  45%  { box-shadow: 0 0 0 10px rgba(0, 139, 242, 0.18); }
  100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
}

/* ═══════════════════════════════════════════════
   観客用チーム呼び出し画面
═══════════════════════════════════════════════ */

.public-call-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.public-call-status {
  display: inline-block;
  margin-bottom: 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-control);
  color: var(--text-muted);
}

.public-call-status--connected {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.public-call-status--disconnected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.public-call-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.public-call-card {
  padding: 16px 20px;
  border-radius: 14px;
  border: 2px solid var(--accent);
  background: var(--panel-bg);
  box-shadow: 0 0 0 4px rgba(0, 139, 242, 0.12);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.public-call-card--new {
  opacity: 0;
  transform: translateY(-8px);
}

.public-call-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.public-call-card__coat {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-control);
  padding: 2px 10px;
  border-radius: 999px;
}

.public-call-card__name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.public-call-card__meta {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.call-court-row__label {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--blue-900);
  text-align: center;
  line-height: 1;
}

.call-court-row__category {
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-court-row__category .category-tag {
  font-size: 1.5rem;
  padding: 5px 10px;
  height: 40px;
  width: 60px;
}

.call-court-row__team {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.3;
}

.call-court-row__meta {
  font-size: 1.5rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ── ダークモード ── */
html.dark .call-drawer__panel {
  background: #1c1e26;
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .call-drawer__header {
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .call-table__th {
  border-color: rgba(255, 255, 255, 0.1);
}

html.dark .call-table__row:not(:last-child) .call-table__td {
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .call-drawer__close:hover {
  background: #2e3040;
}

html.dark .call-settings-details {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .call-settings-details__body {
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .call-court-check {
  background: #1c1e26;
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark .call-court-check:has(input:checked) {
  background: var(--blue-900);
  border-color: var(--blue-900);
}

html.dark .call-court-row {
  background: #26282f;
  border-color: rgba(255, 255, 255, 0.07);
}

html.dark .form-inline__input{
  background: #26282f;
}
