/* Tidal Merge website. Fonts are served from here, not from Google Fonts. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/bricolage-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/bricolage-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --deep: #06204a;
  --navy: #0a2a5a;
  --card: #0c2f64;
  --sea: #0b3d7a;
  --gold: #ffd36b;
  --soft: #d6e6f5;
  --label: #9fc7ea;
  --muted: #7f9fc4;
  --danger: #ff6b5a;
  --gutter: clamp(16px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--deep);
  color: #fff;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
a:hover { color: #fff; }
img { max-width: 100%; }

/* Both languages are in each page; only one shows. */
html[lang='es'] .en, html[lang='en'] .es { display: none !important; }

/* Navigation */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--gutter);
  position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 20px/1 'Bricolage Grotesque'; text-shadow: 0 2px 10px rgba(0,40,90,.5); }
.brand img { width: 40px; height: 40px; }
.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  font: 600 14px 'Bricolage Grotesque'; color: #fff; text-decoration: none;
  padding: 9px 14px; border-radius: 999px; background: rgba(8,36,80,.5); border: 0; cursor: pointer;
}
.pill:hover { background: rgba(8,36,80,.75); color: #fff; }
.lang { font-family: 'JetBrains Mono'; font-size: 12px; letter-spacing: .08em; }

/* Hero */
.hero {
  position: relative; min-height: 680px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--sea) url('../img/bg.jpg') center top / cover;
}
.hero-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 8px 20px 150px; text-align: center;
}
.hero-logo { width: clamp(240px, 42vw, 400px); height: auto; filter: drop-shadow(0 10px 30px rgba(0,40,90,.45)); }
.tagline { margin: 0; max-width: 520px; font: 600 clamp(17px, 2.2vw, 22px)/1.35 'Bricolage Grotesque'; text-shadow: 0 1px 10px rgba(0,40,90,.7); text-wrap: pretty; }
.hero-pieces {
  position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; align-items: flex-end;
  gap: clamp(12px, 4vw, 48px); pointer-events: none;
}
.hero-pieces img { filter: drop-shadow(0 6px 8px rgba(0,30,70,.35)); height: auto; }

.button {
  display: inline-block; font: 800 20px 'Bricolage Grotesque'; padding: 16px 40px; border-radius: 999px;
  background: #fff; color: #0e3566; text-decoration: none; box-shadow: 0 6px 0 #9ccbe8, 0 10px 24px rgba(0,30,70,.3);
  transition: transform .15s;
}
.button:hover { color: #0e3566; transform: translateY(-2px); }
.button.gold { background: var(--gold); color: #3a2600; box-shadow: 0 6px 0 #c8961e; }
.button.gold:hover { color: #3a2600; }
.button small { display: block; font: 600 12px 'Bricolage Grotesque'; opacity: .7; margin-top: 2px; }

/* Sections */
.section { padding: 88px var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 44px; }
.section.alt { background: var(--navy); }
.heading { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.eyebrow { font: 600 12px 'JetBrains Mono'; letter-spacing: .12em; color: var(--label); text-transform: uppercase; }
h2 { margin: 0; font: 800 clamp(34px, 5vw, 52px)/1.05 'Bricolage Grotesque'; }
.wrap { width: 100%; max-width: 1040px; }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.rule { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 24px; background: var(--card); }
.scene {
  position: relative; height: 200px; border-radius: 16px; overflow: hidden;
  background: var(--sea) url('../img/bg.jpg') center / cover;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.scene .mid { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(255,255,255,.7); }
.scene img { position: absolute; height: auto; filter: drop-shadow(0 4px 6px rgba(0,30,70,.4)); }
.scene .arrow { position: absolute; font: 800 22px 'Bricolage Grotesque'; text-shadow: 0 1px 6px rgba(0,30,70,.7); }
.scene .op { font: 800 26px 'Bricolage Grotesque'; text-shadow: 0 1px 6px rgba(0,30,70,.7); }
.scene .inline { position: static; }
.rule-text { display: flex; gap: 12px; align-items: baseline; }
.rule-text .n { font: 800 28px/1 'Bricolage Grotesque'; color: var(--gold); }
.rule-text h3 { margin: 0 0 6px; font: 800 22px/1.15 'Bricolage Grotesque'; }
.rule-text p { margin: 0; font: 400 16px/1.5 'Bricolage Grotesque'; color: var(--soft); text-wrap: pretty; }

.warning {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 18px;
  background: rgba(255,107,90,.14); border: 2px solid rgba(255,107,90,.55);
}
.warning .icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--danger);
  display: flex; align-items: center; justify-content: center; font: 800 20px 'Bricolage Grotesque'; color: #3a0a04;
}
.warning p { margin: 0; font: 400 16px/1.5 'Bricolage Grotesque'; text-wrap: pretty; }

.chain { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 24px; background: #0c3a74; }
.chain.heavy { background: #082048; }
.chain-label { font: 600 12px 'JetBrains Mono'; letter-spacing: .1em; color: #cfe3f5; }
.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.piece {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px;
  border-radius: 16px; background: rgba(255,255,255,.08); text-align: center;
}
.piece img { width: 72px; height: 72px; object-fit: contain; }
.piece .name { font: 600 14px 'Bricolage Grotesque'; }
.piece .level { font: 400 11px 'JetBrains Mono'; color: var(--label); letter-spacing: .06em; }

.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.extra {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: 20px;
  background: rgba(255,211,107,.12); border: 2px solid rgba(255,211,107,.5);
}
.extra h3 { margin: 0; font: 800 20px 'Bricolage Grotesque'; color: var(--gold); }
.extra p { margin: 0; font: 400 16px/1.5 'Bricolage Grotesque'; color: #e6effa; text-wrap: pretty; }

/* Invite page */
.hero.invite { min-height: 100vh; }
.invite-code { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; margin-top: 8px; }
.invite-code[hidden] { display: none; }
.invite-code p { margin: 0; font: 400 15px/1.45 'Bricolage Grotesque'; text-align: center; text-shadow: 0 1px 8px rgba(0,40,90,.7); }
.invite-code .code {
  font: 800 34px 'JetBrains Mono', monospace; letter-spacing: .18em; padding: 10px 22px; border-radius: 16px;
  background: rgba(8,32,72,.7); border: 2px solid rgba(255,211,107,.6); color: var(--gold);
}

/* Game modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.mode { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 24px; color: #fff; }
.mode h3 { margin: 0; font: 800 24px 'Bricolage Grotesque'; }
.mode p { margin: 0; font: 400 16px/1.5 'Bricolage Grotesque'; text-wrap: pretty; }
.mode.zen { background: linear-gradient(135deg, #1e7fc2, #2bb3e6); }
.mode.time { background: linear-gradient(135deg, #e07a3a, #ffb347); }
.mode.adventure { background: linear-gradient(135deg, #2e9e6b, #5cc98a); }
.modes-note { margin: 0; text-align: center; font: 400 16px/1.5 'Bricolage Grotesque'; color: #cfe3f5; }
.worlds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.world { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.world img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.world figcaption { font: 600 14px 'Bricolage Grotesque'; color: #e6effa; text-align: center; }
.world figcaption b { color: var(--gold); margin-right: 4px; }
@media (max-width: 720px) {
  .worlds { grid-template-columns: repeat(5, 46%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .world { scroll-snap-align: start; }
}
.mechanics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.extra.mechanic { flex-direction: row; align-items: center; gap: 16px; }
.extra.mechanic img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.extra.mechanic .glyph { width: 64px; flex: none; text-align: center; font: 800 44px/1 'Bricolage Grotesque'; color: #7fe3ff; }
.extra.mechanic > div:last-child { display: flex; flex-direction: column; gap: 6px; }

/* Footer */
.footer {
  padding: 96px 20px 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  background: linear-gradient(var(--navy), var(--deep));
}
.footer-links { margin-top: 48px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font: 400 13px 'Bricolage Grotesque'; }
.footer-links a { color: var(--soft); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-note { font: 400 12px 'JetBrains Mono'; color: var(--muted); }

/* Legal pages */
.legal-head { background: var(--sea) url('../img/bg.jpg') center top / cover; }
.legal-title { padding: 24px var(--gutter) 56px; text-align: center; }
.legal-title h1 { margin: 0 0 8px; font: 800 clamp(32px, 5vw, 48px)/1.1 'Bricolage Grotesque'; text-shadow: 0 2px 16px rgba(0,40,90,.6); }
.legal-title p { margin: 0; font: 600 15px 'Bricolage Grotesque'; text-shadow: 0 1px 8px rgba(0,40,90,.7); }
.legal { max-width: 780px; margin: 0 auto; padding: 48px var(--gutter) 72px; font: 400 16px/1.65 'Bricolage Grotesque'; color: #e6effa; }
.legal h2 { font-size: clamp(22px, 3vw, 28px); margin: 40px 0 12px; color: #fff; }
.legal h3 { font: 800 18px 'Bricolage Grotesque'; margin: 24px 0 8px; color: #fff; }
.legal p, .legal li { text-wrap: pretty; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal .box { padding: 18px 22px; border-radius: 18px; background: var(--card); margin: 20px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.legal th { color: var(--label); font: 600 12px 'JetBrains Mono'; letter-spacing: .06em; text-transform: uppercase; }
.table-scroll { overflow-x: auto; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; margin: 14px 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #3a2600; font: 800 16px/30px 'Bricolage Grotesque'; text-align: center;
}

@media (max-width: 560px) {
  .nav-links .pill:not(.lang):not(.keep) { display: none; }
  .hero { min-height: 600px; }
  .section { padding: 64px var(--gutter); }
  .pieces { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
  .piece img { width: 58px; height: 58px; }
  .piece .name { font-size: 13px; }
}
