@font-face { font-family: 'Jersey 10'; src: url('/fonts/jersey-10-latin-400-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  /* Colours from the game's own UI panels and the island's sea */
  --sea: #1f4f78; --sea-deep: #14324f; --sea-night: #0f2338;
  --panel: rgba(38, 30, 40, 0.9); --panel-solid: #261e28; --line: #e8c48c; --line-soft: rgba(232, 196, 140, 0.35);
  --cream: #faeed6; --gold: #ffd65a; --gold-deep: #c99a2a; --mute: #bcae9f; --green: #6cc46c; --red: #e0705f;
  --rare1: #78dc78; --rare2: #6eaaff; --rare3: #ffc83c;
  --pixel: 'Jersey 10', ui-monospace, monospace;
  --body: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--sea-deep); color: var(--cream); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
h1, h2, h3, .brand, .btn, .tabs button, .seg button, .eyebrow, .label { font-family: var(--pixel); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: clamp(72px, 12vw, 132px); line-height: 0.85; margin: 4px 0 14px; color: var(--gold); text-shadow: 0 4px 0 #8a5a1c, 0 8px 0 rgba(0,0,0,.35); }
h2 { font-size: clamp(42px, 6vw, 62px); line-height: 0.95; margin: 0 0 8px; color: var(--gold); text-shadow: 0 3px 0 rgba(0,0,0,.35); }
h3 { font-size: 30px; font-weight: 400; margin: 10px 0 6px; color: var(--cream); }
p { margin: 0 0 12px; }
b { color: var(--cream); }
.muted { color: var(--mute); }
.hint { min-height: 1.4em; margin: 8px 0 0; font-size: 14px; color: var(--mute); }
.hint.err { color: var(--red); } .hint.ok { color: var(--green); }
.fine { font-size: 13px; color: var(--mute); margin-top: 14px; }
.soon { display: inline-block; font: 400 14px/1 var(--pixel); color: var(--sea-night); background: var(--line); border-radius: 3px; padding: 3px 5px 2px; vertical-align: 2px; margin-left: 4px; white-space: nowrap; }

.panel { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 0 rgba(0,0,0,.25); }

/* ── sprites (Sunnyside, scaled with crisp pixels) ── */
.icon { --s: 16px; --i: 0; display: inline-block; width: var(--s); height: var(--s); background: url('/assets/icons.png') calc(var(--i) * var(--s) * -1) 0 / calc(var(--s) * 10) var(--s) no-repeat; image-rendering: pixelated; vertical-align: middle; flex: none; }
.icon.big, .crop.big { --s: 48px; }
.i-fish { --i: 0; } .i-wood { --i: 1; } .i-seeds { --i: 2; } .i-axe { --i: 3; } .i-rod { --i: 4; } .i-shovel { --i: 5; } .i-water { --i: 6; } .i-rock { --i: 7; } .i-egg { --i: 8; } .i-pick { --i: 9; }
.crop { --s: 16px; --i: 3; display: inline-block; width: var(--s); height: var(--s); background: url('/assets/crops.png') calc(var(--i) * var(--s) * -1) 0 / calc(var(--s) * 4) var(--s) no-repeat; image-rendering: pixelated; }

/* ── buttons & inputs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 18px; border-radius: var(--r); border: 2px solid var(--line); font-size: 24px; text-decoration: none; cursor: pointer; color: var(--cream); background: var(--panel-solid); box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.btn-gold { background: var(--gold); color: #3a2410; border-color: #fff1b8; box-shadow: 0 4px 0 var(--gold-deep); }
.btn-gold:active { box-shadow: 0 1px 0 var(--gold-deep); }
.btn-ghost { background: rgba(38, 30, 40, .55); }
.btn-small { min-height: 36px; padding: 2px 12px; font-size: 21px; }
.btn-wide { width: 100%; }
.btn-danger { border-color: var(--red); color: #ffd7cf; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input, select { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r); border: 2px solid var(--line-soft); background: rgba(0,0,0,.35); color: var(--cream); font: 22px var(--pixel); }
input:focus { border-color: var(--line); outline: none; }
label, .label { display: block; font: 400 18px var(--pixel); color: var(--line); margin-bottom: 6px; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }

/* ── nav ── */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px max(16px, env(safe-area-inset-left)); background: rgba(20, 50, 79, .92); backdrop-filter: blur(6px); border-bottom: 2px solid rgba(232, 196, 140, .4); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 36px; color: var(--gold); text-decoration: none; text-shadow: 0 2px 0 #8a5a1c; }
.brand .icon { --s: 32px; }
.links { display: flex; gap: 18px; margin-left: 8px; }
.links a { color: var(--cream); text-decoration: none; font: 400 22px var(--pixel); opacity: .85; }
.links a:hover { opacity: 1; color: var(--gold); }
.wallet-slot { margin-left: auto; position: relative; }
.me .addr { font: 400 18px var(--pixel); color: var(--mute); margin-left: 8px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; padding: 14px; z-index: 30; }
.menu form { margin-bottom: 12px; }

/* ── hero ── */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: center; overflow: hidden; border-bottom: 2px solid rgba(232, 196, 140, .4); }
.hero-map { position: absolute; inset: 0; background: url('/assets/island.webp') 0 0 / 2752px auto repeat-x; background-color: #285a8c; image-rendering: pixelated; animation: pan 140s linear infinite alternate; }
.hero-map::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 35, 56, .82) 0%, rgba(15, 35, 56, .35) 55%, rgba(15, 35, 56, .1) 100%), linear-gradient(0deg, rgba(20, 50, 79, .9), transparent 30%); }
@keyframes pan { from { background-position: -200px -560px; } to { background-position: -1500px -380px; } }
.hero-inner { position: relative; width: 100%; max-width: 1180px; margin: 0 auto; padding: 56px 16px; display: flex; align-items: flex-end; gap: 24px; }
.hero-card { max-width: 560px; padding: 26px 28px 28px; }
.eyebrow { color: var(--line); font-size: 24px; margin: 0; }
.lede { font-size: 18px; color: #f3e5ca; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.angler { margin-left: auto; align-self: flex-end; }
.sprite.cast { width: 288px; height: 192px; background: url('/assets/cast.png') 0 0 / 4320px 192px no-repeat; image-rendering: pixelated; animation: cast 2.4s steps(15) infinite; filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
@keyframes cast { to { background-position: -4320px 0; } }

/* ── sections ── */
.section { padding: 72px 0; background: var(--sea); }
.section.alt { background: var(--sea-deep); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sub { font-size: 18px; color: #e9dcc4; max-width: 720px; margin-bottom: 28px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pillar { padding: 18px; }
.pillar p { color: #e9dcc4; font-size: 15px; margin: 0; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 560px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 28px; padding-bottom: 10px; scrollbar-color: var(--line) transparent; }
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery img { border: 2px solid var(--line); border-radius: var(--r); image-rendering: pixelated; width: 100%; height: auto; aspect-ratio: 1366 / 768; object-fit: cover; background: var(--sea-night); }
.gallery figcaption { font: 400 20px var(--pixel); color: var(--line); margin-top: 8px; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 28px; color: #e9dcc4; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; background: url('/assets/icons.png') 0 0 / 160px 16px; image-rendering: pixelated; }
.steps { padding-left: 22px; display: grid; gap: 14px; color: #e9dcc4; margin: 0; }
.steps li::marker { font: 400 23px var(--pixel); color: var(--gold); }

/* ── boards ── */
.board-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button, .seg button { min-height: 40px; padding: 6px 14px; border-radius: var(--r); border: 2px solid var(--line-soft); background: rgba(38,30,40,.6); color: var(--cream); font-size: 21px; cursor: pointer; }
.tabs button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--line); color: #3a2410; border-color: var(--line); }
.seg { display: flex; gap: 6px; }
.board { padding: 18px 20px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 400 29px var(--pixel); color: var(--gold); flex-wrap: wrap; }
.countdown { font: 400 20px var(--pixel); color: var(--mute); }
.board-desc { color: var(--mute); font-size: 14px; margin: 4px 0 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px dashed var(--line-soft); }
.rows li:first-child { border-top: 0; }
.rows .place { font: 400 26px var(--pixel); color: var(--mute); text-align: center; }
.rows li:nth-child(1) .place { color: var(--gold); } .rows li:nth-child(2) .place { color: #dfe6ee; } .rows li:nth-child(3) .place { color: #e3a46b; }
.rows .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rows .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .name { font: 400 23px var(--pixel); }
.rows .tag { font-size: 13px; color: var(--mute); }
.rows .score { font: 400 23px var(--pixel); color: var(--gold); text-align: right; white-space: nowrap; }
.rows .empty { display: block; text-align: center; color: var(--mute); padding: 28px 8px; border: 0; }
.you { margin: 12px 0 0; padding-top: 12px; border-top: 2px solid var(--line-soft); font: 400 21px var(--pixel); color: var(--line); }

/* ── banners ── */
.banner { --c: #3f7fbf; position: relative; display: inline-grid; place-items: center; width: 34px; height: 40px; background: var(--c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); flex: none; }
.banner .icon { --s: 24px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); margin-bottom: 6px; }
.banner.big { width: 60px; height: 72px; } .banner.big .icon { --s: 40px; }
.banner.sm { width: 24px; height: 28px; } .banner.sm .icon { --s: 16px; margin-bottom: 4px; }

/* ── guilds ── */
.guild-box { padding: 20px; }
.guild-box h3 { margin-top: 0; }
.guild-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.guild-head h3 { margin: 0; font-size: 34px; color: var(--gold); }
.members { list-style: none; padding: 0; margin: 10px 0 14px; max-height: 300px; overflow: auto; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 2px; border-top: 1px dashed var(--line-soft); }
.members .crown { color: var(--gold); font: 400 16px var(--pixel); margin-left: 6px; }
.members .kick { background: none; border: 0; color: var(--red); font: 400 17px var(--pixel); cursor: pointer; padding: 4px 6px; }
.invite { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.3); border-radius: var(--r); padding: 8px 10px; margin: 8px 0 12px; }
.invite code { font: 400 26px var(--pixel); letter-spacing: .12em; color: var(--gold); flex: 1; }
.or { display: flex; align-items: center; gap: 10px; color: var(--mute); font: 400 18px var(--pixel); margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px dashed var(--line-soft); }
.picker { display: grid; gap: 8px; margin-bottom: 12px; }
.swatches, .emblems { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 30px; height: 30px; border-radius: 4px; border: 2px solid transparent; cursor: pointer; }
.emblems button { width: 34px; height: 34px; border-radius: 4px; border: 2px solid var(--line-soft); background: rgba(0,0,0,.3); cursor: pointer; display: grid; place-items: center; }
.swatches button[aria-pressed="true"], .emblems button[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.gform { display: grid; gap: 10px; }
.gpreview { display: flex; align-items: center; gap: 12px; }

/* ── flywheel ── */
.wheel { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto; }
.wheel::before { content: ''; position: absolute; inset: 14%; border: 3px dashed var(--line-soft); border-radius: 50%; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 96px; height: 96px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--line); display: grid; place-items: center; }
.spoke { position: absolute; width: 38%; padding: 10px 12px; transform: translate(-50%, -50%); text-align: center; }
.spoke b { display: block; font: 400 23px var(--pixel); color: var(--gold); }
.spoke span { font-size: 13px; color: #e9dcc4; line-height: 1.35; display: block; }
.s1 { left: 50%; top: 10%; } .s2 { left: 80%; top: 40%; } .s3 { left: 69%; top: 86%; } .s4 { left: 31%; top: 86%; } .s5 { left: 20%; top: 40%; }
.ca { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; margin-bottom: 22px; }
.ca .label { grid-column: 1 / -1; margin: 0; }
.ca code { font: 400 20px var(--pixel); color: var(--gold); overflow-wrap: anywhere; }

/* ── link ── */
.link-box { padding: 22px; }
.link-box input { font-size: 40px; letter-spacing: .25em; text-transform: uppercase; text-align: center; margin-bottom: 12px; }

/* ── wallet modal & toast ── */
.modal { color: var(--cream); width: min(92vw, 400px); padding: 22px; }
.modal::backdrop { background: rgba(10, 20, 35, .7); }
.modal h3 { margin-top: 0; color: var(--gold); font-size: 32px; }
.wallet-list { display: grid; gap: 8px; margin: 14px 0; }
.wallet-list .btn { justify-content: flex-start; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 10px 16px; font: 400 21px var(--pixel); background: var(--panel-solid); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 0 rgba(0,0,0,.3); }

.foot { padding: 34px 0 calc(34px + env(safe-area-inset-bottom)); background: var(--sea-night); border-top: 2px solid rgba(232, 196, 140, .3); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.foot .fine { margin: 0; }

/* ── small screens ── */
@media (max-width: 960px) {
  .links { display: none; }
  .pillars { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  .angler { display: none; }
}
@media (max-width: 640px) {
  .brand { font-size: 30px; } .brand .icon { --s: 26px; }
  .nav .btn { font-size: 21px; padding: 4px 12px; }
  .me .addr { display: none; }
  .hero { min-height: 0; }
  .hero-inner { padding: 36px 16px; }
  .hero-card { padding: 20px; }
  .section { padding: 52px 0; }
  .pillars { grid-template-columns: 1fr; }
  .board { padding: 14px; }
  .rows li { grid-template-columns: 34px 1fr auto; gap: 8px; }
  .rows .name, .rows .score { font-size: 20px; }
  .wheel { aspect-ratio: auto; display: grid; gap: 10px; }
  .wheel::before, .hub { display: none; }
  .spoke { position: relative; left: auto; top: auto; transform: none; width: auto; text-align: left; }
  .spoke + .spoke::before { content: '↓'; display: block; position: absolute; margin: -26px 0 0 12px; color: var(--line); font: 400 21px var(--pixel); }
  .menu { position: fixed; left: 16px; right: 16px; width: auto; top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-map, .wheel::before, .sprite.cast { animation: none; }
  html { scroll-behavior: auto; }
}
