/* Yksinkertaiset Pelit — minimal theme */

:root {
  --yp-bg: #1a1a2e;
  --yp-bg-muted: #222238;
  --yp-surface: rgba(255, 255, 255, 0.04);
  --yp-border: rgba(255, 255, 255, 0.08);
  --yp-text: rgba(245, 245, 247, 0.92);
  --yp-text-muted: rgba(245, 245, 247, 0.55);
  --yp-accent: #ff6b6b;
  --yp-accent-hover: #ff8585;
  --yp-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --yp-max: 1080px;
  --yp-radius: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--yp-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--yp-text);
  background: var(--yp-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.yp-container {
  width: min(var(--yp-max), calc(100% - 3rem));
  margin-inline: auto;
}

.yp-container--narrow {
  --yp-max: 640px;
}

/* Buttons */

.yp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--yp-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.yp-btn--accent {
  background: var(--yp-accent);
  color: #fff;
}

.yp-btn--accent:hover {
  background: var(--yp-accent-hover);
  color: #fff;
}

.yp-btn--ghost {
  background: transparent;
  color: var(--yp-text-muted);
  border: 1px solid var(--yp-border);
}

.yp-btn--ghost:hover {
  color: var(--yp-text);
  border-color: rgba(255, 255, 255, 0.18);
}

.yp-btn--sm {
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
}

.yp-btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* Header */

.yp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--yp-border);
}

.yp-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 72px;
}

.yp-logo {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--yp-text);
  white-space: nowrap;
}

.yp-logo--footer {
  font-size: 1rem;
}

.yp-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-inline: auto;
}

.yp-nav__link {
  font-size: 0.875rem;
  color: var(--yp-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.yp-nav__link:hover {
  color: var(--yp-text);
}

.yp-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.yp-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--yp-text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.yp-header.is-open .yp-menu-toggle span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.yp-header.is-open .yp-menu-toggle span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */

.yp-hero {
  padding: clamp(5rem, 14vw, 9rem) 0 clamp(4rem, 10vw, 7rem);
}

.yp-hero__inner {
  max-width: 560px;
}

.yp-hero__label {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yp-text-muted);
}

.yp-hero__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
}

.yp-hero__lead {
  margin: 0 0 2.5rem;
  font-size: 1.125rem;
  color: var(--yp-text-muted);
  max-width: 28ch;
}

.yp-hero__note {
  margin: 1.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
}

/* Sections */

.yp-section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.yp-section--muted {
  background: var(--yp-bg-muted);
}

.yp-section__head {
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.yp-section__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.yp-section__sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--yp-text-muted);
}

/* Inline banner */

.yp-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: var(--yp-surface);
  border: 1px solid var(--yp-border);
  border-radius: var(--yp-radius);
}

.yp-banner__tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yp-accent);
}

.yp-banner__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--yp-text-muted);
  min-width: 12rem;
}

.yp-banner__link {
  padding: 0;
  font-family: var(--yp-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--yp-accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* Game cards */

.yp-games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.yp-game-card {
  border-radius: calc(var(--yp-radius) + 4px);
  overflow: hidden;
  background: var(--yp-surface);
  border: 1px solid var(--yp-border);
  transition: border-color 0.2s;
}

.yp-game-card:hover {
  border-color: rgba(255, 107, 107, 0.35);
}

.yp-game-card__hit {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--yp-font);
  color: inherit;
}

.yp-game-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.yp-game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.yp-game-card:hover .yp-game-card__media img {
  transform: scale(1.03);
}

.yp-game-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.yp-game-card__title {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
}

.yp-game-card__meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
}

/* Edut */

.yp-edut {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.yp-edut-card {
  padding: 2rem 1.75rem;
  background: var(--yp-surface);
  border: 1px solid var(--yp-border);
  border-radius: var(--yp-radius);
}

.yp-edut-card__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.yp-edut-card__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--yp-text-muted);
  line-height: 1.55;
}

/* FAQ */

.yp-faq {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--yp-border);
}

.yp-faq__item {
  border-bottom: 1px solid var(--yp-border);
}

.yp-faq__q {
  padding: 1.25rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--yp-text);
  cursor: pointer;
  list-style: none;
}

.yp-faq__q::-webkit-details-marker {
  display: none;
}

.yp-faq__q::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: var(--yp-text-muted);
}

.yp-faq__item[open] .yp-faq__q::after {
  content: "−";
}

.yp-faq__a {
  margin: 0 0 1.25rem;
  padding-right: 2rem;
  font-size: 0.875rem;
  color: var(--yp-text-muted);
  line-height: 1.6;
}

.yp-faq__a a {
  color: var(--yp-accent);
  text-decoration: none;
}

.yp-faq__a a:hover {
  text-decoration: underline;
}

/* Footer */

.yp-footer {
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem;
  border-top: 1px solid var(--yp-border);
}

.yp-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}

.yp-footer__tagline {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--yp-text-muted);
}

.yp-footer__contact {
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
  line-height: 1.65;
}

.yp-footer__contact p {
  margin: 0 0 0.35rem;
}

.yp-footer__address {
  color: rgba(245, 245, 247, 0.72);
}

.yp-footer__contact a {
  color: var(--yp-text-muted);
  text-decoration: none;
}

.yp-footer__contact a:hover {
  color: var(--yp-accent);
}

.yp-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.yp-footer__nav a {
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
  text-decoration: none;
}

.yp-footer__nav a:hover {
  color: var(--yp-accent);
}

.yp-footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--yp-border);
}

.yp-footer__bottom p {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
}

.yp-footer__legal {
  color: rgba(245, 245, 247, 0.72) !important;
}

.yp-footer__copy {
  margin-top: 1rem !important;
  opacity: 0.7;
}

/* Age gate */

body.yp-agegate-open {
  overflow: hidden;
}

.yp-agegate[hidden] {
  display: none !important;
}

.yp-agegate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.yp-agegate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.92);
}

.yp-agegate__card {
  position: relative;
  width: min(400px, 100%);
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--yp-bg-muted);
  border: 1px solid var(--yp-border);
  border-radius: calc(var(--yp-radius) + 4px);
}

.yp-agegate__badge {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--yp-accent);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 50%;
}

.yp-agegate__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.yp-agegate__desc {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--yp-text-muted);
}

.yp-agegate__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Game modal */

.yp-modal .modal-content {
  background: var(--yp-bg-muted);
  border: 1px solid var(--yp-border);
  border-radius: var(--yp-radius);
}

.yp-modal .modal-header {
  border-bottom: 1px solid var(--yp-border);
  padding: 1rem 1.25rem;
}

.yp-modal .modal-title {
  color: #fff;
  font-family: var(--yp-font);
  font-weight: 600;
}

.yp-modal .modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.yp-modal .btn-close {
  filter: invert(1);
  opacity: 0.6;
}

.yp-game-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  border-radius: 12px;
  background: #12121f;
}

.yp-modal__note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--yp-text-muted);
}

/* Legal pages override */

.kp-legal-body {
  font-family: var(--yp-font) !important;
  background: var(--yp-bg) !important;
}

.kp-nav {
  background: rgba(26, 26, 46, 0.95) !important;
  border-bottom-color: var(--yp-border) !important;
}

.kp-legal-article .text-white-75,
.kp-legal-article ul li {
  color: var(--yp-text-muted) !important;
}

.kp-legal-article h1,
.kp-legal-article h2 {
  color: #fff !important;
}

.text-primary {
  color: var(--yp-accent) !important;
}

/* Responsive */

@media (max-width: 768px) {
  .yp-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--yp-bg);
    border-bottom: 1px solid var(--yp-border);
  }

  .yp-header.is-open .yp-nav {
    display: flex;
  }

  .yp-nav__link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--yp-border);
  }

  .yp-header__inner > .yp-btn--accent {
    display: none;
  }

  .yp-menu-toggle {
    display: flex;
    margin-left: auto;
  }

  .yp-header__inner {
    position: relative;
    flex-wrap: wrap;
  }

  .yp-games {
    grid-template-columns: 1fr;
  }

  .yp-edut {
    grid-template-columns: 1fr;
  }

  .yp-container {
    width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  .yp-agegate__actions {
    flex-direction: column;
  }

  .yp-agegate__actions .yp-btn {
    width: 100%;
  }
}
