/* Klippi — käyttöohjeet. Itsenäinen tyylitiedosto, ei riippuvuuksia sovelluksen buildiin. */

:root {
  color-scheme: light;

  --canvas: #f6f5f2;
  --panel: #ffffff;
  --subtle: #fbfaf8;
  --ink: #26251f;
  --text: #4a483f;
  --muted: #6e6c64;
  --faint: #a29e95;
  --line: #e7e4dd;
  --line-soft: #f0eee9;
  --accent: #3e5c4b;
  --accent-hover: #4a6e59;
  --accent-tint: #ebf0ec;
  --player: #6e88a6;
  --player-tint: #e9edf1;
  --warn: #8a6420;
  --warn-bg: #fbf2e4;
  --warn-line: #ead9b8;
  --danger: #b4553f;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 46rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: max(0.7rem, env(safe-area-inset-top));
}

/* The mark alone, in the brand green. It used to be a green tile with a
   literal letter K standing in for the logo; the wordmark is redundant here
   because .topbar__title already reads "Klippi" right next to it. */
.topbar__mark {
  display: grid;
  place-items: center;
  height: 1.85rem;
  flex: none;
  color: var(--accent);
  text-decoration: none;
}

.topbar__mark-svg {
  display: block;
  height: 1.5rem;
  width: auto;
}

.topbar__title {
  font-weight: 650;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.topbar__title span {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar__back {
  margin-left: auto;
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0.15rem;
}

.topbar__back:hover {
  color: var(--accent-hover);
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
  padding-bottom: max(5rem, calc(3rem + env(safe-area-inset-bottom)));
}

.hero {
  margin-bottom: 1.75rem;
}

.hero__role {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero__role--player {
  background: var(--player-tint);
  color: #4a5e72;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-weight: 700;
}

.hero__lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

h2 {
  margin: 2.5rem 0 0.4rem;
  font-size: clamp(1.2rem, 4.4vw, 1.45rem);
  line-height: 1.25;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 5rem;
}

h2:first-of-type {
  margin-top: 1.5rem;
}

h3 {
  margin: 1.6rem 0 0.35rem;
  font-size: 1.02rem;
  color: var(--ink);
  font-weight: 650;
}

p {
  margin: 0 0 0.9rem;
}

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

strong {
  color: var(--ink);
  font-weight: 650;
}

/* ---------- sisällysluettelo ---------- */

.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc__title {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.toc li {
  margin-bottom: 0.3rem;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* ---------- vaiheet ---------- */

.steps {
  margin: 0.8rem 0 1.2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 1.05rem 2.6rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.steps > li::after {
  content: '';
  position: absolute;
  left: 0.875rem;
  top: 2.1rem;
  bottom: 0.15rem;
  width: 1px;
  background: var(--line);
}

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

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

.steps b {
  display: block;
  color: var(--ink);
  font-weight: 650;
}

/* ---------- kuvat ---------- */

figure {
  margin: 1.1rem 0 1.4rem;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

figure.phone img {
  max-width: 17rem;
  margin-inline: auto;
  border-radius: 16px;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.83rem;
  color: var(--faint);
  text-align: center;
}

/* ---------- huomiolaatikot ---------- */

.note {
  margin: 1.1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 0.95rem;
}

.note b {
  color: var(--ink);
}

.note--tip {
  background: var(--accent-tint);
  border-color: #cfe0d5;
}

.note--warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.note--warn b {
  color: var(--warn);
}

.note p:last-child {
  margin-bottom: 0;
}

/* ---------- näppäimet ja korostukset ---------- */

kbd {
  display: inline-block;
  padding: 0.1rem 0.42rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  white-space: nowrap;
}

.ui {
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.93em;
  white-space: nowrap;
}

/* ---------- listat ---------- */

.wrap ul:not(.steps):not(.cards) {
  margin: 0.4rem 0 1.1rem;
  padding-left: 1.25rem;
}

.wrap ul:not(.steps):not(.cards) li {
  margin-bottom: 0.35rem;
}

/* ---------- taulukko ---------- */

.table-scroll {
  margin: 1rem 0 1.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

thead th {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

td.yes {
  color: var(--accent);
  font-weight: 650;
}

td.no {
  color: var(--faint);
}

/* ---------- roolikortit (etusivu) ---------- */

.cards {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 46rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: block;
  padding: 1.15rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card__tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__tag--player {
  background: var(--player-tint);
  color: #4a5e72;
}

.card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- alaviite ---------- */

.footer {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--faint);
}

.footer a {
  color: var(--muted);
}

/* ---------- roolilinkit sivun lopussa ---------- */

.otherroles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.otherroles a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.otherroles a:hover {
  border-color: var(--accent);
}
