/* ============ OWNER CONSOLE (layouts/owner) ============ */

.owner-console-body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-heading);
}

.owner-console-header {
  background: oklch(0.18 0 0);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
}

.owner-console-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.owner-console-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 25px;
  color: var(--color-bg);
  flex-shrink: 0;
}

.owner-console-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.owner-console-wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-bg);
}

.owner-console-wordmark span {
  color: var(--color-accent);
}

.owner-console-eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gray-65);
}

.owner-console-account {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.owner-console-identity {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  text-align: right;
}

.owner-console-name {
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.95 0.005 60);
}

.owner-console-role {
  font-size: 11px;
  color: var(--gray-60);
}

.owner-console-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: oklch(0.3 0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: oklch(0.9 0.005 90);
}

.owner-console-logout {
  background: transparent;
  border: 1px solid oklch(0.32 0 0);
  color: var(--gray-65);
  font-family: inherit;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.owner-console-pagehead {
  background: oklch(0.15 0 0);
  padding: 34px clamp(20px, 5vw, 40px);
}

.owner-console-pagehead-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.owner-console-pagehead-titles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.owner-console-pagehead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
}

.owner-console-pagehead-row h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(23px, 3.6vw, 30px);
  margin: 0;
  color: oklch(0.98 0.005 60);
}

.owner-console-pagehead-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.owner-console-pagehead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.owner-console-barname {
  font-weight: 700;
  font-size: 14px;
  color: oklch(0.95 0.005 60);
}

.owner-console-viewlink {
  font-size: 12px;
  color: oklch(0.7 0.16 27);
}

.owner-console-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.owner-console-badge--verified {
  background: oklch(0.3 0.06 150);
  border-color: oklch(0.45 0.09 150);
  color: oklch(0.9 0.06 150);
}

.owner-console-badge--paid {
  background: oklch(0.3 0.1 27);
  border-color: oklch(0.5 0.15 27);
  color: oklch(0.85 0.1 27);
}

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

.owner-console-discard {
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-50);
}

.owner-console-body-grid {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 32px clamp(20px, 5vw, 40px) 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.owner-console-sidenav {
  flex: 1 1 190px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 20px;
}

.owner-console-sidenav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--near-black-30);
  background: #fff;
  border: 1px solid var(--color-border);
  text-decoration: none;
}

.owner-console-sidenav a span {
  font-size: 11px;
  color: var(--gray-55);
}

.owner-console-updated {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--gray-50);
  line-height: 1.5;
}

.owner-console-updated strong {
  font-size: 13px;
  color: var(--color-text);
}

.owner-console-cards {
  flex: 3 1 460px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.owner-console-body-grid--single .owner-console-cards {
  flex-basis: 100%;
}

/* The console's main <form> just groups cards — no box of its own, and no
   max-width, so every card's fields span the same width as the standalone
   Photos / Licence / Tournaments cards (unlike .admin-form, which caps at
   560px for the narrower admin screens). */
.owner-console-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.owner-console-editform {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.owner-console-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: clamp(20px, 3.5vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.owner-console-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.owner-console-card-head--split {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.owner-console-card-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 17px;
}

.owner-console-card-sub {
  font-size: 12px;
  color: var(--gray-50);
  letter-spacing: 0.04em;
}

.owner-console-tier-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}

.owner-console-tier-note--muted {
  color: var(--gray-50);
  font-weight: 600;
}

/* The upload <form> (a grid cell in the photo grid, a flex item in the
   licence panel): its <label> child is the picker trigger. NB: `display:
   contents` on a <form> drops its nested controls from the submission in
   Chromium — don't. These submit through Turbo; the controller answers with
   a turbo_stream that swaps just the card, so the page never reloads and the
   main listing form keeps its unsaved edits. */
.owner-console-inline-upload {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

/* Inline error at the top of a re-rendered Photo / Licence card (bad file
   type, second photo) — the turbo_stream path has no flash banner. */
.owner-console-inline-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: oklch(0.95 0.04 25);
  color: oklch(0.44 0.16 25);
  font-size: 0.85rem;
  font-weight: 600;
}

/* The real <input type=file> — kept in the DOM (so its files submit) but
   out of view; the visible <label for> is the click target, same as the
   owner-request licence dropzone. Picking a file auto-submits (guarded by
   this.files.length — a bare requestSubmit fired on Firefox form-state
   restore and looped empty POSTs). */
.owner-console-file-hidden {
  display: none;
}

/* Photos card — fixed-width image tiles + a matching dashed dropzone. */
.owner-console-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.owner-console-photo,
.owner-console-photo-grid .owner-console-inline-upload {
  width: 168px;
  flex: 0 0 auto;
}

.owner-console-photo {
  position: relative;
}

.owner-console-photo img {
  width: 168px;
  height: 120px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}

.owner-console-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.18 0 0 / 0.72);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.owner-console-photo:hover .owner-console-photo-delete,
.owner-console-photo-delete:focus-visible {
  opacity: 1;
}

.owner-console-photo-add {
  width: 168px;
  height: 120px;
  border: 2px dashed var(--color-border-strong);
  border-radius: 9px;
  background: oklch(0.985 0.004 90);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.owner-console-photo-add:hover {
  border-color: var(--color-accent);
}

.owner-console-photo-add-icon {
  font-size: 20px;
  color: var(--gray-60);
}

.owner-console-photo-add-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-45);
}

/* Licence card — a status panel coloured by verification state, with a
   file-input "Re-submit" affordance styled as the design's outline button. */
.owner-console-licence-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 16px 18px;
}

.owner-console-licence-panel-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.owner-console-licence-panel-status {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-40);
}

.owner-console-licence-panel-detail {
  font-size: 12px;
  color: var(--gray-45);
}

.owner-console-licence-resubmit {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border-strong);
  color: var(--gray-40);
  font-weight: 700;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.owner-console-licence-panel--verified {
  background: oklch(0.98 0.02 150);
  border-color: oklch(0.88 0.06 150);
}

.owner-console-licence-panel--verified .owner-console-licence-panel-status {
  color: oklch(0.38 0.11 150);
}

.owner-console-licence-panel--verified .owner-console-licence-panel-detail {
  color: oklch(0.45 0.03 150);
}

.owner-console-licence-panel--verified .owner-console-licence-resubmit {
  border-color: oklch(0.82 0.06 150);
  color: oklch(0.4 0.1 150);
}

.owner-console-licence-panel--pending {
  background: oklch(0.97 0.04 85);
  border-color: oklch(0.85 0.09 85);
}

.owner-console-licence-panel--pending .owner-console-licence-panel-status {
  color: oklch(0.45 0.12 70);
}

.owner-console-licence-panel--pending .owner-console-licence-resubmit {
  border-color: oklch(0.82 0.09 85);
  color: oklch(0.45 0.12 70);
}

.owner-console-listing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.owner-console-listing-row strong {
  display: block;
  font-size: 13px;
  color: oklch(0.45 0.16 27);
}

.owner-console-listing-row span {
  font-size: 12px;
  color: var(--gray-50);
}

.owner-console-tournament-form {
  background: oklch(0.985 0.004 90);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.owner-console-tournament-form-title {
  font-weight: 900;
  font-size: 14px;
}

.owner-console-tournament-photo-field {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

/* The placeholder / thumbnail doubles as the file picker (label for the
   hidden input) — click anywhere on it to browse. */
.owner-console-tournament-photo-picker {
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 8px;
  display: block;
}

/* Swappable inner of the picker (turbo_stream target). display:contents so it
   doesn't disturb the label's layout; the error line still stacks under. */
.owner-console-tournament-photo-preview-slot {
  display: contents;
}

/* span.owner-console-tournament-photo-preview sets `display: flex`, which
   (author style) overrides the UA `[hidden] { display: none }` — so the
   local-preview onchange's `placeholder.hidden = true` wouldn't actually
   hide it without this. */
.owner-console-tournament-photo-preview-slot [data-role="placeholder"][hidden] {
  display: none;
}

.owner-console-tournament-photo-preview {
  width: 150px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
}

.owner-console-tournament-photo-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}

span.owner-console-tournament-photo-preview {
  /* This one is a click-to-upload dropzone, not a content placeholder — it
     re-adds the label styling that .photo-placeholder no longer carries, and
     overrides the dark branded background with the light dashed look. */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 2px dashed var(--color-border-strong);
  background: oklch(0.985 0.004 90);
  color: var(--gray-50);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  font-weight: 700;
  transition: border-color 0.12s ease;
}

.owner-console-tournament-photo-picker:hover span.owner-console-tournament-photo-preview {
  border-color: var(--color-accent);
}

.owner-console-tournament-photo-picker-icon {
  font-size: 18px;
  color: var(--gray-60);
}

.owner-console-tournament-photo-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-50);
  max-width: 280px;
}

.owner-console-tournament-photo-hint span {
  color: var(--gray-55);
}

.owner-console-tournament-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.owner-console-tournament-row {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.owner-console-tournament-time {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-accent);
  min-width: 52px;
}

.owner-console-tournament-body {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.owner-console-tournament-name {
  font-weight: 700;
  font-size: 14px;
}

.owner-console-tournament-meta {
  font-size: 12px;
  color: var(--gray-50);
}

.owner-console-tournament-winner {
  font-size: 11.5px;
  font-weight: 700;
  color: oklch(0.42 0.12 150);
}

@media (max-width: 640px) {
  .owner-console-tournament-row {
    padding: 14px;
    gap: 12px;
  }

  .owner-console-tournament-body {
    flex-basis: 100%;
    min-width: 0;
    align-items: flex-start;
  }
}

.owner-console-tournament-actions {
  display: flex;
  gap: 8px;
}

.owner-console-rowbtn {
  background: #fff;
  border: 1px solid var(--color-border-strong);
  color: var(--near-black-30);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
}

.owner-console-rowbtn--danger {
  border-color: oklch(0.88 0.06 27);
  color: oklch(0.48 0.16 27);
}

.owner-console-rowbtn--results {
  border-color: oklch(0.82 0.09 150);
  color: oklch(0.38 0.11 150);
}

/* ============ Owner console top-level tabs (店舗情報 / トーナメント) ============
   Reuses .tournament-tab/-ja/-en/-badge verbatim (same dark-bar-with-gold-
   underline component the tournament detail page's own 3 tabs use) — only
   the surrounding bar is new. Sits in the main yield region, not
   content_for(:page_banner) (see edit.html.erb's own note on why), styled
   with the same background color as .owner-console-pagehead above it so the
   two read as one continuous dark block despite not sharing a wrapper. */
.owner-console-tabs {
  background: oklch(0.15 0 0);
  border-bottom: 1px solid oklch(0.26 0 0);
}

.owner-console-tabs-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: clamp(14px, 4vw, 34px);
  padding: 10px clamp(20px, 5vw, 40px) 0;
  overflow-x: auto;
}

