/* Page-specific subset of index_4.css for templates/tournament_detail.html. */

:root {
  color-scheme: light;
  --forest: #073527;
  --forest-2: #0d4a38;
  --ink: #081d18;
  --muted: #6d6a61;
  --paper: #f7f3e9;
  --paper-2: #fffdf7;
  --line: rgba(8, 29, 24, 0.14);
  --line-strong: rgba(8, 29, 24, 0.28);
  --green-chip: #eef6e6;
  --blue-chip: #edf4fb;
  --brass: #c59b4b;
  --amber: #d89a00;
  --red: #b94431;
  --shadow: 0 16px 42px rgba(38, 31, 18, 0.11);
  --radius: 7px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 3%, rgba(197, 155, 75, 0.15), transparent 22%),
    linear-gradient(90deg, rgba(8, 29, 24, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(8, 29, 24, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 72px 72px, 72px 72px, auto;
  font-size: 14px;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v4-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(18px, 3vw, 52px);
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 233, 0.88);
  padding: 8px clamp(16px, 2.2vw, 30px);
  backdrop-filter: blur(18px);
}

.v4-brand,
.v4-nav,
.v4-actions {
  display: flex;
  align-items: center;
}

.v4-brand {
  gap: 12px;
  color: var(--forest);
  font-size: clamp(1.1rem, 1.65vw, 1.34rem);
}

.v4-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: #f5ddb0;
  background: var(--forest);
  box-shadow: 0 12px 22px rgba(7, 53, 39, 0.18);
}

.v4-brand-mark svg {
  width: 31px;
  height: 31px;
  stroke-width: 1.35;
}

.v4-nav {
  justify-content: center;
  gap: clamp(18px, 3vw, 48px);
}

.v4-nav a,
.v4-actions button,
.v4-actions > span {
  min-height: 34px;
  color: #111f1b;
  font-size: 0.84rem;
  font-weight: 820;
}

.v4-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 3px 13px;
}

.v4-nav a::after {
  position: absolute;
  right: 0;
  bottom: -10px;
  left: 0;
  height: 3px;
  background: var(--forest);
  content: "";
  opacity: 0;
}

.v4-nav a.active::after {
  opacity: 1;
}

.v4-nav svg,
.v4-actions svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.85;
}

.v4-actions {
  gap: 14px;
}

.v4-actions button {
  border: 1px solid transparent;
  background: transparent;
  padding: 0 4px;
}

.v4-actions button:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border-color: var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.62);
}

.v4-actions .v4-my-tournaments,
.v4-actions .v4-auth-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--forest);
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 860;
  line-height: 1;
  text-decoration: none;
}

.v4-actions .v4-auth-trigger {
  border-color: rgba(7, 53, 39, 0.3);
  background: var(--forest);
  color: #fff9ea;
}

.v4-actions .v4-my-tournaments.active {
  border-color: rgba(7, 53, 39, 0.34);
  background: rgba(238, 246, 230, 0.92);
}

.v4-actions .v4-my-tournaments svg,
.v4-actions .v4-auth-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.v4-language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  min-height: 34px;
}

.v4-language-toggle button,
.v4-language-toggle a {
  min-height: 26px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 0 4px;
  color: rgba(8, 29, 24, 0.52);
  font-size: 0.84rem;
  font-weight: 880;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.v4-language-toggle button.active,
.v4-language-toggle a.active {
  color: var(--forest);
}

.v4-language-toggle span {
  color: rgba(8, 29, 24, 0.35);
  font-weight: 760;
}

.v4-new-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  border: 1px solid rgba(185, 68, 49, 0.22);
  border-radius: 999px;
  background: rgba(185, 68, 49, 0.1);
  color: var(--red);
  padding: 2px 7px;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
}

.v4-chip {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  border: 1px solid rgba(7, 53, 39, 0.14);
  border-radius: 5px;
  background: var(--green-chip);
  padding: 2px 7px;
  color: #0b2d22;
  font-size: 0.66rem;
  font-weight: 840;
}

.v4-chip.blue {
  background: var(--blue-chip);
  color: #15314f;
}

.v4-chip.muted {
  background: rgba(8, 29, 24, 0.045);
  color: rgba(8, 29, 24, 0.52);
}

.v4-tournament-detail-page {
  display: grid;
  gap: 14px;
  width: min(100% - 42px, 1860px);
  margin: 0 auto;
  padding: 15px 0 36px;
}

.v4-detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.v4-detail-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.v4-detail-breadcrumb span:last-child {
  color: var(--forest);
}

.v4-detail-hero,
.v4-detail-information,
.v4-related-tournaments {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: 0 8px 18px rgba(8, 29, 24, 0.035);
}

.v4-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 430px);
  align-items: stretch;
}

.v4-tournament-information {
  display: grid;
  gap: 14px;
}

.v4-detail-information {
  padding: 24px 38px 30px;
  font-size: 0.94rem;
}

.v4-tournament-information-heading h2,
.v4-tournament-information-heading p,
.v4-information-summary,
.v4-information-section h3,
.v4-information-paragraph,
.v4-information-alert,
.v4-information-schedule-row p {
  margin: 0;
}

.v4-tournament-information-heading h2 {
  color: var(--forest);
  font-size: 1.18rem;
}

.v4-tournament-information-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.v4-information-summary {
  color: #25332f;
  font-size: 0.96rem;
  font-weight: 720;
  line-height: 1.65;
  white-space: pre-wrap;
}

.v4-information-alerts {
  display: grid;
  gap: 8px;
}

.v4-information-alert {
  border: 1px solid rgba(8, 29, 24, 0.13);
  border-left: 4px solid var(--forest);
  border-radius: 6px;
  background: rgba(238, 246, 230, 0.72);
  color: #20352e;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.45;
}

.v4-information-alert-warning {
  border-left-color: #a06b00;
  background: rgba(255, 239, 193, 0.58);
}

.v4-information-alert-success {
  border-left-color: #2f7d4b;
}

.v4-information-alert-error {
  border-left-color: #a1382e;
  background: rgba(255, 224, 219, 0.58);
}

.v4-information-section {
  min-width: 0;
  border: 1px solid rgba(8, 29, 24, 0.11);
  border-radius: 7px;
  background: rgba(255, 254, 249, 0.72);
  padding: 15px 16px;
}

.v4-information-section h3 {
  color: var(--forest);
  font-size: 1rem;
  line-height: 1.3;
}

.v4-information-paragraph {
  margin-top: 9px;
  color: #33433d;
  line-height: 1.55;
  white-space: pre-wrap;
}

.v4-information-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 11px 0 0;
}

.v4-information-facts > div {
  display: grid;
  grid-template-columns: minmax(95px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(8, 29, 24, 0.08);
  padding: 8px 0;
}

.v4-information-facts dt,
.v4-information-facts dd {
  margin: 0;
}

.v4-information-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.v4-information-facts dd {
  min-width: 0;
  color: #20352e;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.v4-information-facts a,
.v4-information-links a,
.v4-information-actions a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.v4-information-schedule {
  display: grid;
  margin-top: 11px;
  border-top: 1px solid rgba(8, 29, 24, 0.09);
}

.v4-information-schedule-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.28fr) minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid rgba(8, 29, 24, 0.09);
  padding: 9px 0;
}

.v4-information-schedule-row > div,
.v4-information-schedule-row p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.v4-information-schedule-row span {
  color: var(--muted);
}

.v4-information-schedule-row p span {
  flex-basis: 100%;
}

.v4-information-links,
.v4-information-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.v4-information-links a,
.v4-information-actions a {
  border: 1px solid rgba(8, 29, 24, 0.18);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.9);
  padding: 8px 11px;
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.v4-information-actions {
  margin-top: 0;
}

.v4-information-actions a.primary {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff9ea;
}

.v4-detail-main {
  display: grid;
  gap: 18px;
  padding: 28px 38px;
}

.v4-detail-main h1 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.v4-detail-meta {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(180px, 0.8fr) minmax(260px, 1.3fr);
  gap: 18px;
}

.v4-detail-meta article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  border-right: 1px solid rgba(8, 29, 24, 0.12);
  padding-right: 18px;
}

.v4-detail-meta article:last-child {
  border-right: 0;
  padding-right: 0;
}

.v4-detail-meta svg {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(238, 246, 230, 0.88);
  color: var(--forest);
  padding: 6px;
}

.v4-detail-meta strong,
.v4-detail-facts dd strong,
.v4-related-table td strong {
  display: block;
  color: #102620;
  font-weight: 900;
}

.v4-detail-meta span,
.v4-detail-facts dd span,
.v4-related-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
}

.v4-detail-facts {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(360px, 1fr);
  gap: 18px 54px;
  border-top: 1px solid rgba(8, 29, 24, 0.1);
  padding-top: 18px;
}

.v4-detail-facts dl {
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(0, 1fr);
  gap: 16px 28px;
  margin: 0;
}

.v4-detail-facts dt {
  color: rgba(8, 29, 24, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v4-detail-facts dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  margin: 0;
  color: #25332f;
  font-size: 0.86rem;
  font-weight: 760;
}

.v4-detail-page-links {
  align-items: center;
}

.v4-detail-contact a {
  color: var(--forest);
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.v4-detail-page-links a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.86);
  color: #102620;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 880;
  text-decoration: none;
}

.v4-detail-page-links svg {
  width: 14px;
  height: 14px;
}

.v4-detail-side {
  display: grid;
  align-content: start;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding: 20px;
}

.v4-detail-side a,
.v4-detail-side button,
.v4-detail-mobile-bar a,
.v4-detail-mobile-bar button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(7, 53, 39, 0.5);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.82);
  color: var(--forest);
  padding: 11px 14px;
  font: inherit;
  font-weight: 920;
  text-decoration: none;
}

.v4-detail-side a.primary,
.v4-detail-mobile-bar .primary {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff9ea;
}

.v4-detail-side svg {
  width: 18px;
  height: 18px;
}

.v4-detail-share-status {
  min-height: 1.2em;
  margin: 2px 0 0;
  color: var(--forest-2);
  font-size: 0.78rem;
  font-weight: 820;
  text-align: center;
}

.v4-related-tournaments {
  display: grid;
  gap: 10px;
  padding: 18px 38px 24px;
}

.v4-related-tournaments h2 {
  margin: 0;
  color: var(--forest);
  font-size: 1.05rem;
}

.v4-related-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.v4-related-table table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.v4-related-table th,
.v4-related-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
}

.v4-related-table th {
  background: rgba(255, 253, 247, 0.72);
  color: #102620;
  font-size: 0.78rem;
  font-weight: 900;
}

.v4-related-table tr:last-child td {
  border-bottom: 0;
}

.v4-related-table th:last-child,
.v4-related-table td:last-child {
  border-right: 0;
}

.v4-related-all {
  justify-self: center;
  min-width: 260px;
  border: 1px solid rgba(7, 53, 39, 0.5);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.86);
  color: var(--forest);
  padding: 10px 16px;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
}

.v4-detail-mobile-bar {
  display: none;
}

@media (max-width: 1180px) {
  .v4-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .v4-nav,
  .v4-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    font-size: 13px;
  }

  .v4-topbar {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    padding: 9px 10px;
  }

  .v4-brand {
    grid-column: 1;
  }

  .v4-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .v4-actions .v4-my-tournaments,
  .v4-actions .v4-auth-trigger {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .v4-actions .v4-my-tournaments svg,
  .v4-actions .v4-auth-trigger svg {
    display: none;
  }

  .v4-nav {
    grid-column: 1 / -1;
  }

  .v4-nav,
  .v4-actions {
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: visible;
  }

  .v4-chip.rating {
    background: rgba(7, 53, 39, 0.1);
    color: #0b2d22;
  }

  .v4-chip.rating.blue {
    background: var(--blue-chip);
    color: #15314f;
  }
}

@media (max-width: 1180px) {

  .v4-detail-hero {
    grid-template-columns: 1fr;
  }

  .v4-detail-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .v4-detail-share-status {
    grid-column: 1 / -1;
  }

  .v4-detail-meta,
  .v4-detail-facts {
    grid-template-columns: 1fr;
  }

  .v4-detail-meta article {
    border-right: 0;
    border-bottom: 1px solid rgba(8, 29, 24, 0.1);
    padding: 0 0 12px;
  }

  .v4-detail-meta article:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 760px) {

  .v4-tournament-detail-page {
    width: min(100% - 20px, 1900px);
    padding-bottom: 96px;
  }

  .v4-detail-breadcrumb {
    padding-top: 2px;
    font-size: 0.74rem;
  }

  .v4-detail-main {
    gap: 14px;
    padding: 18px;
  }

  .v4-detail-main h1 {
    font-size: clamp(1.75rem, 11vw, 2.45rem);
    line-height: 1.02;
  }

  .v4-detail-meta {
    gap: 12px;
  }

  .v4-detail-facts dl {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .v4-detail-facts dd {
    padding-bottom: 10px;
  }

  .v4-information-facts,
  .v4-information-schedule-row {
    grid-template-columns: 1fr;
  }

  .v4-information-facts {
    gap: 0;
  }

  .v4-information-schedule-row {
    gap: 5px;
  }

  .v4-information-actions a {
    width: 100%;
    text-align: center;
  }

  .v4-detail-side {
    display: none;
  }

  .v4-related-tournaments {
    padding: 14px;
  }

  .v4-detail-information {
    padding: 18px;
  }

  .v4-related-table table {
    min-width: 720px;
  }

  .v4-related-all {
    width: 100%;
    min-width: 0;
  }

  .v4-detail-mobile-bar {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid rgba(7, 53, 39, 0.16);
    border-radius: 12px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: 0 12px 30px rgba(8, 29, 24, 0.16);
    padding: 8px;
  }

  .v4-detail-mobile-bar a,
  .v4-detail-mobile-bar button {
    min-height: 44px;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.78rem;
  }
}

.v4-detail-archive-note {
  margin: 12px 0 0;
  border-left: 3px solid #a8792b;
  background: rgba(245, 221, 176, 0.34);
  padding: 9px 12px;
  color: var(--ink);
  font-size: 0.85rem;
}

.v4-related-tournaments td a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: rgba(7, 53, 39, 0.28);
  text-underline-offset: 3px;
}
