/* Crowd Clash – style for the website pages (How to play, the guides: Units, Power-ups, Maps, Tips,
   Daily, FAQ, Updates, and About, Contact, Privacy, Terms, 404).
   The game itself (index.html) has its own style and does not use this file.
   Colours are the same as in the game. */
:root {
  --ink: #1b1430;          /* dark outline colour */
  --sky: #2c6aa0;          /* page background, top */
  --bg: #1d4f7a;           /* page background */
  --deep: #123a5e;         /* page background, bottom */
  --card-top: #3b6fa5;     /* big panels */
  --card-bot: #213f69;
  --slot: rgba(6, 14, 30, .34);
  --green: #35c759;
  --gold: #ffd24a;
  --orange: #ff9f0a;
  --red: #ff8a7d;
  --soft: #cfe3ff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--deep); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: #fff;
  font: 500 17px/1.6 var(--font);
  background: linear-gradient(180deg, var(--sky) 0, var(--bg) 360px, var(--deep) 100%);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
a { color: var(--gold); }
a:focus-visible, .btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 8px; }
img { max-width: 100%; }
b, strong { font-weight: 800; }
[hidden] { display: none !important; }   /* e.g. the "Privacy and cookie settings" link until Google says it is needed */

/* ---------- header: logo + Play now ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 980px; margin: 0 auto; padding: 14px 16px 6px; }
.logo { display: inline-flex; flex-wrap: wrap; gap: 0 .3em; font: 900 30px/1.15 var(--font); letter-spacing: .02em; text-decoration: none;
        filter: drop-shadow(0 .1em 0 var(--ink)) drop-shadow(0 .2em .25em rgba(0, 0, 0, .3)); }
.logo .w { position: relative; display: inline-block; }
.logo .w::before { content: attr(data-t); position: absolute; left: 0; top: 0; color: var(--ink); -webkit-text-stroke: .24em var(--ink); }
.logo .w span { position: relative; color: transparent; -webkit-background-clip: text; background-clip: text;
                background-image: linear-gradient(#fff8c4, #ffcc3d 50%, #ff9d1c); }
.logo .w.b span { background-image: linear-gradient(#ffe9a0, #ff8f1f 50%, #ef4a2a); }

/* ---------- chunky buttons (press down when tapped) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 48px; padding: .5em 1.05em; margin-bottom: 6px;
  color: #fff; text-decoration: none; white-space: nowrap;
  font: 900 18px/1.1 var(--font); letter-spacing: .02em;
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 2.5px 0 var(--ink);
  background: linear-gradient(#78e595, var(--green) 52%, #2aa94a);
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 5px 0 #1d7a36, 0 5px 0 3px var(--ink), 0 10px 14px rgba(0, 0, 0, .3);
  transition: transform .08s, box-shadow .08s;
}
.btn svg { width: .9em; height: .9em; fill: #fff; stroke: var(--ink); stroke-width: 2.4px; stroke-linejoin: round; overflow: visible; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 1px 0 #1d7a36, 0 1px 0 3px var(--ink), 0 3px 6px rgba(0, 0, 0, .3); }
.btn.big { font-size: 24px; min-height: 62px; padding: .55em 1.4em; border-radius: 20px; }
.btn.blue { background: linear-gradient(#7fb9ff, #2f8cff 52%, #2477dc);
            box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 5px 0 #1b4f9a, 0 5px 0 3px var(--ink), 0 10px 14px rgba(0, 0, 0, .3); }
.btn.blue:active { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 1px 0 #1b4f9a, 0 1px 0 3px var(--ink), 0 3px 6px rgba(0, 0, 0, .3); }

/* ---------- page content ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 8px 16px 8px; }
h1, h2 { font-weight: 900; line-height: 1.15; letter-spacing: .01em; }
h1 { margin: 18px 0 10px; font-size: 40px; color: var(--gold);
     text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 5px 0 var(--ink); }
h2 { margin: 0 0 12px; font-size: 25px;
     text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink); }
.lead { font-size: 19px; color: var(--soft); margin: 0 0 22px; }
.card {
  margin: 0 0 22px; padding: 20px 18px;
  background: linear-gradient(var(--card-top), var(--card-bot));
  border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .18), 0 7px 0 rgba(0, 0, 0, .2), 0 14px 26px rgba(0, 0, 0, .22);
}
.card > :last-child { margin-bottom: 0; }
.card p { margin: 0 0 12px; }
.note { font-size: 15px; color: var(--soft); }
.center { text-align: center; }
.green { color: #86f59c; font-weight: 800; }
.yellow { color: var(--gold); font-weight: 800; }
.red { color: var(--red); font-weight: 800; }
.cta { text-align: center; margin: 30px 0 34px; }

/* numbered steps and tick lists */
.steps, .ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps { counter-reset: n; }
.steps li, .ticks li { position: relative; padding: 10px 14px 10px 52px; background: var(--slot); border-radius: 14px; }
.steps li::before { counter-increment: n; content: counter(n); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px;
                    border: 2.5px solid var(--ink); border-radius: 50%; background: var(--gold); color: var(--ink);
                    font: 900 15px/23px var(--font); text-align: center; }
.ticks li::before { content: ""; position: absolute; left: 19px; top: 15px; width: 9px; height: 15px;
                    border: solid #86f59c; border-width: 0 4px 4px 0; transform: rotate(45deg); }

/* controls */
.rows { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rows li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 11px 14px; background: var(--slot); border-radius: 14px; }
.rows .k { flex: 0 0 150px; font-weight: 900; color: var(--gold); }
.rows .v { flex: 1 1 260px; }
kbd { display: inline-block; min-width: 1.75em; margin: 0 2px 4px; padding: 0 .4em; text-align: center;
      font: 900 .82em/1.65 var(--font); color: var(--ink); background: #fff;
      border: 2px solid var(--ink); border-radius: 7px; box-shadow: 0 3px 0 #b9c4d2, 0 3px 0 2px var(--ink); }

/* unit and power-up tiles */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
@media (min-width: 680px) { .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { margin: 0; padding: 14px 10px 12px; text-align: center; background: var(--slot); border-radius: 16px; }
.tile img { display: block; height: 84px; width: auto; margin: 0 auto 8px; object-fit: contain; }
.tile.orb img { height: 64px; margin: 10px auto 18px; }
.tile b { display: block; font-size: 19px; font-weight: 900; }
.tile span { display: block; font-size: 15px; line-height: 1.45; color: var(--soft); }
.badge { display: inline-block !important; margin: 4px 0 6px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 999px;
         background: var(--gold); color: var(--ink) !important; font: 900 13px/1.6 var(--font) !important; }

/* ---------- guide menu: the row of guide links under the header (How to play + guide pages) ---------- */
.guides { max-width: 760px; margin: 6px auto 0; padding: 0 16px; }
.guides ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 6px;
             list-style: none; background: var(--slot); border-radius: 18px; }
.guides a { display: block; padding: 5px 13px; border: 2px solid transparent; border-radius: 999px;
            color: #fff; font: 800 15px/1.35 var(--font); text-decoration: none; }
.guides a:hover { background: rgba(255, 255, 255, .13); }
.guides a[aria-current] { background: var(--gold); border-color: var(--ink); color: var(--ink); }
.guides a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- guide pages: smaller headings, tables, screenshots, number chips ---------- */
h3 { margin: 18px 0 8px; font: 900 20px/1.25 var(--font); color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.card h3:first-child { margin-top: 0; }
.steps + p, .ticks + p, .tbl + p, .shot + p, .ticks + .tbl, .steps + .shot, .rows + .shot, .rows + p { margin-top: 14px; }

/* a picture of a unit or power-up next to its name and numbers */
.who { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.who img { flex: none; width: auto; height: 78px; }
.who.orb img { height: 60px; margin: 0 9px; }
.who h2 { margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 0 10px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
            font: 900 14px/1.6 var(--font); }
.chips li.g { background: var(--gold); }

/* tables (they scroll sideways inside their box on very small phones, never the whole page) */
.tbl { margin: 0 0 12px; overflow-x: auto; background: var(--slot); border-radius: 14px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; vertical-align: top; }
.tbl thead th { color: var(--gold); font-size: 14px; font-weight: 900; letter-spacing: .02em; border-bottom: 2px solid rgba(255, 255, 255, .2); }
.tbl tbody tr + tr > * { border-top: 1px solid rgba(255, 255, 255, .1); }
.tbl tbody th { font-weight: 900; }
.tbl .n { text-align: right; }
.tbl td.n { white-space: nowrap; }
.tbl tfoot td, .tbl tfoot th { border-top: 2px solid rgba(255, 255, 255, .2); font-weight: 900; color: var(--gold); }
.tbl caption { padding: 10px 12px 2px; text-align: left; font-size: 15px; color: var(--soft); }

/* real screenshots from the game */
.shot { margin: 0 0 14px; }
.shot img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 16px;
            box-shadow: 0 5px 0 rgba(0, 0, 0, .22); background: var(--slot); }
.shot figcaption { margin-top: 8px; font-size: 15px; line-height: 1.45; color: var(--soft); }

/* "read more" link at the end of a card */
.more, .card .more { margin: 12px 0 0; font-weight: 800; }

/* Updates page: chips under a version heading, and a minus instead of a tick for things that were removed */
.card > h2 + .chips { margin: -4px 0 14px; }
.ticks.minus li::before { left: 18px; top: 22px; width: 16px; height: 4px; border: 0; border-radius: 2px;
                          background: var(--red); transform: none; }

/* legal pages */
.legal h2 { font-size: 22px; margin-top: 6px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; }
.legal li { margin: 0 0 6px; }
.updated { color: var(--soft); font-size: 15px; margin: -4px 0 18px; }
.summary { border-color: var(--ink); background: linear-gradient(#2f9a52, #1e6b3b); }

/* 404 page */
.lost { text-align: center; padding-top: 24px; }
.lost .num { display: block; margin: 18px 0 0; font: 900 96px/1 var(--font); color: var(--gold);
             text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 0 8px 0 var(--ink); }
.lost .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin: 26px 0 10px; }

/* ---------- footer ---------- */
.foot { max-width: 980px; margin: 0 auto; padding: 18px 16px 30px; text-align: center; color: var(--soft); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin-bottom: 6px; }
.foot nav a { display: inline-block; padding: 8px 10px; color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; }
.foot nav a:hover, .foot nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.foot p { margin: 0; }

/* small phones */
@media (max-width: 420px) {
  body { font-size: 16px; }
  .logo { font-size: 23px; }
  .top .btn { font-size: 16px; padding: .45em .8em; }
  h1 { font-size: 33px; }
  h2 { font-size: 22px; }
  .card { padding: 16px 14px; border-radius: 20px; }
  .rows .k { flex-basis: 100%; }
  .guides ul { gap: 4px; padding: 5px; }
  .guides a { padding: 4px 10px; font-size: 14px; }
  h3 { font-size: 19px; }
  .who { gap: 12px; }
  .who img { height: 64px; }
  .who.orb img { height: 50px; margin: 0 6px; }
  .tbl table { font-size: 14px; }
  .tbl thead th { font-size: 13px; }
  .tbl th, .tbl td { padding: 7px 7px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 10px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 10px; }
}
/* very small phones (narrower than 360 px): the big "Play now – it's free" button must fit on the screen */
@media (max-width: 359px) {
  .btn.big { font-size: 20px; padding: .55em 1em; }
}
@media (prefers-reduced-motion: no-preference) {
  .lost .num { animation: bob 2.6s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
}
