/* =========================================================================
   FinnGameRoute — koko sivuston tyylit.
   Ei rakennusvaihetta: tavallista CSS:ää, jonka Express tarjoilee sellaisenaan.
   ========================================================================= */

:root {
  --night-900: #060b18;
  --night-800: #0b132b;
  --night-700: #111c3d;
  --surface: #1c2541;

  --aurora: #00f5d4;
  --glacier: #00bbf9;
  --frost: #7000ff;
  --rime: #8fd9ff;
  --amber: #f4d35e;
  --ice: #e8f7ff;
  --danger: #ff4d6d;

  --slate-100: #e6edf7;
  --slate-200: #cbd6e6;
  --slate-300: #a9b6cc;
  --slate-400: #8492ab;
  --slate-500: #64708a;
  --slate-600: #4a5568;

  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --glass-fill: rgba(255, 255, 255, 0.04);

  --accent: var(--aurora);
  --accent-soft: rgba(0, 245, 212, 0.18);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ease-nordic: cubic-bezier(0.16, 1, 0.3, 1);

  --max-width: 1152px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--slate-200);
  background-color: var(--night-800);
  background-image: radial-gradient(120% 80% at 50% -10%, rgba(0, 187, 249, 0.14) 0%, transparent 60%),
    linear-gradient(165deg, #060b18 0%, #0b132b 40%, #111c3d 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--slate-100);
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: rgba(0, 245, 212, 0.28);
  color: #eafffb;
}

:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 11, 24, 0.6);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.4), rgba(0, 187, 249, 0.35));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 70;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: var(--aurora);
  color: var(--night-900);
  font-weight: 600;
}

/* ------------------------------------------------------------------ perusosat */

.glass {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(11, 19, 43, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.hairline::after {
  content: '';
  position: absolute;
  inset-inline: 1.5rem;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.aurora-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.5), rgba(112, 0, 255, 0.4), transparent);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: rgba(0, 245, 212, 0.8);
}

.muted {
  color: var(--slate-500);
}
.strong {
  color: var(--slate-300);
}
.accent-text {
  color: var(--accent);
}
.gradient-text {
  background-image: linear-gradient(110deg, #00f5d4 0%, #00bbf9 45%, #7000ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s var(--ease-nordic), box-shadow 0.3s var(--ease-nordic),
    background 0.3s var(--ease-nordic), border-color 0.3s var(--ease-nordic), color 0.3s var(--ease-nordic);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--night-900);
  background: linear-gradient(120deg, #00f5d4 0%, #00bbf9 100%);
  box-shadow: 0 14px 40px -14px rgba(0, 245, 212, 0.75);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 52px -14px rgba(0, 245, 212, 0.95);
}

.btn-ghost {
  color: var(--slate-200);
  border-color: var(--glass-border-strong);
  background: var(--glass-fill);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(0, 245, 212, 0.5);
  color: #eafffb;
  background: rgba(0, 245, 212, 0.08);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--slate-300);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.icon-button:hover:not(:disabled) {
  color: var(--aurora);
  border-color: rgba(0, 245, 212, 0.5);
}
.icon-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.icon-button.is-active {
  color: var(--aurora);
}

.text-link {
  font-size: 0.8rem;
  color: var(--slate-400);
  transition: color 0.3s;
}
.text-link:hover {
  color: var(--aurora);
}

/* ------------------------------------------------------------------ navigaatio */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  padding: 0.75rem;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  transition: padding 0.5s var(--ease-nordic), box-shadow 0.5s var(--ease-nordic);
}
.site-header.is-condensed .navbar {
  padding: 0.5rem 0.75rem;
  box-shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-right: 0.5rem;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-100);
}
.brand-name .accent {
  color: var(--aurora);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--slate-400);
  transition: color 0.3s;
}
.nav-link:hover {
  color: var(--slate-100);
}
.nav-link.is-active {
  color: var(--slate-100);
  border: 1px solid rgba(0, 245, 212, 0.32);
  background: rgba(0, 245, 212, 0.08);
}

.nav-tail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.polar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.polar-pulse {
  position: relative;
  display: inline-flex;
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--aurora);
}
.polar-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--aurora);
  opacity: 0.6;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.polar-body {
  min-width: 168px;
  line-height: 1.25;
}
.polar-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--slate-400);
}
.polar-value {
  font-size: 0.75rem;
  color: var(--slate-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s;
}
.polar-value.is-fading {
  opacity: 0;
}

.mobile-menu {
  max-width: var(--max-width);
  margin: 0.5rem auto 0;
  padding: 0.5rem;
  border-radius: 24px;
}
.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  color: var(--slate-300);
  transition: background 0.3s, color 0.3s;
}
.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--aurora);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .nav-toggle {
    display: none;
  }
  .site-header {
    padding: 1.25rem 1.5rem;
  }
}
@media (min-width: 1024px) {
  .polar {
    display: flex;
  }
}

/* runemark */
.runemark {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.runemark-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  filter: blur(10px);
  background: radial-gradient(circle, rgba(0, 245, 212, 0.55), transparent 68%);
}
.runemark-ring {
  position: relative;
  animation: spin 46s linear infinite;
}
.runemark-core {
  position: absolute;
  inset: 0;
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 9rem 1.25rem 5rem;
  text-align: center;
}
@media (min-width: 640px) {
  .hero {
    padding-top: 11rem;
  }
}

.aurora-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.hero-glow {
  position: absolute;
  inset-inline: 0;
  top: 33%;
  height: 18rem;
  z-index: -1;
  opacity: 0.7;
  filter: blur(60px);
  pointer-events: none;
  background: radial-gradient(60% 100% at 50% 50%, rgba(0, 245, 212, 0.16), rgba(112, 0, 255, 0.08) 55%, transparent 75%);
}

.hero-inner {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-eyebrow .rule {
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: rgba(0, 245, 212, 0.6);
}

.hero-title {
  margin-top: 1.5rem;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  text-wrap: balance;
}
.hero-title .gradient-text {
  position: relative;
  display: inline-block;
}
.hero-title .gradient-text::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.5rem;
  width: 100%;
  height: 1px;
  transform-origin: left;
  background: linear-gradient(90deg, #00f5d4, transparent);
  animation: sweep-in 1.2s 0.7s var(--ease-nordic) backwards;
}

.hero-subtitle {
  max-width: 42rem;
  margin: 1.5rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--slate-400);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}
@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
  }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 32rem;
  margin: 3.5rem auto 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass-border);
}
.hero-stats > div {
  padding: 1.25rem 1rem;
  background: rgba(11, 19, 43, 0.8);
  backdrop-filter: blur(18px);
}
.hero-stats dt {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--slate-100);
}
.hero-stats dd {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--slate-500);
}

/* ------------------------------------------------------------------ osiot */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}
@media (min-width: 640px) {
  .section {
    padding-inline: 2rem;
  }
}
.page-top {
  padding-top: 8.5rem;
}

.section-heading {
  max-width: 40rem;
}
.section-heading h2 {
  margin-top: 1rem;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 600;
}
.section-subtitle {
  margin-top: 1rem;
  line-height: 1.7;
  color: var(--slate-400);
  text-wrap: pretty;
}
.section-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ------------------------------------------------------------------ pelikortit */

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}
@media (min-width: 640px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.game-card-wrap {
  perspective: 1200px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  padding: 1.5rem;
  overflow: hidden;
  transition: border-color 0.5s var(--ease-nordic), box-shadow 0.5s var(--ease-nordic),
    transform 0.35s var(--ease-nordic);
}
.game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 30px 70px -34px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.chip {
  padding: 0.25rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.dots {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.dot.is-on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.game-card-title {
  font-size: 1.25rem;
  font-weight: 600;
}
.game-card-tagline {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--slate-400);
}
.game-card-body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(132, 146, 171, 0.95);
  text-wrap: pretty;
}

.game-card-foot {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
}
.game-card-play {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: transform 0.3s var(--ease-nordic);
}
.game-card:hover .game-card-play {
  transform: translateX(4px);
}

/* ------------------------------------------------------------------ tietoa */

.about {
  padding-block: 6rem;
}
.about-grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4rem;
  }
}
.about h2 {
  margin-top: 1rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.stack-list li {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  color: var(--slate-400);
}

.pillars {
  display: grid;
  gap: 1rem;
}
.pillar {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
}
.pillar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}
.pillar h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-100);
}
.pillar p {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--slate-400);
}

/* ------------------------------------------------------------------ pelisivu */

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.game-head-main {
  flex: 1 1 20rem;
}
.game-head-main h1 {
  margin-top: 0.75rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  font-size: 0.8rem;
  color: var(--slate-400);
  transition: color 0.3s;
}
.back-link:hover {
  color: var(--aurora);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.hud-stats {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  min-width: 0;
}
.hud-item {
  min-width: 64px;
}
.hud-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--slate-500);
}
.hud-value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--slate-100);
}
.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--night-900);
  box-shadow: 0 40px 90px -50px var(--accent);
}
.game-canvas {
  display: block;
  width: 100%;
  height: min(66vh, 660px);
  touch-action: none;
}
.stage:fullscreen .game-canvas {
  height: 100vh;
}

/* Voitto huuhtoo ruudun revontulilla, tappio jäätää sen punaiseksi. */
.stage.is-win::before,
.stage.is-lose::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  animation: wash-in 1.4s var(--ease-nordic) forwards;
}
.stage.is-win::before {
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.42) 0%, rgba(0, 187, 249, 0.24) 32%, transparent 72%);
}
.stage.is-lose::before {
  background: radial-gradient(70% 60% at 50% 45%, rgba(255, 77, 109, 0.28), transparent 70%);
}
@keyframes wash-in {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0.35;
  }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: rgba(6, 11, 24, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: overlay-in 0.4s var(--ease-nordic);
}
.overlay[hidden] {
  display: none;
}
.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 32rem;
  animation: rise-in 0.55s 0.05s var(--ease-nordic) backwards;
}
.overlay-inner h2 {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 600;
}
.overlay-text {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--slate-400);
  text-wrap: pretty;
}
.overlay-inner .btn {
  margin-top: 1.75rem;
}
.overlay-hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--slate-500);
}
.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.overlay-actions .btn {
  margin-top: 0;
}

.result-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  color: var(--danger);
  animation: pop-in 0.5s 0.15s var(--ease-nordic) backwards;
}
.result-headline.is-win {
  color: var(--accent);
}
.result-label {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--slate-500);
}
.result-score {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--slate-100);
}
.result-record {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--aurora);
}

.score-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 24rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .score-form {
    flex-direction: row;
  }
}
.score-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--glass-border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--slate-100);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.3s;
}
.score-form input::placeholder {
  color: var(--slate-500);
}
.score-form input:focus {
  border-color: rgba(0, 245, 212, 0.6);
}
.score-form .btn {
  margin-top: 0;
  flex-shrink: 0;
}
.score-status {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--slate-300);
}
.score-status.is-error {
  color: var(--danger);
}

.stage-hint {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.desktop-only {
  display: none;
}
@media (min-width: 640px) {
  .desktop-only {
    display: inline;
  }
  .touch-only {
    display: none;
  }
}

.mini-board {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
}
.mini-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.mini-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
}
.mini-list .rank {
  width: 1.75rem;
  font-family: var(--font-display);
  color: var(--slate-400);
}
.mini-list .player {
  flex: 1 1 auto;
  color: var(--slate-200);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-list .score {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ------------------------------------------------------------------ tulostaulu */

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate-400);
  transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.tab:hover {
  color: var(--slate-100);
}
.tab.is-active {
  color: var(--night-900);
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 70%, transparent));
  box-shadow: 0 8px 26px -10px var(--accent);
}

.board {
  margin-top: 1.5rem;
  overflow: hidden;
}
.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.board-head h3 {
  margin-top: 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.board-personal {
  text-align: right;
}

.table-scroll {
  overflow-x: auto;
}
.board-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.board-table th {
  padding: 0.75rem 1.5rem;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--slate-500);
}
.board-table td {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--slate-200);
}
.board-table tbody tr {
  transition: background 0.3s;
}
.board-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.board-table .right {
  text-align: right;
}
.board-table .rank {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--slate-400);
}
.board-table .score {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.board-table .date-col {
  display: none;
}
@media (min-width: 640px) {
  .board-table .date-col {
    display: table-cell;
  }
}

.empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
}

.notfound {
  text-align: center;
  min-height: 50vh;
}
.notfound h2 {
  margin-top: 1rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}
.notfound .section-subtitle {
  margin-inline: auto;
  max-width: 32rem;
}

/* ------------------------------------------------------------------ lakisivut */

.legal {
  max-width: 52rem;
}
.legal-head h1 {
  margin-top: 1rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
}
.legal-updated {
  margin-top: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-600);
}
.legal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2.5rem;
}
.legal-section {
  padding: 1.5rem;
  border-radius: 1rem;
}
.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--slate-100);
}
.legal-section p {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--slate-400);
  text-wrap: pretty;
}
.legal-list {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--slate-400);
}
.legal-list li {
  position: relative;
  padding-left: 1.1rem;
}
.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aurora);
  opacity: 0.7;
}
.legal-defs {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9375rem;
}
.legal-defs div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
@media (min-width: 640px) {
  .legal-defs div {
    flex-direction: row;
    gap: 1rem;
  }
  .legal-defs dt {
    flex: 0 0 9rem;
  }
}
.legal-defs dt {
  color: var(--slate-600);
}
.legal-defs dd {
  color: var(--slate-100);
}
.legal-contacts {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}
.legal-contacts li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9375rem;
}
.legal-contact-label {
  font-size: 0.8125rem;
  color: var(--slate-600);
}
.legal-contacts a {
  color: var(--aurora);
  transition: opacity 0.3s;
}
.legal-contacts a:hover {
  opacity: 0.75;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

/* ------------------------------------------------------------------ alatunniste */

.site-footer {
  margin-top: 6rem;
  border-top: 1px solid var(--glass-border);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}
@media (min-width: 640px) {
  .footer-inner {
    padding-inline: 2rem;
  }
}
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .footer-top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2.5rem;
  }
}
.footer-brand {
  max-width: 24rem;
}
.footer-brand .muted {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}
.footer-mail {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--aurora);
  transition: opacity 0.3s;
}
.footer-mail:hover {
  opacity: 0.75;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.footer-links-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-600);
}
.footer-links a {
  color: var(--slate-400);
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--aurora);
}
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--slate-600);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------------ animaatiot */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
@keyframes sweep-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(8px);
  animation: reveal-in 0.85s var(--delay, 0ms) var(--ease-nordic) forwards;
}
@keyframes reveal-in {
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Kortit nousevat esiin, kun ne tulevat näkyviin. */
.in-view-target {
  opacity: 0;
  transform: translateY(26px) scale(0.97);
  transition: opacity 0.65s var(--ease-nordic), transform 0.65s var(--ease-nordic);
}
.in-view-target.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .in-view-target {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
