/* ==========================================================================
   Lourez Games — Scratch-website look: light-yellow page, white rounded
   panels with plain headings, a flat top bar with search, and project tiles.
   Colours follow the yellow-hat channel logo (orange / yellow / black / white).
   ========================================================================== */

:root {
  --black: #111;
  --ink: #3d3a33;          /* main text — warm dark grey, like Scratch's #575e75 */
  --muted: #7a7466;
  --white: #fff;
  --paper: #fff;
  --page: #fff8d6;         /* light-yellow page background */
  --line: #e6dcb8;         /* panel borders */
  --line-dark: #cfc29a;
  --panel-head: #fffbea;   /* panel title strip */

  --orange: #ff8a00;
  --orange-dark: #d86a00;
  --orange-deep: #a34f00;
  --yellow: #ffcc00;
  --yellow-light: #ffe873;
  --yellow-pale: #fff6cc;

  --link: #c25e00;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Luckiest Guy", "Arial Black", Impact, sans-serif;

  --radius: 8px;
  --side: 172px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 0.8em; }

.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 100;
  background: var(--yellow); color: var(--black); padding: 6px 10px; font-weight: bold;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Page frame — fills the browser window
   -------------------------------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}
.layout { flex: 1; }

/* --------------------------------------------------------------------------
   Ads
   -------------------------------------------------------------------------- */
.ad-slot {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  background: repeating-linear-gradient(-45deg, #fbf3d2 0 8px, #f6ecc3 8px 16px);
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  color: var(--muted);
  overflow: hidden;
}
.ad-slot::after {
  content: "Ad space";
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.ad-slot.is-live { background: none; border: 0; }
.ad-slot.is-live::after { content: none; }
.ad-slot:not(.is-live) ins { display: none !important; }
.ad-label {
  position: absolute; top: 2px; left: 8px;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: #a89f86;
}

/* Black strip across the top that holds the leaderboard ad */
.ad-strip { background: var(--black); padding: 8px 0; }
.ad-leaderboard { width: 728px; max-width: calc(100% - 16px); height: 90px; margin: 0 auto; border-color: #444; }
.ad-strip .ad-slot:not(.is-live) { background: repeating-linear-gradient(-45deg, #1c1c1c 0 8px, #242424 8px 16px); color: #777; }
.ad-skyscraper { width: 160px; height: 600px; margin-top: 12px; }
.ad-banner { width: 100%; min-height: 90px; margin: 0 0 16px; }

/* --------------------------------------------------------------------------
   Masthead (logo strip)
   -------------------------------------------------------------------------- */
.masthead {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
/* The hat is transparent, so it sits on an orange disc like the channel icon. */
.brand-logo {
  width: 80px; height: 80px; padding: 8px; border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle at 40% 35%, #ffb24d, var(--orange) 60%, var(--orange-dark));
  border: 3px solid var(--black);
  box-shadow: 0 0 0 3px var(--yellow);
}
.brand-word {
  font-family: "Fredoka", var(--font);
  font-weight: 700;
  font-size: 44px; line-height: 1;
  letter-spacing: 0.02em;
  color: var(--yellow);
  white-space: nowrap;
  /* Thick black outline drawn behind the letters */
  -webkit-text-stroke: 8px var(--black);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--black);
}
.brand-word span { color: var(--white); }

.tagline {
  margin: 0 0 0 auto;
  color: var(--black);
  font-size: 18px; font-weight: bold; font-style: italic;
}
.tagline strong { color: var(--orange-dark); }

/* --------------------------------------------------------------------------
   Buttons — flat and rounded, like Scratch
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  font: bold 14px var(--font);
  color: var(--black);
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.1s, transform 0.06s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-yellow { background: var(--yellow); color: var(--black); }
.btn-orange { background: var(--orange); color: var(--white); }
.btn-orange:hover { color: var(--white); }
.btn-gray { background: #ece6d2; color: var(--ink); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   Top bar — flat orange, bold white links, search box (Scratch-style)
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px;
  min-height: 50px;
  background: var(--orange);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.nav-links { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block;
  padding: 0 14px;
  line-height: 50px;
  color: var(--white); font-weight: bold; font-size: 15px;
}
.nav-links a:hover { background: rgba(0, 0, 0, 0.12); text-decoration: none; }
.nav-links a[aria-current="page"] { background: rgba(0, 0, 0, 0.18); }

/* Search box in the top bar */
.nav-search { flex: 1; max-width: 360px; margin: 0 8px; }
.nav-search input {
  width: 100%; height: 34px; padding: 0 12px 0 34px;
  font: 14px var(--font); color: var(--white);
  background: rgba(0, 0, 0, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") no-repeat 11px center;
  border: 0; border-radius: var(--radius);
}
.nav-search input::placeholder { color: rgba(255, 255, 255, 0.85); }
.nav-search input:focus { outline: 2px solid var(--white); background-color: rgba(0, 0, 0, 0.28); }

.nav-toggle { display: none; }

.auth-area { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--white); font-weight: bold; }
.auth-area .user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-area .btn-yellow { background: var(--white); color: var(--orange-dark); }

/* --------------------------------------------------------------------------
   3-column layout: member box + ad | content | ad
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--side);
  gap: 16px;
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 16px;
  align-items: start;
}
.side { display: flex; flex-direction: column; align-items: center; }
.side > .box { width: 100%; }
.content { min-width: 0; }

/* --------------------------------------------------------------------------
   Boxes — white rounded panels with a plain title strip (like "What's Happening?")
   -------------------------------------------------------------------------- */
.box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.box-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  font-size: 19px; font-weight: bold;
  color: var(--ink);
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
}
.box-head-note { margin-left: auto; font-size: 13px; font-weight: bold; color: var(--muted); }
.box-sub { margin: 10px 18px; color: var(--muted); }

/* ---- Member login box ---- */
.member-box { font-size: 12px; }
.member-box .box-head { font-size: 14px; padding: 8px 12px; }
.member-body { padding: 10px; }
.member-box label { display: block; font-weight: bold; margin-bottom: 8px; }
.member-box input {
  display: block; width: 100%; margin-top: 3px; padding: 6px 8px;
  font: 13px var(--font);
  border: 1px solid var(--line-dark); border-radius: 6px; background: var(--white);
}
.member-box .btn { margin-top: 4px; }
/* Turnstile "I'm human" check: compact (150px) in the sidebar, normal (300px) in the popup */
.captcha { margin: 6px 0 8px; min-height: 0; }
.member-box .captcha { display: flex; justify-content: center; overflow: hidden; }
.captcha-note { margin: 0; font-size: 11px; color: var(--muted); }
.member-box .member-links { margin: 8px 0 0; text-align: center; }
.member-box .member-links a { display: block; margin-top: 4px; }
.member-hello { text-align: center; }
.member-hello .avatar { margin: 0 auto 6px; }
.member-loonix { justify-content: center; margin-top: 4px; }
.member-hello strong { display: block; font-size: 14px; word-break: break-word; }
.member-msg { color: #b00020; margin: 6px 0 0; }

/* ---- Welcome panel ---- */
.welcome-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 16px 18px; }
.welcome-free { font-weight: bold; font-size: 16px; }
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; gap: 12px; margin-bottom: 14px; }
.feature-list strong { color: var(--ink); font-size: 15px; }
.feature-list p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.feature-icon {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 20px; color: var(--black);
  background: var(--yellow);
}

.featured {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink);
}
.featured:hover { text-decoration: none; border-color: var(--orange); }
.featured-title {
  padding: 10px 12px;
  font-family: "Fredoka", var(--font); font-weight: 700; font-size: 20px; line-height: 1; white-space: nowrap;
  color: var(--ink); letter-spacing: 0.02em;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
}
.featured-thumb { display: block; aspect-ratio: 4 / 3; background: #222; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured-cta {
  margin: 10px; padding: 9px;
  text-align: center; font-weight: bold; font-size: 15px; color: var(--white);
  background: var(--orange);
  border-radius: var(--radius);
}
.featured:hover .featured-cta { filter: brightness(1.07); }

/* ---- Game grid — Scratch project tiles ---- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px 16px;
  padding: 4px 18px 20px;
}
.game-card {
  display: flex; flex-direction: column;
  color: var(--ink);
}
.game-card:hover { text-decoration: none; }
.game-card[hidden] { display: none; }
.game-grid .empty { grid-column: 1 / -1; padding: 10px 0; }
.game-card-thumb {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: #222;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  transition: box-shadow 0.12s, transform 0.12s;
}
.game-card:hover .game-card-thumb { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-badge {
  position: absolute; right: 6px; bottom: 6px;
  padding: 2px 8px; font-size: 11px; font-weight: bold;
  background: var(--yellow); color: var(--black); border-radius: 4px;
  opacity: 0; transition: opacity 0.1s;
}
.game-card:hover .play-badge { opacity: 1; }
.game-card-body { padding: 6px 2px 0; }
.game-card-body h3 { font-size: 14px; font-weight: bold; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card:hover .game-card-body h3 { color: var(--link); }
.game-card-body p { margin: 1px 0 3px; font-size: 12px; font-weight: bold; color: var(--muted); }
.game-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.game-stats .stat-like { color: var(--orange-dark); }

.empty { padding: 10px 18px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Game page
   -------------------------------------------------------------------------- */
.breadcrumb { margin: 0 0 10px; font-size: 13px; font-weight: bold; }

.player { padding: 16px; }
.game-frame-wrap {
  position: relative;
  aspect-ratio: var(--aspect, 4 / 3);
  max-height: 72vh;
  margin: 0 auto;
  background: var(--black);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.game-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-frame-wrap:fullscreen { max-height: none; border: 0; border-radius: 0; }
.game-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--yellow); font-weight: bold; }

.player-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.player-spacer { flex: 1; }
.view-count { font-weight: bold; color: var(--muted); }

.like-btn { font-size: 14px; background: #ece6d2; }
.like-heart { color: var(--orange-dark); font-size: 16px; }
.like-count {
  min-width: 24px; padding: 0 6px; margin-left: 4px;
  background: var(--white); color: var(--ink); border-radius: 4px; font-size: 12px;
}
.like-btn[aria-pressed="true"] { background: var(--orange); color: var(--white); }
.like-btn[aria-pressed="true"] .like-heart { color: var(--white); }

.game-info { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; padding: 16px 18px; }
.game-meta {
  align-self: start;
  padding: 10px 12px;
  background: var(--yellow-pale);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.game-meta strong { display: block; margin-bottom: 2px; }

/* ---- Comments ---- */
.comment-form { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.comment-form textarea {
  display: block; width: 100%; min-height: 80px; resize: vertical;
  padding: 10px; margin-bottom: 8px;
  font: 14px var(--font);
  border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--white);
}
.comment-form-row { display: flex; align-items: center; gap: 8px; }
.comment-form-row small { color: var(--muted); margin-right: auto; }
.comments-locked { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--yellow-pale); }
.comments-locked p { margin: 0 0 8px; }

.comment-list { list-style: none; margin: 0; padding: 6px 0; }
.comment { display: flex; gap: 12px; padding: 12px 18px; }
.comment + .comment { border-top: 1px solid #f1ead2; }
.comment-avatar { flex: none; }
.comment-main { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment-head strong { color: var(--link); }
.comment-head time { font-size: 12px; color: var(--muted); }
.comment-text {
  margin: 4px 0 0; padding: 8px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: #fdf9ea; border: 1px solid #f1ead2; border-radius: var(--radius);
}
.comment-delete {
  margin-left: auto; padding: 0; border: 0; background: none;
  font: 12px var(--font); color: #b00020; cursor: pointer; text-decoration: underline;
}
.comment-empty { padding: 12px 18px; color: var(--muted); }

/* ---- More games ---- */
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 16px 18px; }
.mini-card { display: block; font-size: 13px; font-weight: bold; color: var(--ink); }
.mini-card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border: 1px solid var(--line-dark); border-radius: 4px; margin-bottom: 5px; }
.mini-card:hover { color: var(--link); text-decoration: none; }

.not-found { padding: 24px; text-align: center; }
.not-found h1 { margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   Avatars — a hat PNG with an optional band PNG stacked on top
   -------------------------------------------------------------------------- */
.avatar {
  position: relative; display: inline-block; flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a3a3a, var(--black) 70%);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--line-dark);
  overflow: hidden;
}
.avatar img { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; }
.avatar-xs { width: 30px; height: 30px; box-shadow: none; }
.avatar-sm { width: 44px; height: 44px; }
.avatar-md { width: 72px; height: 72px; }
.avatar-lg { width: 120px; height: 120px; }
.avatar-xl { width: 160px; height: 160px; border-width: 3px; box-shadow: 0 0 0 4px var(--orange); }

/* --------------------------------------------------------------------------
   Loonix
   -------------------------------------------------------------------------- */
.loonix { display: inline-flex; align-items: center; gap: 4px; font-weight: bold; }
.loonix-icon { width: 24px; height: auto; flex: none; }
.loonix-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px 3px 6px;
  background: rgba(0, 0, 0, 0.18); color: var(--white);
  border-radius: 999px;
  font-size: 14px;
}
.loonix-pill:hover { background: rgba(0, 0, 0, 0.28); text-decoration: none; }
.loonix-big { font-size: 28px; gap: 8px; }
.loonix-big .loonix-icon { width: 48px; }

/* --------------------------------------------------------------------------
   Shop
   -------------------------------------------------------------------------- */
.shop-top { display: flex; align-items: center; gap: 24px; padding: 18px; }
.shop-wallet h2 { font-size: 20px; margin-bottom: 6px; }
.shop-next { margin: 8px 0 4px; font-weight: bold; }
.shop-equipped { color: var(--muted); font-size: 13px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 18px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.shop-item.is-worn { border-color: var(--orange); box-shadow: 0 0 0 2px var(--yellow); }
.shop-item-art { padding: 6px 0; }
.shop-item h3 { font-size: 14px; color: var(--ink); }
.shop-item-blurb { margin: 0; font-size: 12px; color: var(--muted); min-height: 2.6em; }
.shop-item-price { margin: 2px 0 6px; color: var(--orange-deep); }
.owned-tag { font-weight: bold; color: #1b7a2a; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about { display: flex; gap: 20px; padding: 18px; align-items: flex-start; }
.about-avatar { flex: none; width: 160px; height: 160px; padding: 16px; object-fit: contain; border-radius: 50%; background: var(--black); border: 4px solid var(--black); box-shadow: 0 0 0 4px var(--orange); }
.about h2 { font-size: 22px; margin-bottom: 8px; }
.about-facts { border-collapse: collapse; margin: 4px 0 14px; }
.about-facts th, .about-facts td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; }
.about-facts th { background: var(--yellow-pale); }

/* --------------------------------------------------------------------------
   Policy pages (privacy, terms, cookies, copyright)
   -------------------------------------------------------------------------- */
.legal { padding: 16px 20px 20px; max-width: 840px; font-size: 14px; line-height: 1.65; }
.legal h2 {
  margin: 22px 0 6px; padding-bottom: 4px;
  font-size: 16px; color: var(--ink);
  border-bottom: 2px solid var(--yellow);
}
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin-bottom: 5px; }
.legal-updated { color: var(--muted); font-size: 12px; font-style: italic; }
.legal code { font-size: 12px; background: var(--yellow-pale); padding: 0 4px; border: 1px solid #ecd98a; border-radius: 4px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 13px; }
.legal-table th, .legal-table td { padding: 7px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { background: var(--yellow-pale); }
@media (max-width: 720px) {
  .legal { padding: 14px; }
  .legal-table { display: block; overflow-x: auto; }
}

/* --------------------------------------------------------------------------
   Footer — light, like Scratch's
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 22px 16px 26px;
  text-align: center; font-size: 13px;
  color: var(--muted);
  background: #f7eec7;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--ink); font-weight: bold; }
.footer-fine { font-size: 12px; color: #a39a80; }

/* --------------------------------------------------------------------------
   Login / signup modal
   -------------------------------------------------------------------------- */
.modal {
  width: min(400px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.6), 0 12px 40px rgba(0, 0, 0, 0.4);
}
.modal::backdrop { background: rgba(60, 45, 0, 0.45); }
.modal .box-head { font-size: 18px; padding-right: 44px; background: var(--orange); color: var(--white); border-bottom: 0; }
.modal-close {
  position: absolute; top: 9px; right: 10px;
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.18); color: var(--white); font: bold 18px/1 var(--font); cursor: pointer;
}
.modal-body { padding: 16px 18px 20px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.auth-tab {
  flex: 1; padding: 8px; font: bold 14px var(--font); cursor: pointer;
  background: #ece6d2; color: var(--ink); border: 0; border-radius: var(--radius);
}
.auth-tab[aria-selected="true"] { background: var(--yellow); color: var(--black); }
.modal form label { display: block; margin-bottom: 12px; font-weight: bold; }
.modal form input {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  font: 14px var(--font); border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--white);
}
.modal form p { color: var(--muted); }
/* Terms + Privacy checkbox on the signup form */
.modal form label.agree { display: flex; align-items: flex-start; gap: 8px; font-weight: normal; font-size: 13px; }
.modal form label.agree input { width: auto; margin: 3px 0 0; flex: none; }
.modal form button:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-link { display: inline-block; margin-top: 10px; font-size: 13px; }
.auth-message { padding: 8px 10px; margin: 0 0 12px; border: 1px solid #b00020; border-radius: var(--radius); background: #ffe6ea; color: #7a0016; }
.auth-message[data-type="success"] { border-color: #1b7a2a; background: #e3f6e6; color: #10501b; }

/* --------------------------------------------------------------------------
   Cookie consent banner (bottom of the screen, first visit only)
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  max-width: 900px; margin: 0 auto; padding: 14px 18px;
  color: var(--white);
  background: #1e1b16;
  border: 2px solid var(--yellow);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.25s ease-out;
}
.cookie-text { margin: 0; flex: 1; font-size: 13px; line-height: 1.5; }
.cookie-text a { color: var(--yellow); font-weight: bold; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
.cookie-actions .btn { min-width: 84px; }
/* Leave room at the bottom so the banner never hides the end of the page */
body.has-cookie-banner { padding-bottom: 96px; }

@media (max-width: 720px) {
  .cookie-banner { left: 6px; right: 6px; bottom: 6px; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .cookie-text { font-size: 12px; }
  .cookie-actions .btn { flex: 1; }
  body.has-cookie-banner { padding-bottom: 150px; }
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; }
.toast {
  padding: 10px 16px; max-width: 320px;
  background: var(--ink); color: var(--white); font-weight: bold;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.4s, transform 0.4s;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  /* Drop the right skyscraper first; the left one stays with the member box. */
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .side-right { display: none; }
}

@media (max-width: 960px) {
  .nav-search { max-width: none; }
}

@media (max-width: 860px) {
  .welcome-body, .game-info { grid-template-columns: 1fr; }
  .tagline { display: none; }
  .brand-word { font-size: 34px; }
}

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .side-left { order: 2; }
  .ad-skyscraper { display: none; }
  .ad-leaderboard { height: 60px; }

  .masthead { padding: 8px 12px; gap: 10px; }
  .brand-logo { width: 56px; height: 56px; }
  .brand-word { font-size: 24px; -webkit-text-stroke-width: 5px; text-shadow: 2px 2px 0 var(--black); }

  .navbar { flex-wrap: wrap; padding: 6px 10px; gap: 8px; }
  .nav-toggle {
    display: inline-block; padding: 6px 10px;
    font: bold 14px var(--font); color: var(--white);
    background: rgba(0, 0, 0, 0.15); border: 0; border-radius: var(--radius); cursor: pointer;
  }
  .nav-search { order: 4; flex-basis: 100%; margin: 0; }
  .nav-links { display: none; width: 100%; order: 3; flex-direction: column; padding: 4px 0; }
  .navbar.is-open .nav-links { display: flex; }
  .nav-links a { line-height: 40px; padding: 0 8px; border-radius: 6px; }

  .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 4px 12px 16px; }
  .about, .shop-top { flex-direction: column; align-items: center; text-align: center; }
  .auth-area .user-name { display: none; }
  .about-facts { margin-inline: auto; }
}

@media (max-width: 480px) {
  .brand-word { font-size: 22px; -webkit-text-stroke-width: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
