/* =============================================
   Triliza.net — shared styles for server-rendered
   guides, info pages, 404 and the site footer.
   Extends /style.css (tokens, fonts, cookie banner).
   ============================================= */

/* ── Game guides (under every game) ── */
.game-guide {
  width: 100%;
  max-width: 680px;
  margin: 36px auto 0;
  padding: 26px 22px 8px;
  text-align: left;
  color: #cbd5e1;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r);
  position: relative;
  z-index: 1;
}
.game-guide h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.3;
}
.game-guide h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--acc2);
  margin: 22px 0 8px;
}
.game-guide p,
.game-guide li {
  font-size: .92rem;
  line-height: 1.75;
}
.game-guide p { margin: 0 0 14px; }
.game-guide ul,
.game-guide ol { margin: 0 0 16px; padding-left: 1.3rem; }
.game-guide li { margin-bottom: 6px; }
.game-guide strong { color: var(--text); font-weight: 600; }
.game-guide em { color: var(--o); font-style: normal; }
.game-guide a {
  color: var(--acc2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.game-guide a:hover { color: var(--text); }
.screen .game-guide { max-width: 640px; }

@media (max-width: 480px) {
  .game-guide { padding: 20px 16px 4px; margin-top: 28px; }
  .game-guide h2 { font-size: 1.08rem; }
}

/* ── Footer ── */
.footer-cols {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 720px;
  margin-bottom: 10px;
  text-align: left;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 170px;
}
.footer-h {
  font-family: 'Syne', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.footer-col a,
.footer-linkbtn {
  font-size: .86rem;
  color: var(--dim);
  text-decoration: none;
  transition: color var(--t);
}
.footer-col a:hover,
.footer-linkbtn:hover { color: var(--text); }
.footer-linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.footer-tagline {
  font-size: .8rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}
@media (max-width: 480px) {
  .footer-cols { gap: 28px; justify-content: flex-start; padding: 0 8px; }
  .footer-col { min-width: 140px; }
}

/* ── Content pages (blog, info, 404) ── */
body.content-page { min-height: 100vh; display: flex; flex-direction: column; }
body.content-page main { flex: 1 0 auto; width: 100%; }

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: var(--text);
  margin-bottom: .75rem;
}

.header-lang {
  font-size: .8rem;
  font-weight: 600;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--glass);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t), border-color var(--t);
}
.header-lang:hover { color: var(--text); border-color: var(--border2); }
.header-lang-spacer { width: 1px; flex-shrink: 0; }

.breadcrumbs {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumbs a { color: var(--dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--acc2); }
.breadcrumbs span:last-child {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: .92rem;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border2);
  padding: .5rem .7rem;
  text-align: left;
  color: #cbd5e1;
}
.post-content th { color: var(--text); background: var(--glass-h); }
.post-content blockquote {
  border-left: 3px solid var(--acc2);
  padding: .25rem 0 .25rem 1rem;
  margin: 0 0 1.25rem;
  color: var(--dim);
}

.related-posts {
  margin-top: 2.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.related-posts h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .75rem;
}
.related-posts ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.related-posts a { color: var(--dim); text-decoration: none; font-size: .92rem; }
.related-posts a:hover { color: var(--acc2); }

.info-page .post-header { margin-bottom: 1.25rem; }
.page-updated { font-size: .8rem; color: var(--muted) !important; }
.contact-email { font-size: 1.15rem; margin: .5rem 0 1rem; }
.contact-email a {
  display: inline-block;
  padding: .6rem 1.1rem;
  border: 1px solid rgba(168, 85, 247, .4);
  border-radius: 12px;
  text-decoration: none !important;
  background: rgba(124, 58, 237, .08);
}
.inline-linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--acc2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.notfound { text-align: center; }
.notfound .post-footer { justify-content: center; }
.notfound-links {
  list-style: none;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}
.notfound-links a {
  display: inline-block;
  padding: .45rem .9rem;
  border: 1px solid var(--border2);
  border-radius: 100px;
  text-decoration: none !important;
  color: var(--text) !important;
  background: var(--glass);
}

/* ── Ad slots (empty until a unit id is configured) ── */
.ad-slot { width: 100%; max-width: 728px; margin: 0 auto; }
.ad-slot:empty { display: none; }
.ad-slot.ad-slot-on { margin: 20px auto; min-height: 90px; text-align: center; position: relative; z-index: 1; }

/* ── Language menu (content pages) and footer language links ── */
.lang-menu { position: relative; flex-shrink: 0; }
.lang-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu[open] > summary { color: var(--text); border-color: var(--border2); }
.lang-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.lang-menu-list a,
.lang-menu-list .lang-current {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
}
.lang-menu-list a:hover,
.lang-menu-list a:focus-visible { background: var(--glass-h); color: var(--text); }
.lang-menu-list .lang-current { color: var(--text); font-weight: 600; }

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  max-width: 720px;
  font-size: .8rem;
}
.footer-langs a { color: var(--muted); text-decoration: none; transition: color var(--t); }
.footer-langs a:hover { color: var(--text); }
.footer-lang-current { color: var(--dim); font-weight: 600; }

/* =============================================
   Score cards, nickname form and leaderboard
   (public/score-card.js)
   ============================================= */

/* Result cards grow a score block and a form; keep them inside the screen. */
.result-card, .gm-result-card, .kremala-result-card, .st-result-card, .kids-result-card, .sol-result, .snk-result {
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.sc-res-wrap { margin: 14px 0 4px; }
.sc-res {
  text-align: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
}
.sc-res-win {
  background: linear-gradient(135deg, rgba(251, 191, 36, .12), rgba(168, 85, 247, .10));
  border-color: rgba(251, 191, 36, .28);
}
.sc-res .sc-res-pts {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  color: #fbbf24;
  background: linear-gradient(135deg, #fef3c7, #fbbf24 45%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: scPop .55s cubic-bezier(.2, 1.5, .4, 1);
}
.sc-res:not(.sc-res-win) .sc-res-pts { -webkit-text-fill-color: #64748b; animation: none; }
.sc-res .sc-res-pts span {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  -webkit-text-fill-color: #fbbf24;
  vertical-align: middle;
}
.sc-res:not(.sc-res-win) .sc-res-pts span { -webkit-text-fill-color: #64748b; }
.sc-res .sc-pending { opacity: .8; }
.sc-res-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.sc-res-meta span {
  font-size: .76rem;
  font-weight: 600;
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}
.sc-res .sc-res-note { font-size: .8rem; color: #94a3b8; margin: 8px 0 0; line-height: 1.45; }
.sc-res .sc-res-ok { font-size: .82rem; color: #86efac; margin: 10px 0 0; font-weight: 600; }
@keyframes scPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ── Nickname form ── */
.sc-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, .14); text-align: left; }
.lb-me .sc-form, .sc-panel-form .sc-form { border-top: 0; padding-top: 0; }
.sc-form .sc-form-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: .98rem; color: #f1f5f9; margin: 0 0 2px; }
.sc-form .sc-form-text { font-size: .8rem; color: #94a3b8; margin: 0 0 10px; line-height: 1.45; }
.sc-form-row { display: flex; gap: 8px; }
.sc-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #f1f5f9;
  font: 600 .95rem 'DM Sans', system-ui, sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sc-input::placeholder { color: #64748b; font-weight: 500; }
.sc-input:focus { outline: none; border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .2); }
.sc-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1c1403;
  font: 700 .88rem 'DM Sans', system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}
.sc-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sc-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.sc-btn-ghost { background: transparent; color: #cbd5e1; border: 1px solid rgba(255, 255, 255, .16); }
.sc-form .sc-form-msg { font-size: .78rem; margin: 6px 0 0; color: #94a3b8; }
.sc-form .sc-form-msg:empty { display: none; }
.sc-form .sc-form-msg.err { color: #fda4af; }
.sc-form .sc-form-note { font-size: .7rem; color: #64748b; margin: 6px 0 0; line-height: 1.4; }

/* ── Score panel under each game ── */
.sc-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 20px auto 0;
  padding: 16px;
  text-align: left;
  color: #f1f5f9;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
}
.sc-panel:empty { display: none; }
.sc-panel-head { display: flex; align-items: center; gap: 12px; }
.sc-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 800 1.1rem 'Syne', sans-serif;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 260) 85% 62%), hsl(calc(var(--h, 260) + 50) 80% 46%));
  box-shadow: 0 4px 14px hsla(var(--h, 260), 80%, 50%, .35);
}
.sc-avatar-guest { background: rgba(255, 255, 255, .06); color: #94a3b8; box-shadow: none; border: 1px dashed rgba(255, 255, 255, .25); }
.sc-panel-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sc-panel-kicker { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; }
.sc-panel-name { font: 800 1.05rem 'Syne', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-badge {
  font: 800 .9rem 'Syne', sans-serif;
  color: #1c1403;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
}
.sc-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer;
  font-size: .95rem;
}
.sc-icon-btn:hover { background: rgba(255, 255, 255, .12); }
.sc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.lb-me .sc-tiles { grid-template-columns: repeat(4, 1fr); }
.sc-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px;
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .07);
}
.sc-tile-val { font: 800 1.2rem 'Syne', sans-serif; color: #f1f5f9; }
.sc-hash { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 700; opacity: .7; margin-right: 1px; }
.sc-tile-lbl { font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.sc-panel-form:not(:empty) { margin-top: 12px; }
.sc-guest { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.sc-guest p { flex: 1 1 220px; margin: 0; font-size: .8rem; color: #94a3b8; line-height: 1.45; }
.sc-panel-top { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sc-link { display: inline-block; margin-top: 8px; font-size: .82rem; font-weight: 600; color: #fbbf24; text-decoration: none; }
.sc-link:hover { text-decoration: underline; }
.sc-panel-kids { max-width: 360px; }
.sc-kids { display: flex; align-items: center; justify-content: center; gap: 12px; }
.sc-kids-stars { font-size: 2rem; }
.sc-kids p { margin: 2px 0 0; font-size: .78rem; color: #94a3b8; }

/* ── Homepage leaderboard ── */
.lb-section { position: relative; z-index: 1; max-width: 640px; width: 100%; margin-top: 44px; padding: 0 8px; }
.lb-title {
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  margin: 0;
}
.lb-sub { text-align: center; font-size: .88rem; color: var(--dim); margin: 8px 0 16px; line-height: 1.5; }
.lb-me {
  margin-bottom: 12px;
  padding: 16px;
  text-align: left;
  background: linear-gradient(135deg, rgba(124, 58, 237, .14), rgba(76, 201, 240, .06));
  border: 1px solid rgba(168, 85, 247, .28);
  border-radius: var(--r);
}
.lb-me:empty { display: none; }
.lb-card { padding: 14px; background: var(--glass); border: 1px solid var(--border); border-radius: var(--r); }
.lb-period { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.lb-tab {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: 600 .82rem 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lb-tab.active { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.lb-games { display: flex; gap: 6px; overflow-x: auto; margin: 12px -14px 4px; padding: 0 14px 4px; scrollbar-width: none; }
.lb-games::-webkit-scrollbar { display: none; }
/* Wide screens have no swipe hint for a hidden scrollbar: let the chips wrap. */
@media (min-width: 600px) {
  .lb-games { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }
}
.lb-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--dim);
  font: 600 .78rem 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: all .2s ease;
}
.lb-chip:hover { color: var(--text); }
.lb-chip.active { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .5); color: #fde68a; }
.lb-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; transition: opacity .2s ease; }
.lb-loading { opacity: .5; }
.lb-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
}
.lb-rank { font: 800 .95rem 'Syne', sans-serif; color: var(--dim, #94a3b8); text-align: center; }
.lb-top .lb-rank { font-size: 1.2rem; }
.lb-top-1 { background: linear-gradient(90deg, rgba(251, 191, 36, .18), rgba(251, 191, 36, .03)); border-color: rgba(251, 191, 36, .32); }
.lb-top-2 { background: linear-gradient(90deg, rgba(203, 213, 225, .13), rgba(203, 213, 225, .02)); border-color: rgba(203, 213, 225, .22); }
.lb-top-3 { background: linear-gradient(90deg, rgba(217, 119, 6, .16), rgba(217, 119, 6, .02)); border-color: rgba(217, 119, 6, .28); }
.lb-name { font-weight: 600; color: var(--text, #f1f5f9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font-style: normal; font-size: .76rem; color: #fbbf24; }
.lb-wins { font-size: .75rem; color: var(--muted, #64748b); white-space: nowrap; }
.lb-pts { font-size: .75rem; color: var(--dim, #94a3b8); text-align: right; white-space: nowrap; }
.lb-pts strong { font: 800 1rem 'Syne', sans-serif; color: var(--text, #f1f5f9); }
.lb-me-row { box-shadow: inset 0 0 0 2px rgba(168, 85, 247, .6); }
.lb-empty {
  padding: 18px 16px;
  text-align: center;
  font-size: .85rem;
  color: var(--muted, #64748b);
  border: 1px dashed var(--border2, rgba(255, 255, 255, .16));
  border-radius: 12px;
}
.lb-list-compact { margin-top: 8px; }
.lb-list-compact .lb-row { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 6px 10px; }
.lb-list-compact .lb-empty { padding: 10px; font-size: .8rem; }
.lb-how { margin-top: 10px; font-size: .82rem; color: var(--dim); }
.lb-how summary { cursor: pointer; font-weight: 600; padding: 6px 2px; }
.lb-how ul { margin: 6px 0 0 18px; line-height: 1.65; color: #cbd5e1; }

@media (max-width: 480px) {
  .lb-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .lb-row .lb-wins { display: none; }
  .lb-me .sc-tiles { grid-template-columns: repeat(2, 1fr); }
  .sc-form-row { flex-wrap: wrap; }
  .sc-form-row .sc-input { flex-basis: 100%; }
  .sc-form-row .sc-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-res .sc-res-pts { animation: none; }
}
