/* Rook-E Chess — site styles. Same palette and type as the app. */
@font-face {
  font-family: 'Outfit';
  src: url('../assets/fonts/Outfit.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #0d1117;
  --ink: #101828;
  --panel: #161c26;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f7fb;
  --muted: #a8b3c4;
  --mint: #34d5a6;
  --mint-dark: #1fa982;
  --sunshine: #ffc83d;
  --sky: #5cc8ff;
  --coral: #ff6b6b;
  --grape: #7c5cff;
  --radius: 18px;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.4em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--sunshine); outline-offset: 3px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 17, 23, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(255, 255, 255, 0.08); }
.lang { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; font-weight: 600; }

/* Buttons: chunky, like the app */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 16px; border: 0;
  font: inherit; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink); background: var(--sunshine); text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 #c9962b, 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9962b; }
.btn.mint { background: var(--mint); box-shadow: 0 5px 0 var(--mint-dark), 0 12px 24px rgba(0, 0, 0, 0.35); }
.btn.mint:active { box-shadow: 0 1px 0 var(--mint-dark); }
.btn.ghost { background: rgba(255, 255, 255, 0.1); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.small { padding: 10px 16px; font-size: 0.9rem; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,0.3); }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

/* Hero: on desktop everything that matters is on the first screen */
.hero {
  position: relative; min-height: calc(100vh - 60px); display: grid; align-items: center;
  background: url('../assets/scenes/home_day.jpg') center 35% / cover no-repeat;
  padding: 28px 0 36px;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,17,23,0.25) 0%, rgba(13,17,23,0.45) 55%, var(--night) 100%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 28px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: center; }
.hero-copy { display: grid; gap: 14px; justify-items: start; text-align: left; }
.hero .rooke { width: min(100%, 420px); justify-self: center; filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45)); }
.hero h1 { background: linear-gradient(#fff, #bfefe8); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.35rem); text-shadow: 0 2px 12px rgba(0,0,0,0.6); max-width: 34em; margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid; font-weight: 700; font-size: 0.95rem; backdrop-filter: blur(6px); background: rgba(13,17,23,0.35); }
.pill.mint { color: var(--mint); border-color: rgba(52,213,166,0.6); }
.pill.sky { color: var(--sky); border-color: rgba(92,200,255,0.6); }
.pill.gold { color: var(--sunshine); border-color: rgba(255,200,61,0.6); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.soon { font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sunshine); font-size: 0.85rem; }
.hero .note { font-size: 0.9rem; margin: 0; }
/* The three steps and the opponents, compact, still inside the first screen */
.hero-strip { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.hero .loop { gap: 12px; }
.hero .step { padding: 14px 16px; background: rgba(22, 28, 38, 0.72); backdrop-filter: blur(8px); }
.hero .step::before { width: 26px; height: 26px; font-size: 0.85rem; margin-bottom: 6px; }
.hero .step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.hero .step p { font-size: 0.9rem; line-height: 1.35; }
.hero-opps { display: grid; gap: 8px; justify-items: center; text-decoration: none; color: inherit; }
.hero-opps .faces { display: flex; }
.hero-opps .faces a { display: block; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 2px solid var(--night); margin-left: -10px; transition: transform 0.12s; }
.hero-opps .faces a:first-child { margin-left: 0; }
.hero-opps .faces a:hover { transform: translateY(-4px); }
.hero-opps .faces img { width: 100%; height: 100%; object-fit: cover; }
.hero-opps small { color: var(--muted); font-weight: 600; }

/* Sections */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { display: grid; gap: 10px; align-content: start; }
.feature img { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45)); }
.feature p { color: var(--muted); margin: 0; }

/* Worlds strip */
.worlds { display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr); }
.world { position: relative; aspect-ratio: 9 / 14; border-radius: var(--radius); overflow: hidden; background-size: cover; background-position: center; isolation: isolate; }
.world::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(13,17,23,0.9)); }
.world .sign-wrap { position: absolute; z-index: 1; left: 7%; right: 7%; bottom: 10%; }
.world .sign { width: 100%; }
.world .name { position: absolute; left: 6%; right: 6%; top: 30%; width: 88%; height: auto; overflow: visible; }
.world .name text { font-family: 'Outfit', system-ui, sans-serif; font-weight: 900; font-size: 30px; letter-spacing: 0.5px; fill: #3b2a14; paint-order: stroke fill; stroke: rgba(255, 244, 214, 0.55); stroke-width: 3px; stroke-linejoin: round; }
.world .sub { position: absolute; z-index: 2; left: 0; right: 0; bottom: 3%; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* Opponents */
.opponents { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opp { text-align: center; display: grid; gap: 6px; justify-items: center; text-decoration: none; color: inherit; }
.opp img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--mint); box-shadow: 0 10px 20px rgba(0,0,0,0.45); }
.opp b { font-size: 1.05rem; }
.opp small { color: var(--muted); }

/* Loop cards */
.loop { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mint); color: var(--ink); font-weight: 900; margin-bottom: 10px; }
.step p { color: var(--muted); margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
footer a { color: var(--muted); }

/* Prose pages */
.prose { max-width: 760px; padding: 48px 0 80px; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: #d7deea; }
.prose .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }

/* Play page */
.play-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 14px 0 10px; }
.play-head h1 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 0; }
.play-head p { margin: 0; font-size: 0.95rem; }
.play { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; padding: 0 0 8px; }
.board-col { width: min(100%, calc(100vh - 232px)); margin-inline: auto; }
.board-wrap { position: relative; }
.side { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 125px); min-height: 0; }
.card-moves { flex: 1; min-height: 64px; display: flex; flex-direction: column; }
.card-moves .moves { flex: 1; max-height: none; min-height: 0; }
.actions.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.actions-row .btn { padding: 8px 2px; font-size: 0.7rem; min-width: 0; border-radius: 10px; letter-spacing: 0; }
.seg-colour { margin-top: 8px; }
.seg-colour button { font-size: 0.85rem; padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-pitch { font-size: 0.85rem; margin: 0; line-height: 1.3; }
.board {
  position: relative; width: 100%; aspect-ratio: 1; touch-action: none; user-select: none;
  background: url('../assets/board/classic.jpg') center / 100% 100% no-repeat;
  border: 10px solid #3b2415; border-radius: 12px;
  box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 20px 40px rgba(0,0,0,0.5);
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
}
.sq { position: relative; min-width: 0; min-height: 0; }
.sq img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.45)); transition: transform 0.08s; }
/* A soft rim in the opposite square tone lifts pieces off the wood. */
.sq img.w { filter: drop-shadow(0 0 2px #694636) drop-shadow(0 0 1px #694636) drop-shadow(0 3px 3px rgba(0,0,0,0.45)); }
.sq img.b { filter: drop-shadow(0 0 2px #C29C77) drop-shadow(0 0 1px #C29C77) drop-shadow(0 3px 3px rgba(0,0,0,0.45)); }
.sq.sel { box-shadow: inset 0 0 0 4px var(--sky); }
.sq.last { background: rgba(255, 200, 61, 0.38); }
.sq.check { background: radial-gradient(circle, rgba(255,80,80,0.75), rgba(255,80,80,0) 70%); }
.sq.dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(92, 200, 255, 0.85); box-shadow: 0 0 0 2px rgba(13, 17, 23, 0.25); }
.sq.cap::after { content: ''; position: absolute; inset: 7%; border-radius: 50%; border: 5px solid rgba(92, 200, 255, 0.85); box-sizing: border-box; }
.sq .coord { position: absolute; font-size: 0.7rem; font-weight: 700; opacity: 0.85; pointer-events: none; }
.sq .coord.file { right: 4px; bottom: 1px; }
.sq .coord.rank { left: 4px; top: 1px; }
.sq.light .coord { color: #6b4a2b; }
.sq.dark .coord { color: #f1dfc5; }
.sq.dragging img { opacity: 0.35; }
.glide { position: absolute; z-index: 6; pointer-events: none; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.5)); will-change: transform; }
.drag-ghost { position: fixed; pointer-events: none; z-index: 50; width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,0.5)); transform: translate(-50%, -50%); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin-bottom: 10px; }
.opp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opp-tile { display: grid; justify-items: center; gap: 1px; padding: 6px 4px 4px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,0.03); cursor: pointer; color: inherit; font: inherit; }
.opp-tile img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.opp-tile b { font-size: 0.9rem; line-height: 1.1; }
.opp-tile small { color: var(--muted); font-size: 0.72rem; }
.opp-tile[aria-pressed="true"] { border-color: var(--mint); background: rgba(52,213,166,0.1); }
.opp-blurb { font-size: 0.85rem; margin: 8px 0 0; line-height: 1.3; }
.opp-list { display: grid; gap: 8px; }
.opp-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,0.03); cursor: pointer; text-align: left; color: inherit; font: inherit; }
.opp-row img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.opp-row[aria-pressed="true"] { border-color: var(--mint); background: rgba(52,213,166,0.1); }
.opp-row b { display: block; }
.opp-row small { color: var(--muted); font-size: 0.8rem; line-height: 1.25; display: block; }
.seg { display: flex; gap: 6px; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; padding: 8px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--mint); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.coach { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; margin-top: 10px; }
.coach img { width: 56px; height: 56px; object-fit: contain; }
.bubble { position: relative; background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 14px; font-weight: 600; }
.bubble::before { content: ''; position: absolute; left: -9px; top: 22px; border: 6px solid transparent; border-right: 10px solid #fff; border-left: 0; }
.bubble.mint { box-shadow: 0 0 0 3px var(--mint); }
.bubble.coral { box-shadow: 0 0 0 3px var(--coral); }
.moves { font-variant-numeric: tabular-nums; display: grid; grid-template-columns: 3ch 1fr 1fr; gap: 2px 10px; max-height: 120px; overflow: auto; font-size: 0.95rem; }
.moves .n { color: var(--muted); }
.status { font-weight: 700; }
.thinking { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sunshine); animation: pulse 0.9s infinite alternate; margin-right: 6px; vertical-align: middle; }
@keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13,17,23,0.72); border-radius: 12px; z-index: 5; text-align: center; padding: 20px; }
.overlay img { width: 150px; }
.overlay h2 { font-size: 2.2rem; text-shadow: 0 4px 16px rgba(0,0,0,0.6); }

@media (max-width: 820px) {
  .play { grid-template-columns: 1fr; }
  .board-col { width: 100%; }
  .side { height: auto; }
  .card-moves .moves { max-height: 140px; }
  .worlds { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .nav-links a.hide-sm { display: none; }
  .nav-links a { padding: 8px 8px; font-size: 0.95rem; }
  .lang { padding: 6px 6px; }
  .hero-top { grid-template-columns: 1fr; }
  .hero .rooke { width: min(56vw, 240px); order: -1; }
  .hero-copy { justify-items: center; text-align: center; }
  .hero-strip { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .thinking { animation: none; }
}

/* Short desktop viewports (laptops): keep the whole first screen in view */
@media (min-width: 821px) and (max-height: 800px) {
  .hero { padding: 16px 0 24px; }
  .hero .wrap { gap: 16px; }
  .hero-copy { gap: 10px; }
  .hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
  .hero .lead { font-size: 1.1rem; }
  .hero .rooke { width: min(100%, 330px); }
  .hero .step p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .btn { padding: 12px 20px; font-size: 0.98rem; }
}
.world.w-castle .name text { fill: #f4ead0; stroke: rgba(30, 25, 20, 0.7); }

/* Consent bar */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; box-shadow: 0 16px 40px rgba(0,0,0,0.5); max-width: 760px; margin-inline: auto; }
.consent p { margin: 0; font-size: 0.95rem; color: #d7deea; flex: 1 1 320px; }
.consent .actions { display: flex; gap: 8px; }
