/* ============ Tournaments tab board (filters / search / dates / bulk) ============ */
.owner-console-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.owner-console-board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.owner-console-filter-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--near-black-30);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.owner-console-filter-chip.is-active {
  background: oklch(0.18 0 0);
  color: #fff;
}

.owner-console-filter-chip-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

.owner-console-filter-chip--sm {
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 12px;
}

.owner-console-filter-chip--sm.is-active {
  background: oklch(0.95 0.03 30);
  border-color: oklch(0.82 0.09 30);
  color: oklch(0.42 0.14 27);
}

.owner-console-filter-clear {
  font-size: 12px;
  font-weight: 700;
  color: oklch(0.45 0.17 27);
}

.owner-console-board-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.owner-console-board-search input[type="search"] {
  width: 200px;
}

.owner-console-board-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.owner-console-board-dates-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-45);
}

.owner-console-board-date-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.owner-console-board-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: oklch(0.97 0.035 80);
  border: 1px solid oklch(0.86 0.08 80);
  border-radius: 10px;
  padding: 13px 16px;
}

.owner-console-board-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.owner-console-board-banner-text span:first-child {
  font-weight: 700;
  font-size: 13px;
  color: oklch(0.4 0.09 70);
}

.owner-console-board-banner-text span:last-child {
  color: oklch(0.48 0.06 70);
}

/* Collapsible CSV import card — same checkbox-hack idiom as its own
   column-reference toggle below, applied one level up: unchecked hides the
   whole .owner-console-csv-card (sibling of the checkbox/label), checked
   (default when a failed import just left errors to show) reveals it. */
.owner-console-csv-toggle-check {
  display: none;
}

.owner-console-csv-toggle-label {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--color-border-strong);
  color: var(--near-black-30);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.owner-console-csv-toggle-label-open {
  display: none;
}

.owner-console-csv-toggle-check:checked ~ .owner-console-csv-toggle-label .owner-console-csv-toggle-label-open {
  display: inline;
}

.owner-console-csv-toggle-check:checked ~ .owner-console-csv-toggle-label .owner-console-csv-toggle-label-closed {
  display: none;
}

.owner-console-csv-toggle-check ~ .owner-console-csv-card {
  display: none;
}

.owner-console-csv-toggle-check:checked ~ .owner-console-csv-card {
  display: block;
}

.owner-console-board-bulkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: oklch(0.985 0.003 90);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 10px 14px;
}

.owner-console-board-bulkbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-45);
  margin-right: 6px;
}

.owner-console-board-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
  color: var(--gray-50);
}

.owner-console-board-empty span:first-child {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
}

.owner-console-board-table {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: clip;
}

.owner-console-board-table-head {
  display: grid;
  grid-template-columns: 28px 78px minmax(0, 1fr) 140px 170px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  background: var(--color-alt-bg);
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gray-50);
}

.owner-console-board-month {
  padding: 8px 16px;
  background: oklch(0.985 0.003 90);
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gray-50);
}

.owner-console-board-table .owner-console-tournament-row {
  border: none;
  border-bottom: 1px solid var(--color-alt-bg);
  border-radius: 0;
}

.owner-console-board-table .owner-console-tournament-row-wrap:last-child .owner-console-tournament-row {
  border-bottom: none;
}

.owner-console-tournament-select {
  width: 17px;
  height: 17px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.owner-console-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.owner-console-status-badge--upcoming {
  background: oklch(0.96 0.005 90);
  color: var(--gray-40);
  border-color: var(--color-border);
}

.owner-console-status-badge--action {
  background: oklch(0.96 0.05 80);
  color: oklch(0.42 0.1 70);
  border-color: oklch(0.85 0.09 80);
}

.owner-console-status-badge--completed {
  background: oklch(0.96 0.035 150);
  color: oklch(0.38 0.11 150);
  border-color: oklch(0.85 0.07 150);
}

.owner-console-board-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.owner-console-board-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--near-black-30);
  background: #fff;
}

.owner-console-board-page.is-active {
  background: oklch(0.18 0 0);
  border-color: oklch(0.18 0 0);
  color: #fff;
}

@media (max-width: 720px) {
  .owner-console-board-table-head {
    grid-template-columns: 24px 1fr;
  }

  .owner-console-board-table-head span:nth-child(4),
  .owner-console-board-table-head span:nth-child(5) {
    display: none;
  }
}

/* ============ Create/edit drawer (slide-over, CSS only) ============
   A fixed overlay + panel rather than the old inline card — opened by the
   existing ?new_tournament/?tournament_id query params (full reload, like
   every other action on this page), closed by a plain link back to the tab
   without them. No JS: visibility is simply "rendered or not", driven by
   @tournament server-side. */
.owner-console-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}

.owner-console-drawer-overlay {
  position: absolute;
  inset: 0;
  background: oklch(0.12 0 0 / 0.5);
}

.owner-console-drawer-panel {
  position: relative;
  width: min(620px, 100%);
  height: 100%;
  overflow-y: auto;
  background: #fff;
  box-shadow: -12px 0 40px oklch(0 0 0 / 0.25);
  display: flex;
  flex-direction: column;
  padding: 22px;
  gap: 16px;
}

.owner-console-drawer-head {
  position: sticky;
  top: -22px;
  margin: -22px -22px 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.owner-console-drawer-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gray-50);
}

.owner-console-drawer-close {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--gray-40);
}

@media (max-width: 640px) {
  .owner-console-board-toolbar,
  .owner-console-board-dates {
    align-items: flex-start;
  }

  .owner-console-board-search input[type="search"] {
    width: 100%;
  }

  .owner-console-drawer-panel {
    width: 100%;
  }
}

/* Checkbox-hack toggle for the per-tournament results panel — same pattern
   as shared/_header's mobile nav toggle, no JS. The checkbox is a sibling of
   both the row (which holds the label acting as the "結果を記録" button) and
   the panel, so :checked ~ reveals the panel regardless of the row sitting
   between them in the DOM. */
.owner-console-tournament-row-wrap {
  display: flex;
  flex-direction: column;
}

.owner-console-results-toggle-check {
  display: none;
}

.owner-console-results-panel {
  display: none;
  background: oklch(0.985 0.02 150);
  border: 1px solid oklch(0.85 0.06 150);
  border-radius: 10px;
  padding: 18px;
  margin-top: 10px;
}

.owner-console-results-toggle-check:checked ~ .owner-console-results-panel {
  display: flex;
}

/* The panel's only child is the <form> itself, so the actual vertical
   rhythm between the title / rows / add-row button / photo fields / save-
   close actions has to live on the form, not the panel — a gap: on the
   panel alone would only wrap around that one child and do nothing. */
.owner-console-results-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.owner-console-results-title {
  font-weight: 900;
  font-size: 13px;
  color: oklch(0.35 0.1 150);
}

.owner-console-results-panel [data-nested-fields-target="rows"] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* One row of the quick results panel — rank (auto-numbered, never an input)
   / player name / payout, each described by its own placeholder text only
   (no <label>), matching the design.

   :not([hidden]) — same reasoning as .admin-payout-row above: a bare
   `display: grid` here would outrank the browser's own
   [hidden] { display: none } default (author styles always win over the
   UA stylesheet), so nested-fields#remove hiding a row would have no
   visible effect even though it correctly marks _destroy: "1". */
.owner-console-results-row:not([hidden]) {
  display: grid;
  grid-template-columns: 50px 1fr 120px auto;
  gap: 10px;
  align-items: center;
}

.owner-console-results-rank {
  font-family: var(--font-display);
  font-size: 14px;
  color: oklch(0.4 0.1 150);
}

.owner-console-results-input {
  border: 1px solid oklch(0.82 0.06 150);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  background: white;
  font-family: inherit;
}

.owner-console-results-remove {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--gray-50);
  cursor: pointer;
  padding: 4px;
}

.owner-console-results-remove:hover {
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .owner-console-results-row {
    grid-template-columns: 40px 1fr 1fr auto;
  }
}

/* Winner photo / night gallery — a two-column grid (each column stacks
   below ~230px) under a top-border separator, matching the design's
   quick-panel photo section. */
.owner-console-results-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  border-top: 1px solid oklch(0.9 0.04 150);
  padding-top: 14px;
}

.owner-console-results-photo-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.owner-console-results-photo-col-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.owner-console-results-photo-label {
  font-size: 12px;
  font-weight: 700;
  color: oklch(0.35 0.1 150);
}

.owner-console-results-paid-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: oklch(0.42 0.14 27);
  background: oklch(0.95 0.03 30);
  border: 1px solid oklch(0.85 0.08 30);
  padding: 2px 7px;
  border-radius: 20px;
}

.owner-console-results-photo-hint {
  font-size: 11.5px;
  color: oklch(0.45 0.03 150);
  line-height: 1.5;
}

.owner-console-results-photo-hint span {
  color: oklch(0.52 0.02 150);
}

.owner-console-results-photo-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-console-results-photo-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
}

.owner-console-results-photo-input {
  font-size: 12px;
}

.owner-console-results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-console-results-save {
  background: oklch(0.42 0.12 150);
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
}

.owner-console-results-close {
  background: white;
  color: var(--gray-40);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 7px;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.owner-console-picker {
  display: flex;
  flex-direction: column;
}

.owner-console-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}

.owner-console-picker-row:last-child {
  border-bottom: none;
}

.owner-console-picker-name {
  flex: 1 1 220px;
  font-weight: 700;
  font-size: 14px;
}

.owner-console-picker-name span {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--gray-50);
}

.owner-console-picker-go {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-accent);
}

@media (max-width: 720px) {
  .owner-console-sidenav {
    position: static;
    max-width: none;
    flex-basis: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ── Bar change review ──────────────────────────────────────────────
   Owner console "your edits are awaiting review" panel + the admin
   diff table on the review page. */
.owner-console-review-notice {
  background: oklch(0.97 0.04 85);
  border: 1px solid oklch(0.85 0.09 85);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13px;
  color: oklch(0.4 0.1 70);
}

.owner-console-review-notice-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.owner-console-review-notice p {
  margin: 6px 0;
}

.owner-console-review-notice ul {
  margin: 8px 0;
  padding-left: 20px;
}

.owner-console-review-notice li {
  margin: 3px 0;
}

.owner-console-review-was {
  color: var(--gray-50);
  text-decoration: line-through;
}

.owner-console-review-notice-foot {
  font-size: 12px;
  color: var(--gray-50);
}

.admin-change-diff {
  margin-top: 8px;
}

.admin-change-diff-was {
  color: var(--gray-50);
  text-decoration: line-through;
}

.admin-change-diff-now {
  font-weight: 700;
}

.admin-change-conflict {
  margin-top: 10px;
  font-size: 13px;
  color: oklch(0.45 0.16 27);
}

/* Honeypot spam trap (shared/_honeypot_field) — visually gone but still in
   the DOM and the form submission. Deliberately not display:none. */
.spam-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
