/* Chess JD public site. Ionic / Material look, shared with the tournament app:
   same buttons, list rows, badges, header color and type. */

:root {
  --primary: #3880ff;          /* Ionic primary, same as the app's buttons and badges */
  --primary-shade: #3171e0;
  --secondary: #006600;
  --secondary-shade: #005a00;
  --bar: #3880ff;              /* header bar: same blue as the buttons */
  --text: #000000;
  --muted: #666666;
  --line: rgba(0, 0, 0, 0.13);
  --box: #f7f7f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
}

h1 {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  margin: 20px 0 10px;
}

h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  margin: 18px 0 10px;
}

p {
  margin: 0 0 16px;
}

section {
  margin: 30px 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

main > .wrap {
  padding-top: 20px;
}

main > .wrap + .wrap {
  padding-top: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  background: #fff;
  padding: 6px 10px;
  z-index: 20;
}

/* ---------- Header bar ---------- */

.site-header {
  background: var(--bar);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  max-width: none;
  padding: 0 8px 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.25px;
  text-decoration: none;
  line-height: 56px;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.sign-in {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0 12px;
  line-height: 40px;
  border-radius: 4px;
}

.sign-in:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ---------- Buttons ---------- */

.button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 1.1em;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

/* Main call to action: taller, same text size. */
.button-large {
  min-height: 60px;
}

.button:hover {
  background: var(--primary-shade);
  color: #fff;
}

/* Second choice: the app's secondary green. */
.button-secondary {
  background: var(--secondary);
}

.button-secondary:hover {
  background: var(--secondary-shade);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 30px;
}

/* ---------- Content ---------- */

main {
  display: block;
}

.points + p {
  margin-top: 16px;
}

.box,
.points li {
  background: var(--box);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 12px 20px;
}

/* Intro text in a card under the page title, above a list (tournaments page). */
.intro-card {
  margin-bottom: 16px;
}

.intro-card p {
  margin: 4px 0;
}

.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.points strong {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Points with an icon on the left (home and host pages). */
.points-icons li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.point-icon {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(56, 128, 255, 0.12);
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Space above a section heading opened from a link (e.g. /host/#pairings). */
h2[id] {
  scroll-margin-top: 16px;
}

/* Cards that open a detail section: the whole card is the link. */
.points-links li {
  display: block;
  padding: 0;
}

.points-links a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 6px 12px 20px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.points-links a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.points-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.points-links a > div {
  flex: 1;
}

.point-chevron {
  flex: none;
  margin-left: auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.todo {
  background: #fff3cd;
  border-radius: 4px;
  padding: 8px 12px;
}

.list-status {
  color: var(--muted);
  padding: 12px 0;
}

/* ---------- Tournament list ---------- */

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

.tournament-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 20px;
  color: var(--text);
  text-decoration: none;
  background: #fff;
}

.tournament-list a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.tournament-list .thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.tournament-list .row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 20px 11px 0;
  border-bottom: 1px solid var(--line);
}

.tournament-list li:last-child .row {
  border-bottom: 0;
}

.tournament-list .label {
  flex: 1;
  min-width: 0;
}

.t-name {
  display: block;
  font-size: 16px;
  line-height: 19px;
  margin-bottom: 2px;
}

.t-meta {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.badge {
  flex: none;
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  padding: 3px 4px 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 13px;
}

/* ---------- Tournament page ---------- */

/* Same layout as the app's Tournament Overview page: everything centered. */
.overview {
  text-align: center;
}

.overview .kind {
  margin: 16px 0;
}

/* Label / value table, centered as a block, text left-aligned inside. */
.facts {
  margin: 0 auto;
  border-collapse: collapse;
  text-align: left;
}

.facts th,
.facts td {
  padding: 4px 0;
  vertical-align: top;
}

.facts th {
  font-weight: 400;
  padding-right: 20px;
  white-space: nowrap;
}

/* Main call to action, sized like the app's large Enter button. */
.button.enter {
  display: inline-flex;
  width: auto;
  min-width: 114px;
  min-height: 56px;
  margin-top: 20px;
  padding: 0 1.2em;
  font-size: 20px;
}

.rook {
  display: block;
  width: 200px;
  max-width: 60%;
  height: auto;
  margin: 8px auto 0;
}

.about {
  white-space: pre-line;
  text-align: left;
}

/* FAQ and sign-up details (organizer text): centered bold toggles as in the app;
   the text inside reads left-aligned. */
.more summary {
  cursor: pointer;
  font-weight: 700;
  padding: 8px 0;
}

.more .content {
  overflow-wrap: anywhere;
  padding-bottom: 12px;
  text-align: left;
}

.more-link {
  margin-top: 24px;
}

.more .content table {
  display: block;
  overflow-x: auto;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid rgba(0, 0, 0, 0.13);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  margin-top: 30px;
  padding: 0 0 32px;
  font-size: 14px;
}

.site-footer ul {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

.site-footer li {
  display: inline;
}

.site-footer li + li::before {
  content: " | ";
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}


.hero-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Numbered stages (Tournament flow). Not cards, because they don't link anywhere. */
.flow {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  counter-reset: flow;
}

.flow li {
  position: relative;
  padding: 0 0 18px 44px;
  counter-increment: flow;
}

.flow li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.flow li::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.flow li:last-child {
  padding-bottom: 0;
}

.flow li:last-child::after {
  display: none;
}

.flow strong {
  display: block;
  font-weight: 500;
  line-height: 28px;
}

/* Plain list with dividers (Access levels). */
.plain-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.plain-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:first-child {
  padding-top: 0;
}

.plain-list strong {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

.plain-list-icons li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.plain-list-icons li:first-child {
  padding-top: 10px;
}

.steps {
  padding-left: 1.4em;
  margin: 0 0 16px;
}

.steps li {
  margin-bottom: 8px;
}

.shot {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
