/*
 * Kickora's links page. The colours, type and corners are the brand's, as in the website
 * (LineupWebsite/src/index.css): true black, green-tinted cards, Kickora Green for the action that
 * matters with black on it, Manrope for Latin letters and Readex Pro for Arabic. Flat: no gradients,
 * glows or shadows. The page is a pitch seen from above: centre circle at the top, penalty area at the
 * foot, in the faint green of the app's pitch markings.
 */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url('/fonts/readex-pro-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --green: #00f291;
  --black: #000000;
  --surface: #111713;
  --raised: #222a27;
  --text: #ffffff;
  --muted: #b5bdb8;
  --line: rgb(0 242 145 / 0.16);
  --wash: rgb(0 242 145 / 0.14);
  --fill: rgb(255 255 255 / 0.05);
  --border: rgb(255 255 255 / 0.16);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--black);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--black);
  color: var(--text);
  font-family: 'Manrope', 'Readex Pro', Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

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

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

.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0
    max(20px, env(safe-area-inset-left));
}

/* ---- Top bar: language and share ---- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--black);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.chip-icon {
  width: 40px;
  padding: 0;
}

.chip[hidden] {
  display: none;
}

.ico {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico .dot {
  fill: currentColor;
  stroke: none;
}

.chip-icon .ico {
  width: 18px;
  height: 18px;
}

/* ---- The centre circle, the halfway line and the logo on the spot ---- */

.crest {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 188px;
  margin-top: 12px;
}

/* The halfway line runs the width of the screen, not of the column. */
.crest::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--line);
  transform: translateX(-50%) scaleX(1);
  animation: line 0.9s var(--smooth) both;
}

.circle {
  position: absolute;
  width: 188px;
  height: 188px;
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  transform: rotate(-90deg);
}

.circle circle {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 1.1s var(--smooth) 0.15s both;
}

.logo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: var(--black);
}

.symbol {
  width: 60px;
  height: auto;
  animation: pop 0.7s var(--spring) 0.35s both;
}

.wordmark {
  width: 106px;
  height: auto;
  animation: rise 0.6s var(--smooth) 0.6s both;
}

/* ---- Words ---- */

h1 {
  margin-top: 20px;
  font-size: 32px;
  font-weight: 800;
  line-height: 38px;
  letter-spacing: -0.02em;
  text-align: center;
}

.accent {
  color: var(--green);
}

.lead {
  margin-top: 6px;
  color: var(--muted);
  text-align: center;
}

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 4px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* A touchline running off from the label */
.label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- The rows ---- */

.rows {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px;
  padding-inline-end: 18px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--surface);
  transition: background-color 0.2s, transform 0.2s var(--smooth);
}

.tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--green);
}

.words {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  text-align: start;
}

.name {
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* In Arabic the Latin address stays left-to-right but sits at the row's start. */
:root:lang(ar) .sub {
  text-align: right;
}

.go {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.25s var(--spring), color 0.2s;
}

:root:lang(ar) .go {
  transform: scaleX(-1);
}

/* The one green action: black on Kickora Green, never white. */
.row-primary {
  background: var(--green);
  color: var(--black);
}

.row-primary .tile {
  background: var(--black);
}

.row-primary .sub,
.row-primary .go {
  color: rgb(0 0 0 / 0.72);
}

/* Not in play yet: an outline where the row will be. */
.row-bench {
  border: 1px dashed var(--border);
  background: transparent;
}

.row-bench .tile {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--green);
    color: var(--green);
  }

  a.row:hover {
    background: var(--raised);
  }

  a.row-primary:hover {
    background: var(--green);
    transform: translateY(-2px);
  }

  a.row:hover .go {
    color: var(--green);
    transform: translate(2px, -2px);
  }

  a.row-primary:hover .go {
    color: var(--black);
  }

  :root:lang(ar) a.row:hover .go {
    transform: scaleX(-1) translate(2px, -2px);
  }
}

a.row:active {
  transform: scale(0.98);
}

/* ---- The penalty area ---- */

.box {
  position: relative;
  width: 78%;
  margin: 64px auto 0;
  padding: 26px 12px max(22px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  text-align: center;
}

/* The spare height of a tall screen goes between the last row and the box. */
.page > .rows:last-of-type {
  margin-bottom: auto;
}

/* The arc on the edge of the area */
.box::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 96px;
  height: 36px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: translateX(-50%);
}

.tagline {
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.legal {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

/* ---- "Link copied" ---- */

.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--green);
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  transform: translateX(-50%);
  animation: rise-centred 0.3s var(--smooth) both;
}

.toast[hidden] {
  display: none;
}

/* ---- Arabic: Readex Pro draws bigger and needs taller lines (as on the website) ---- */

:root:lang(ar) body {
  font-size: 15px;
  line-height: 26px;
}

:root:lang(ar) h1 {
  font-size: 28px;
  line-height: 42px;
  letter-spacing: 0;
}

:root:lang(ar) .label {
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
}

:root:lang(ar) .name {
  font-size: 15px;
  line-height: 26px;
}

:root:lang(ar) .pill,
:root:lang(ar) .tagline {
  line-height: 22px;
}

/* The language chip shows the other language's name, in that language's letters. */
.chip:lang(ar) {
  font-size: 14px;
  line-height: 22px;
}

/* ---- Motion: everything arrives once, in order ---- */

.in {
  animation: rise 0.6s var(--smooth) both;
}

.d1 { animation-delay: 0.75s; }
.d2 { animation-delay: 0.85s; }
.d3 { animation-delay: 0.95s; }
.d4 { animation-delay: 1.03s; }
.d5 { animation-delay: 1.11s; }
.d6 { animation-delay: 1.19s; }
.d7 { animation-delay: 1.3s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes rise-centred {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes line {
  from {
    transform: translateX(-50%) scaleX(0);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
