/*
 * Torneios tab — Figma nodes ~1018-2412 / 2567 / 2639 (Cacheta Brasil).
 * Loaded from application layout (not Tailwind-purged).
 */

.tournaments-page {
  --tournament-lime: #b7f10a;
  --tournament-cyan: #03f3eb;
  --tournament-dark: #0a421b;
  --tournament-mid: #2c7a2c;
  --tournament-text-on-tab: #194920;
  --tournament-info-text: #e5e5e5;

  box-sizing: border-box;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* Header — icon + title */
.tournaments-page__header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 12px;
  box-sizing: border-box;
}

.tournaments-page__header-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 20, 8, 0.35));
}

.tournaments-page__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tournament-lime);
}

/* Game mode segmented control — 328×40, track rgba(255,255,255,0.15), padding 4px */
.tournaments-page__game-tabs {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  width: 328px;
  max-width: calc(100% - 32px);
  height: 40px;
  margin: 0 auto 12px;
  padding: 4px;
  border-radius: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.15);
  gap: 0;
}

.tournaments-page__game-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 16px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.tournaments-page__game-tab--active {
  font-weight: 700;
  color: var(--tournament-text-on-tab);
  background: linear-gradient(180deg, var(--tournament-cyan) 0%, var(--tournament-lime) 100%);
  box-shadow: 0 2px 12px rgba(0, 40, 18, 0.28);
}

.tournaments-page__game-tab:focus-visible {
  outline: 2px solid rgba(3, 243, 235, 0.75);
  outline-offset: 2px;
}

/* Detail chrome — secondary tabs same dimensions */
.tournaments-page__detail-tabs {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  width: 328px;
  max-width: calc(100% - 32px);
  height: 40px;
  margin: 0 auto 12px;
  padding: 4px;
  border-radius: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.15);
}

.tournaments-page__detail-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 16px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tournaments-page__detail-tab--active {
  font-weight: 700;
  color: var(--tournament-text-on-tab);
  background: linear-gradient(180deg, var(--tournament-cyan) 0%, var(--tournament-lime) 100%);
  box-shadow: 0 2px 12px rgba(0, 40, 18, 0.28);
}

/* Scroll region — list OR detail body only */
.tournaments-page__scroll {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 16px calc(84px + env(safe-area-inset-bottom, 0px) + 16px);
  scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px) + 16px);
  box-sizing: border-box;
}

.tournaments-page__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

/* Tournament card — 328×142. Figma ~1018-2437: Rectangle 538 body fill + separate header strip (609). */
.tournament-card {
  position: relative;
  width: 328px;
  max-width: 100%;
  height: 142px;
  margin: 0 auto;
  padding: 0;
  border-radius: 16px;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a421b;
  box-shadow:
    0 4px 18px rgba(0, 18, 8, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.tournament-card:focus-visible {
  outline: 2px solid var(--tournament-cyan);
  outline-offset: 2px;
}

.tournament-card__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  box-sizing: border-box;
  border-radius: 16px 16px 0 0;
  /* Figma header — 4 stops, 90deg */
  background: linear-gradient(90deg, #a6d90f 0%, #86c66c 39%, #7dc087 50%, #1c5319 99%);
}

.tournament-card__name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-card__prize-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tournament-card__prize {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  /* Figma: fill linear gradient on text (#B2EE00 → #C4FFCB) */
  background: linear-gradient(90deg, #b2ee00 2%, #c4ffcb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tournament-card__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.tournament-card__info-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.tournament-card__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  box-sizing: border-box;
  border-radius: 0 0 16px 16px;
  /* Figma Rectangle 538 — horizontal gradient */
  background: linear-gradient(
    90deg,
    #336c3e 0%,
    #a6d90f 8%,
    #588d15 25%,
    #0a421b 97%,
    #0a421b 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tournament-card__trophy {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.tournament-card__trophy-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

.tournament-card__stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.2;
}

.tournament-card__stat-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a6d90f;
}

.tournament-card__stat-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tournament-card__cta-wrap {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.tournament-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 99px;
  height: 40px;
  border-radius: 10px;
  border: none;
  box-sizing: border-box;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tournament-card__cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Detail chrome header row */
.tournaments-page__detail-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  box-sizing: border-box;
}

.tournaments-page__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(44, 124, 58, 0.95) 0%, rgba(17, 62, 28, 0.98) 100%);
  box-shadow:
    0 2px 8px rgba(0, 18, 8, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.tournaments-page__back svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tournaments-page__detail-bar-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--tournament-lime);
  padding-right: 40px;
  box-sizing: border-box;
}

/* Info panel — Figma: stats grid + section headings + labeled paragraphs */
.tournament-info-panel {
  width: 100%;
  max-width: 328px;
  margin: 0 auto;
  padding: 16px 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(183, 241, 10, 0.35);
  box-sizing: border-box;
  background: var(--tournament-dark);
}

.tournament-info-panel__stats {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 10px;
  row-gap: 8px;
  align-items: baseline;
  margin: 0;
  padding: 0 0 12px;
}

.tournament-info-panel__stat-term {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
}

.tournament-info-panel__stat-def {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: #ffffff;
}

.tournament-info-panel__section {
  margin-top: 16px;
}

.tournament-info-panel__section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}

.tournament-info-panel__para {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  color: #ffffff;
}

.tournament-info-panel__para:last-child {
  margin-bottom: 0;
}

.tournament-info-panel__para--notes {
  color: var(--tournament-info-text);
}

.tournament-info-panel__inline-label {
  font-weight: 700;
  color: #ffffff;
}

/* Prize tab */
.tournament-prize-panel {
  width: 100%;
  max-width: 328px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-prize-panel__total {
  margin: 0 0 4px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--tournament-lime);
}

.tournament-prize-panel__row {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  background: var(--tournament-dark);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
}

/* Visibility — list vs detail chrome */
.tournaments-page__detail-bar,
.tournaments-page__detail-tabs {
  display: none;
}

.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__detail-bar {
  display: flex;
}

.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__detail-tabs {
  display: flex;
}

.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__header,
.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__game-tabs {
  display: none !important;
}

.tournaments-page__detail-panel {
  display: none;
}

.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__list-panel {
  display: none !important;
}

.tournaments-page[data-tournament-page-detail-open-value="true"] .tournaments-page__detail-panel {
  display: block;
}

/* Game mode filter */
.tournaments-page[data-tournament-page-game-mode-value="cacheta"] [data-tournament-game-filter="cachetao"] {
  display: none !important;
}

.tournaments-page[data-tournament-page-game-mode-value="cachetao"] [data-tournament-game-filter="cacheta"] {
  display: none !important;
}
