/* KEREPEK — Midnight Blue v1.0
   Works with semantic HTML (header, main, section, table, details, footer)
   and common class selectors. If your site's selectors differ, map them accordingly.
*/
:root {
  color-scheme: dark;
  --kp-bg: #0B1220;
  --kp-surface: #152235;
  --kp-surface-hover: #1B2B40;
  --kp-elevated: #111D2E;
  --kp-border: #263B51;
  --kp-text: #F2F7FF;
  --kp-muted: #A6B5C7;
  --kp-accent: #32D5E8;
  --kp-accent-hover: #7AE9F3;
  --kp-max-width: 1120px;
  --kp-radius: 12px;
  --kp-shadow: 0 12px 28px rgba(0, 0, 0, .13);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--kp-bg);
  color: var(--kp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--kp-accent); color: var(--kp-bg); }
a { color: var(--kp-accent); text-underline-offset: .2em; }
a:hover { color: var(--kp-accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--kp-accent); outline-offset: 4px;
}
img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
/* General layout: one main reading column; category cards form a responsive grid. */
:where(main, .site-main, .container, .page-container, .content-wrapper) {
  width: min(calc(100% - 48px), var(--kp-max-width));
  margin-inline: auto;
}
/* Avoid nesting a second width-limited container inside main. */
main :where(.container, .page-container, .content-wrapper) { width: 100%; }
main { padding-block: 64px 84px; }
main > section + section, .site-main > section + section { margin-top: 56px; }
h1, h2, h3, h4 { color: var(--kp-text); line-height: 1.25; letter-spacing: -.025em; }
h1 { margin: 0 0 18px; font-size: clamp(2.2rem, 4.5vw, 3.7rem); font-weight: 800; }
h2 { margin: 0 0 22px; font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 750; }
h3 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
small { color: var(--kp-muted); }
/* Hero: covers top-level h1 + lead paragraph, with or without a section wrapper. */
:where(main, .site-main) > h1:first-child,
:where(.hero, .intro, .hero-section) h1 { max-width: 920px; }
:where(main, .site-main) > h1:first-child + p,
:where(.hero, .intro, .hero-section) > p {
  max-width: 760px;
  color: var(--kp-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}
:where(.hero, .intro, .hero-section) { padding-block: 12px 24px; }
/* Genres: match existing card containers where possible. */
:where(.genre-grid, .genres-grid, .cards-grid, .card-grid, .game-grid, .genres, .cards) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
:where(.genre-card, .game-card, .genre-grid > *, .genres-grid > *, .cards-grid > *, .card-grid > *, .game-grid > *, .genres > *, .cards > *) {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--kp-border);
  border-radius: var(--kp-radius);
  background: var(--kp-surface);
  box-shadow: var(--kp-shadow);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
:where(.genre-card, .game-card, .genre-grid > *, .genres-grid > *, .cards-grid > *, .card-grid > *, .game-grid > *, .genres > *, .cards > *):hover {
  background: var(--kp-surface-hover);
  border-color: #35637A;
  transform: translateY(-2px);
}
:where(.genre-card, .game-card, .genre-grid > *, .genres-grid > *, .cards-grid > *, .card-grid > *, .game-grid > *, .genres > *, .cards > *) :where(h3, h4, strong) { color: var(--kp-text); }
:where(.genre-card, .game-card, .genre-grid > *, .genres-grid > *, .cards-grid > *, .card-grid > *, .game-grid > *, .genres > *, .cards > *) p { color: var(--kp-muted); }
/* Tables: if too wide, wrap in .table-scroll; at small widths native tables remain horizontally scrollable. */
.table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--kp-radius); border: 1px solid var(--kp-border); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--kp-surface); border: 1px solid var(--kp-border); border-radius: var(--kp-radius); overflow: hidden; }
.table-scroll table { border: 0; border-radius: 0; }
th, td { padding: 15px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--kp-border); }
th { color: var(--kp-text); background: var(--kp-elevated); font-size: .92rem; font-weight: 700; }
td { color: var(--kp-muted); }
tr:last-child > :is(td, th) { border-bottom: 0; }
tbody tr:hover { background: rgba(50, 213, 232, .045); }
/* Tips and regular lists. */
ul, ol { padding-left: 1.5rem; margin: 0 0 20px; }
li { padding-left: 3px; margin-bottom: 8px; }
li::marker { color: var(--kp-accent); }
:where(.tips, .play-tips, .tips-section) { padding: 26px 30px; background: var(--kp-elevated); border: 1px solid var(--kp-border); border-radius: var(--kp-radius); }
:where(.tips, .play-tips, .tips-section) ul { margin-bottom: 0; }
/* Native accessible FAQ accordion (details/summary). */
:where(.faq, .faq-section, #faq) details,
main > details { margin: 0 0 10px; border: 1px solid var(--kp-border); background: var(--kp-surface); border-radius: var(--kp-radius); overflow: hidden; }
:where(.faq, .faq-section, #faq) summary,
main > details > summary { padding: 16px 20px; color: var(--kp-text); font-weight: 650; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
:where(.faq, .faq-section, #faq) summary::-webkit-details-marker,
main > details > summary::-webkit-details-marker { display: none; }
:where(.faq, .faq-section, #faq) summary::after,
main > details > summary::after { content: '+'; color: var(--kp-accent); font-size: 1.45rem; line-height: 1; font-weight: 400; }
:where(.faq, .faq-section, #faq) details[open] > summary::after,
main > details[open] > summary::after { content: '−'; }
:where(.faq, .faq-section, #faq) details[open] > summary,
main > details[open] > summary { border-bottom: 1px solid var(--kp-border); }
:where(.faq, .faq-section, #faq) details > :not(summary),
main > details > :not(summary) { margin: 0; padding: 16px 20px 20px; color: var(--kp-muted); }
/* Footer */
footer, .site-footer { background: #090F1B; border-top: 1px solid var(--kp-border); color: var(--kp-muted); padding: 36px max(24px, calc((100vw - var(--kp-max-width)) / 2)); font-size: .9rem; }
footer p, .site-footer p { max-width: 760px; }
footer a, .site-footer a { color: var(--kp-accent); }
/* optional buttons and UI */
:where(.button, .btn, button[type="submit"]) { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border: 1px solid var(--kp-accent); background: var(--kp-accent); color: #061522; border-radius: 9px; padding: 10px 18px; font-weight: 700; text-decoration: none; cursor: pointer; }
:where(.button, .btn, button[type="submit"]):hover { background: var(--kp-accent-hover); border-color: var(--kp-accent-hover); color: #061522; }
@media (max-width: 900px) {
  :where(.genre-grid, .genres-grid, .cards-grid, .card-grid, .game-grid, .genres, .cards) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding-block: 48px 64px; }
}
@media (max-width: 600px) {
  :where(main, .site-main, .container, .page-container, .content-wrapper) { width: min(calc(100% - 32px), var(--kp-max-width)); }
  main :where(.container, .page-container, .content-wrapper) { width: 100%; }
  main { padding-block: 36px 56px; }
  main > section + section, .site-main > section + section { margin-top: 40px; }
  h1 { font-size: clamp(2rem, 8vw, 2.5rem); }
  h2 { font-size: 1.4rem; }
  :where(.genre-grid, .genres-grid, .cards-grid, .card-grid, .game-grid, .genres, .cards) { grid-template-columns: 1fr; gap: 12px; }
  :where(.genre-card, .game-card, .genre-grid > *, .genres-grid > *, .cards-grid > *, .card-grid > *, .game-grid > *, .genres > *, .cards > *) { padding: 20px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table { min-width: 560px; }
  table:not(.table-scroll table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 12px 14px; }
  :where(.tips, .play-tips, .tips-section) { padding: 20px; }
  :where(.faq, .faq-section, #faq) summary, main > details > summary { padding: 15px 16px; }
  footer, .site-footer { padding: 28px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Header and language switcher (not covered by the base theme) */
.wrap { width: min(calc(100% - 48px), var(--kp-max-width)); margin-inline: auto; }
.site-header { background: var(--kp-elevated); border-bottom: 1px solid var(--kp-border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.site-header img { height: 28px; display: block; }
.lang { font-weight: 600; color: var(--kp-muted); }
.lang a { color: var(--kp-muted); text-decoration: none; }
.lang a.on, .lang a:hover { color: var(--kp-accent); }
main.wrap, .site-footer .wrap { width: min(calc(100% - 48px), var(--kp-max-width)); }
.site-footer .wrap { width: 100%; }
@media (max-width: 600px) { .wrap, main.wrap { width: min(calc(100% - 32px), var(--kp-max-width)); } }

/* Header menu and footer links */
.site-nav { border-top: 1px solid var(--kp-border); }
.site-nav .wrap { display: flex; flex-wrap: wrap; gap: 4px 22px; padding-block: 10px; }
.site-nav a { color: var(--kp-muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover { color: var(--kp-accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { text-decoration: none; }
a.genre-card { display: block; color: inherit; }

/* Vertical rhythm: more space above headings and after blocks */
main h2 { margin-top: 56px; }
main > .hero + h2, main > h2:first-child { margin-top: 40px; }
main > table, main > .table-scroll, main > .card-grid, main > .faq, main > ul, main > ol { margin-bottom: 40px; }
main > table:last-child, main > .card-grid:last-child, main > .faq:last-child { margin-bottom: 0; }
main > p + table, main > p + .table-scroll { margin-top: 16px; }
@media (max-width: 600px) { main h2 { margin-top: 44px; } main > table, main > .table-scroll, main > .card-grid, main > .faq { margin-bottom: 32px; } }
