/* Tidebound homepage. Shares the colors in style.css. */
html { scroll-behavior: smooth; }
body.home { background: var(--bg); }
img.px, .fish-grid img, .feature img, .boss img, .dl-icon, .brand img, .track img { image-rendering: pixelated; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 0;
  justify-content: flex-start; flex-wrap: nowrap; padding: 10px 18px; transition: background 0.25s, box-shadow 0.25s;
}
.topbar.solid { background: #07121bee; box-shadow: 0 1px 0 var(--border); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--brass); font-weight: 800; letter-spacing: 0.06em; text-decoration: none; font-size: 18px; }
.brand img { width: 28px; height: 28px; }
.topbar .links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar .links a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 4px; font-size: 14px; }
.topbar .links a:hover { background: #ffffff14; }
.topbar .links a.cta { background: var(--brass); color: #2a1c04; font-weight: 700; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 4px; font-size: 18px; padding: 2px 10px; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
#sea { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text { position: relative; z-index: 1; max-width: 760px; padding: 90px 20px 60px; }
.hero-text::before { content: ""; position: absolute; inset: 70px -40px 30px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, #07121bb0, #07121b00); }
.logo {
  margin: 0; font-size: clamp(48px, 11vw, 116px); letter-spacing: 0.06em; color: var(--brass); line-height: 1;
  font-family: "Courier New", monospace; font-weight: 900;
  text-shadow: 4px 4px 0 #6a4310, 0 0 30px #e2b25255;
}
.tagline { font-size: clamp(18px, 3vw, 26px); margin: 12px 0 6px; color: #fff; text-shadow: 0 2px 6px #000a; }
.sub { color: #e6eef4dd; font-size: 17px; line-height: 1.55; text-shadow: 0 1px 4px #000c; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 6px; border: 1px solid var(--border-light); color: var(--text);
  background: #11293acc; text-decoration: none; font-weight: 700; transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #0008; }
.btn.gold { background: linear-gradient(#f0c46a, #c8902a); color: #2a1c04; border-color: #ffe0a0; }
.btn.big { font-size: 20px; padding: 14px 30px; }
.btn.disabled { opacity: 0.55; pointer-events: none; }
.badges { margin-top: 18px; color: #e6eef4bb; font-size: 13px; }
.badges span { display: inline-block; margin: 3px; padding: 3px 9px; border-radius: 99px; background: #0009; border: 1px solid #ffffff22; }
.scroll-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 34px; text-decoration: none;
  animation: bob 2s ease-in-out infinite; z-index: 1; }
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ------------------------------------------------------------ sections */
.home-main { max-width: none; padding: 0; }
.block { padding: 70px 18px; }
.block > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.block.alt { background: linear-gradient(var(--bg2), var(--bg)); }
.block h2 { font-size: clamp(26px, 4vw, 38px); color: var(--brass); text-align: center; margin: 0 auto 10px; }
.lead { text-align: center; color: var(--dim); font-size: 17px; max-width: 720px; line-height: 1.55; margin-bottom: 34px; }
.center { text-align: center; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s, transform 0.6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .scroll-hint { animation: none; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--border);
  max-width: 1080px; margin: -40px auto 0; position: relative; z-index: 2; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px #0008; }
.facts div { background: var(--panel); padding: 18px 10px; text-align: center; }
.facts b { display: block; font-size: 30px; color: var(--brass); }
.facts span { color: var(--dim); font-size: 13px; }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; transition: border-color 0.2s, transform 0.2s; }
.feature:hover { border-color: var(--brass); transform: translateY(-3px); }
.feature { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: start; }
.feature img { width: 40px; height: 40px; grid-row: span 2; }
.feature h3 { margin: 2px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }

/* minigame */
.game-wrap { text-align: center; }
.game-tabs { display: inline-flex; gap: 6px; margin-bottom: 10px; }
.game-tabs button { background: var(--panel); color: var(--dim); border: 1px solid var(--border); border-radius: 4px; padding: 7px 16px; font: inherit; cursor: pointer; }
.game-tabs button.on { color: var(--brass); border-color: var(--brass); }
#game { width: 100%; max-width: 640px; aspect-ratio: 640 / 300; border: 2px solid var(--border-light); border-radius: 8px; background: #0a1e2c;
  cursor: pointer; touch-action: none; display: block; margin: 0 auto; }
#game:focus { outline: 2px solid var(--brass); outline-offset: 2px; }
.game-help { color: var(--dim); font-size: 14px; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 26px; }
.game-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.game-card h3 { margin: 0 0 6px; color: var(--teal); font-size: 16px; }
.game-card p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }

/* worlds */
.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.world { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.world:hover { transform: translateY(-4px); box-shadow: 0 12px 30px #0009; }
.world .map { aspect-ratio: 1; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), linear-gradient(#0f2233, #08121b); }
.world .pic { position: absolute; inset: 6%; background: center / contain no-repeat; transition: transform 0.4s; filter: drop-shadow(0 14px 18px #0008); }
.world .pic.flat { inset: 0; background-size: cover; image-rendering: pixelated; filter: none; }
.world:hover .pic:not(.flat) { transform: scale(1.04); }
.world .view { position: absolute; bottom: 10px; right: 10px; background: #000b; color: #fff; border: 1px solid #fff3; padding: 3px 11px;
  border-radius: 99px; font: inherit; font-size: 12px; cursor: pointer; }
.world .view:hover { border-color: var(--accent); }
.world .lvl { position: absolute; top: 10px; right: 10px; background: #000b; padding: 3px 9px; border-radius: 99px; font-size: 13px; }
.world .body { padding: 14px 16px 16px; border-top: 3px solid var(--accent, var(--brass)); }
.world h3 { margin: 0 0 6px; color: var(--accent, var(--brass)); }
.world p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }
.world .tags { margin-top: 10px; font-size: 12px; color: var(--faint); }

/* bosses */
.bosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.boss { background: radial-gradient(circle at 50% 20%, #3a1a24, var(--panel) 70%); border: 1px solid #6a2a3a; border-radius: 10px; padding: 16px; text-align: center; }
.boss img { width: 96px; height: 96px; filter: drop-shadow(0 6px 10px #000a); }
.boss h3 { margin: 6px 0 4px; color: var(--r-mythic); font-size: 16px; }
.boss .lore { color: var(--text); font-style: italic; font-size: 13px; margin: 0 0 8px; }
.boss .where { color: var(--dim); font-size: 13px; margin: 0 0 8px; }
.boss .rounds { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.boss .rounds span { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #0006; color: var(--teal); }

/* fish gallery */
.fish-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.fish-tools input { padding: 8px 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font: inherit; min-width: 220px; }
.rarity-filter { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.rarity-filter button { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.rarity-filter button.on { border-color: currentColor; background: #ffffff10; }
.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fish { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 4px 6px; text-align: center; cursor: default;
  transition: transform 0.15s, border-color 0.15s; }
.fish:hover, .fish:focus { transform: scale(1.06); border-color: currentColor; z-index: 3; outline: none; }
.fish img { width: 64px; height: 64px; }
.fish .nm { display: block; font-size: 11px; line-height: 1.25; color: var(--text); margin-top: 2px; }
.fish.secret img { filter: brightness(0) drop-shadow(0 0 4px #c490ff); opacity: 0.85; }
.fish .tip { display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: 220px; z-index: 5;
  background: #07121bf4; border: 1px solid currentColor; border-radius: 6px; padding: 8px 10px; text-align: left; font-size: 12px; color: var(--dim); box-shadow: 0 8px 20px #000c; }
.fish:hover .tip, .fish:focus .tip { display: block; }
.fish .tip b { display: block; font-size: 13px; }
.r-UNIQUE { background: linear-gradient(90deg, #ff7a7a, #ffd07a, #8affa0, #7ad8ff, #c08aff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fish.r-UNIQUE { color: #ffd07a; -webkit-background-clip: border-box; background-clip: border-box; background: var(--panel); }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.shots figure { margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); cursor: zoom-in; background: #000; }
.shots img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.3s; }
.shots figure:hover img { transform: scale(1.04); }
.shots figcaption { padding: 7px 10px; font-size: 13px; color: var(--dim); background: var(--panel); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: #000d; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; box-shadow: 0 10px 40px #000; }
.lightbox p { color: var(--dim); }

/* music */
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.track { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.track.playing { border-color: var(--brass); }
.track button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--brass); background: #e2b25222; color: var(--brass); font-size: 15px; cursor: pointer; flex: none; }
.track .info { flex: 1; min-width: 0; }
.track .info b { display: block; font-size: 15px; }
.track .info span { font-size: 12px; color: var(--faint); }
.track .bar { height: 4px; background: #ffffff14; border-radius: 2px; margin-top: 5px; overflow: hidden; }
.track .bar i { display: block; height: 100%; width: 0; background: var(--brass); }

/* download */
.dl-card { display: flex; gap: 24px; align-items: center; background: linear-gradient(135deg, #1a3448, var(--panel)); border: 1px solid var(--brass);
  border-radius: 12px; padding: 26px; max-width: 720px; box-shadow: 0 14px 40px #0009; }
.dl-icon { width: 96px; height: 96px; flex: none; }
.dl-main h3 { margin: 0; font-size: 24px; }
.dl-main p { margin: 6px 0 16px; }
.hash { font-size: 11px; color: var(--faint); word-break: break-all; margin: 12px 0 0 !important; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.step > b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brass); color: #2a1c04; }
.step h3 { margin: 8px 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }
code { background: #ffffff14; padding: 1px 5px; border-radius: 3px; }

/* faq */
.faq { max-width: 760px; }
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.faq summary { padding: 12px 16px; cursor: pointer; font-weight: 600; }
.faq details[open] summary { color: var(--brass); }
.faq p { margin: 0; padding: 0 16px 14px; color: var(--dim); line-height: 1.55; }

/* live player count */
.live { width: fit-content; max-width: calc(100% - 32px); box-sizing: border-box; margin: -64px auto 0; padding: 10px 22px; position: relative; z-index: 3;
  text-align: center; font-size: 15px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 10px 30px #0008; }
.live + .facts { margin-top: 14px; }
.live .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-right: 6px;
  animation: pulse 1.8s infinite; vertical-align: middle; }
.live b { color: var(--good); font-size: 18px; }
.live.off .dot { background: var(--faint); animation: none; }
.live.off span { color: var(--dim); font-size: 13px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #6ee07a99; } 70% { box-shadow: 0 0 0 9px #6ee07a00; } 100% { box-shadow: 0 0 0 0 #6ee07a00; } }

/* lore */
.lore { background: radial-gradient(ellipse at 70% 40%, #1e2a4a, var(--bg) 70%); }
.lore-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; }
.lore-text p { color: var(--text); font-size: 17px; line-height: 1.7; margin: 0 0 14px; }
.lore-text .quote { font-size: 22px; color: var(--brass); font-style: italic; border-left: 3px solid var(--brass); padding-left: 16px; }
.lore-text .quote span { display: block; font-size: 13px; color: var(--faint); font-style: normal; margin-top: 4px; }
.lore-art { position: relative; height: 260px; }
.lore-art img { position: absolute; image-rendering: pixelated; filter: drop-shadow(0 10px 18px #000c); animation: drift 6s ease-in-out infinite; }
.lore-art img:nth-child(1) { width: 150px; left: 10%; top: 10%; }
.lore-art img:nth-child(2) { width: 96px; right: 12%; top: 0; animation-delay: -2s; }
.lore-art img:nth-child(3) { width: 140px; right: 20%; bottom: 0; animation-delay: -4s; }
@keyframes drift { 50% { transform: translateY(-12px) rotate(-3deg); } }
@media (max-width: 760px) { .lore-grid { grid-template-columns: 1fr; } .lore-art { height: 180px; } }

/* crate preview */
.crate-wrap { text-align: center; }
#crate { width: 100%; max-width: 640px; aspect-ratio: 2 / 1; border: 2px solid var(--border-light); border-radius: 8px; background: #08131c;
  display: block; margin: 0 auto; }
.crate-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.crate-buttons button { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.crate-buttons button:hover { border-color: var(--brass); }
.crate-buttons img { width: 24px; height: 24px; image-rendering: pixelated; }

/* recommended mods */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mod { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.mod h3 { margin: 0 0 4px; font-size: 16px; }
.mod h3 a { color: var(--teal); text-decoration: none; }
.mod .why { color: var(--dim); font-size: 14px; line-height: 1.5; margin: 0; }
.mod .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .topbar .links { display: none; position: absolute; top: 100%; right: 10px; flex-direction: column; background: #07121bf4;
    border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
  .topbar .links.open { display: flex; }
  .dl-card { flex-direction: column; text-align: center; }
  .facts { margin: -30px 16px 0; }
  .live { margin-top: -44px; }
  .live + .facts { margin: 12px 16px 0; }
}

/* ------------------------------------------------------------ roadmap */
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; }
.road::before { content: ""; position: absolute; left: 6%; right: 6%; top: 22px; height: 2px; z-index: 0;
  background: linear-gradient(90deg, var(--good), var(--brass) 50%, var(--faint)); opacity: 0.6; }
.stop { position: relative; z-index: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 0 18px 18px;
  border-top: 3px solid var(--accent); --accent: var(--faint); }
.stop.now { --accent: var(--good); }
.stop.next { --accent: var(--brass); }
.stop .when { display: inline-block; transform: translateY(-50%); background: var(--bg); color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stop .tag { margin: -2px 0 2px; font-size: 13px; color: var(--faint); }
.stop h3 { margin: 0 0 10px; color: var(--accent); font-size: 21px; }
.stop.later h3 { color: var(--text); }
.stop ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 14px; line-height: 1.55; }
.stop li + li { margin-top: 6px; }
.stop.now li::marker { content: "✓  "; color: var(--good); }
.stop.later { border-style: dashed; border-top-style: solid; }
.tide-rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.rule { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #0c1f2d88; }
.rule b { color: var(--teal); font-size: 14px; }
.rule p { margin: 4px 0 0; color: var(--dim); font-size: 13px; line-height: 1.5; }
@media (max-width: 860px) {
  .road { grid-template-columns: 1fr; gap: 22px; }
  .road::before { left: 22px; right: auto; top: 0; bottom: 0; width: 2px; height: auto;
    background: linear-gradient(var(--good), var(--brass) 50%, var(--faint)); }
  .tide-rules { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .tide-rules { grid-template-columns: 1fr; } }
