:root {
  --bg: #0a0a0a;
  --line: #1f1f1f;
  --green: #1ed760;
  --yellow: #f5c518;
  --red: #e53935;
  --muted: #8a8a8a;
  --white: #ffffff;
  font-family: Rubik, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

.head {
  padding: calc(18px + env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.head h1 {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

main {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 4px 12px 10px;
}

.table {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 22px 58px minmax(0, 1fr);
  grid-template-areas:
    "num mark mid"
    "rate rate rate"
    "go go go";
  gap: 8px 10px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.num {
  grid-area: num;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 800;
}

.mark {
  grid-area: mark;
  display: grid;
  width: 58px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
}

.mark img {
  width: auto;
  height: auto;
  max-width: 50px;
  max-height: 30px;
  object-fit: contain;
}

.mark:focus-visible,
.go:focus-visible,
.base a:focus-visible {
  outline: 3px solid rgba(30, 215, 96, 0.55);
  outline-offset: 2px;
}

.mid {
  grid-area: mid;
  min-width: 0;
}

.mid strong {
  display: block;
  color: var(--green);
  font-size: clamp(1.05rem, 4.4vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mid em {
  display: block;
  margin-top: 1px;
  color: var(--green);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.mid small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.go {
  grid-area: go;
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--white);
  color: #111;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.go:hover { filter: brightness(0.94); }

.rate {
  grid-area: rate;
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  color: #3a3a3a;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.rate .on { color: var(--yellow); }

.base {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.base p { margin: 0 0 10px; }

.base nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.base a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.doc main {
  padding: 16px 16px 24px;
}

.doc article {
  color: #d0d0d0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.doc h2 {
  margin: 22px 0 8px;
  font-size: 1.1rem;
}

.doc h2:first-child { margin-top: 0; }

.doc a { color: var(--green); font-weight: 700; }

.warn {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  border-radius: 10px;
  background: #241c05;
}

@media (min-width: 390px) {
  .row {
    grid-template-columns: 22px 58px auto auto auto;
    grid-template-areas: "num mark mid rate go";
    justify-content: start;
    padding: 12px 2px;
  }

  .go {
    min-width: 92px;
    min-height: 36px;
    padding: 0 12px;
  }

  .rate {
    grid-column: auto;
    margin-top: 0;
    justify-content: center;
  }
}

@media (min-width: 430px) {
  main, .base { padding-right: 18px; padding-left: 18px; }
}

@media (min-width: 768px) {
  body {
    padding: 24px;
    background:
      radial-gradient(circle at 80% 0%, rgba(245, 197, 24, 0.08), transparent 22rem),
      var(--bg);
  }

  main, .head, .base {
    width: min(100%, 520px);
  }

  .head {
    margin: 0 auto;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }

  main {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: #0d0d0d;
  }

  .base {
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 20px 20px;
    background: #0d0d0d;
  }

  .row {
    grid-template-columns: 28px 72px auto auto auto;
    grid-template-areas: "num mark mid rate go";
    gap: 12px 14px;
  }

  .rate {
    grid-column: auto;
    margin-top: 0;
  }

  .mark {
    width: 72px;
    height: 48px;
  }

  .mark img {
    max-width: 62px;
    max-height: 36px;
  }
}

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