/* Ryū: yhteinen tyyli sivuille leaderboard, stats ja forms. Peli (index.html) pitää omat tyylinsä. */
@font-face { font-family: "Yuji Boku"; font-display: swap; src: url("fonts/yuji-boku-subset.woff2") format("woff2"); }
@font-face {
  font-family: "Cormorant Garamond"; font-weight: 500 700; font-display: swap;
  src: url("fonts/cormorant-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}
@font-face {
  font-family: "Cormorant Garamond"; font-weight: 500 700; font-display: swap;
  src: url("fonts/cormorant-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F;
}
:root {
  --ink: #17140f; --paper: #e6dcc6; --card: #f1e9d6; --line: #cfc3a6; --dim: #6f6654; --red: #d7362b;
  --gold: #c9952c; --silver: #8d8a84; --bronze: #a5603a; --you: #f6e0cf;
  --wrap: 760px; --bar: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 130px; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 18px;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--bar) + 40px + env(safe-area-inset-bottom));
}
a { color: inherit; }
.num { font-family: "Yuji Boku", serif; font-weight: 400; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- yläpalkki: paluu peliin ja välilehdet ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in { max-width: var(--wrap); margin: 0 auto; padding: 8px 16px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding-right: 8px;
  text-decoration: none; font-weight: 700; letter-spacing: 0.32em; font-size: 1.15rem;
}
.brand .seal {
  display: grid; place-items: center; width: 38px; height: 38px; background: var(--red); color: var(--card);
  font-family: "Yuji Boku", serif; font-size: 26px; letter-spacing: 0; line-height: 1;
}
.brand .back { margin-left: 4px; font-size: 1.02rem; letter-spacing: 0.04em; font-weight: 700; color: var(--ink); opacity: 0.62; }
.brand:hover .back { opacity: 1; color: var(--red); }
.tabs { display: flex; flex: 1 1 320px; justify-content: flex-end; gap: 4px; }
.tabs a {
  flex: 0 1 auto; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 14px;
  text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: 0.04em; color: var(--dim);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
@media (max-width: 560px) {
  .top-in { padding-top: 4px; gap: 0; }
  .brand { min-height: 44px; }
  .tabs { flex-basis: 100%; justify-content: stretch; }
  .tabs a { flex: 1 1 0; padding: 0 4px; font-size: 1.02rem; }
}

/* ---------- sisältö ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 22px 16px 0; }
.intro h1 { margin: 0; font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 700; letter-spacing: 0.03em; line-height: 1.1; }
.intro h1 i { font-style: normal; color: var(--red); }
.intro p { margin: 6px 0 0; font-size: 1.12rem; color: var(--dim); line-height: 1.45; }
h2 { margin: 34px 0 4px; font-size: 1.6rem; font-weight: 700; }
h2 + p { margin: 0 0 12px; color: var(--dim); font-size: 1.08rem; }
.card { background: var(--card); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--dim); font-size: 1.15rem; padding: 34px 16px; }
.empty .btn { margin-top: 14px; }

/* lataus: haaleat musteviivat */
.skel { display: grid; gap: 10px; margin-top: 18px; }
.skel i { display: block; height: 58px; background: var(--card); border: 1px solid var(--line); animation: fade 1.4s ease-in-out infinite; }
.skel i:nth-child(2) { animation-delay: 0.15s; } .skel i:nth-child(3) { animation-delay: 0.3s; }
@keyframes fade { 50% { opacity: 0.45; } }

/* ---------- painikkeet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 48px; padding: 0 1.3em;
  font: inherit; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.06em; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--red); color: var(--red); background: var(--card);
}
.btn.solid { background: var(--red); color: var(--card); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

/* aina näkyvä Lennä-painike alareunassa */
.play {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 62%, color-mix(in srgb, var(--paper) 0%, transparent));
  pointer-events: none;
}
.play a {
  pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 12px;
  max-width: 440px; height: var(--bar); margin: 0 auto;
  background: var(--red); color: var(--card); text-decoration: none;
  font-weight: 700; font-size: 1.35rem; letter-spacing: 0.22em; padding-left: 0.22em;
  box-shadow: 0 6px 18px rgba(23, 20, 15, 0.22), 0 1px 0 rgba(23, 20, 15, 0.3);
}
.play a .k { font-family: "Yuji Boku", serif; font-size: 30px; letter-spacing: 0; }
.play a:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(23, 20, 15, 0.25); }

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