/* ZoulZay Studio site — shared styles. Two themes: .theme-studio (navy/gold) and .theme-murabito (parchment/green/gold). */
:root {
  --ink: #0f1a33; --ink-2: #16244a; --gold: #e8b64a; --gold-2: #ffd77a; --cream: #fbf1dc;
  --green: #1f4a2c; --green-2: #2d6a3c; --parch: #f6e9c9; --parch-edge: #c9a560; --sky: #7fb6e6;
  --text: #f5efe0; --text-dark: #2b2116; --radius: 18px; --max: 1200px;
  --font-head: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Noto Sans Thai", "Noto Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(var(--max), 92vw); margin: 0 auto; }
section { padding: 96px 0; position: relative; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(28px, 4vw, 44px); text-align: center; }
.lead { text-align: center; opacity: .85; max-width: 720px; margin: 0 auto 40px; }

/* ---------- image placeholder (to be filled by Codex art; see IMAGE_TODO.md) ---------- */
.ph { position: relative; aspect-ratio: var(--ar, 16/9); width: 100%; border-radius: var(--radius);
  border: 2px dashed rgba(232,182,74,.7); background: repeating-linear-gradient(45deg, rgba(232,182,74,.08) 0 14px, rgba(232,182,74,.16) 14px 28px);
  display: grid; place-items: center; text-align: center; padding: 16px; color: var(--gold-2); font-size: 14px; margin: 0; }
.ph::before { content: "IMAGE TODO · " attr(data-todo); position: absolute; top: 10px; left: 12px; font-weight: 700; font-size: 12px; letter-spacing: .05em; }
.theme-murabito .ph { color: #6b4a12; border-color: #b8862b; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; letter-spacing: .12em; text-decoration: none; }
.nav .brand img { height: 44px; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav ul a { text-decoration: none; font-weight: 600; opacity: .9; }
.nav ul a:hover { color: var(--gold-2); }
.nav .menu-btn { display: none; margin-left: auto; background: none; border: 0; color: inherit; font-size: 26px; }
.lang { font-size: 13px; border: 1px solid currentColor; border-radius: 99px; padding: 2px 10px; text-decoration: none; opacity: .8; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font-weight: 800;
  border-radius: 99px; padding: 14px 30px; font-size: 17px; background: linear-gradient(#ffe39a, #e8a93a); color: #3a2205;
  box-shadow: 0 4px 0 #a86c14, 0 10px 24px rgba(232,170,58,.35); transition: transform .15s; }
.btn:hover { transform: translateY(-2px); }
.btn.big { font-size: 24px; padding: 20px 52px; }
.btn.small { font-size: 14px; padding: 8px 18px; }
.btn.glow { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 4px 0 #a86c14, 0 0 42px rgba(255,215,122,.85); } }

/* ---------- studio theme ---------- */
.theme-studio { background: var(--ink); color: var(--text); }
.theme-studio .nav { background: rgba(15,26,51,.82); border-bottom: 1px solid rgba(232,182,74,.25); }
.theme-studio section:nth-of-type(even) { background: var(--ink-2); }
.hero-studio { min-height: calc(100vh - 68px); display: grid; align-content: center; text-align: center; }
.hero-studio h1 { font-size: clamp(32px, 5vw, 60px); color: var(--cream); }
.carousel { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 32px 0; }
.carousel .slide { border-radius: var(--radius); overflow: hidden; border: 3px solid var(--gold); background: #0b1328; aspect-ratio: 3/4; display: grid; place-items: center; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.quote { text-align: center; padding: 140px 0; background: radial-gradient(ellipse at 50% 120%, rgba(232,182,74,.35), transparent 60%), var(--ink) !important; }
.quote blockquote { font-family: var(--font-head); font-size: clamp(26px, 4vw, 48px); color: var(--cream); margin: 0 auto; max-width: 900px; }
.quote cite { display: block; margin-top: 24px; color: var(--gold); font-style: italic; }
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.game-card { background: var(--cream); color: var(--text-dark); border-radius: var(--radius); overflow: hidden; border: 3px solid var(--gold); display: flex; flex-direction: column; }
.game-card .art { aspect-ratio: 16/10; overflow: hidden; background: #ddd; }
.game-card .art img { width: 100%; height: 100%; object-fit: cover; }
.game-card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-card .logo { height: 70px; object-fit: contain; margin: -56px auto 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #2b2116; color: #fff; }
.badge.hot { background: #c0392b; }
.game-card .url { font-size: 12px; opacity: .6; margin-top: auto; }
.about { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: center; }
.about .portrait { border-radius: 50%; border: 4px solid var(--gold); overflow: hidden; aspect-ratio: 1; background: #1c2c55; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.chip { border: 1px solid var(--gold); color: var(--gold-2); border-radius: 99px; padding: 4px 14px; font-size: 14px; }
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 48px; border-top: 2px solid var(--gold); padding-top: 20px; }
.timeline div { font-size: 13px; position: relative; }
.timeline div::before { content: ""; position: absolute; top: -28px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.timeline b { display: block; color: var(--gold-2); font-size: 18px; }
footer { padding: 56px 0 32px; font-size: 14px; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
footer h4 { color: var(--gold); margin: 0 0 12px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer .legal { border-top: 1px solid rgba(232,182,74,.3); margin-top: 32px; padding-top: 16px; display: flex; gap: 20px; flex-wrap: wrap; opacity: .75; }
.socials { display: flex; gap: 12px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); text-decoration: none; font-weight: 700; }
.theme-studio footer { background: #0a1226; }

/* ---------- murabito theme ---------- */
.theme-murabito { background: var(--parch); color: var(--text-dark); }
.theme-murabito .nav { background: rgba(31,74,44,.92); color: var(--cream); border-bottom: 3px solid var(--gold); }
.panel { background: var(--parch); border: 3px solid var(--parch-edge); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(60,40,10,.18); padding: 32px; }
.mb-hero { min-height: calc(100vh - 68px); display: grid; place-items: center; text-align: center; color: #fff; background: #2a3a20 center/cover no-repeat; overflow: hidden; padding: 40px 0; }
.mb-hero video, .mb-hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mb-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.mb-hero .inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: 18px; }
.mb-hero .logo { width: min(520px, 80vw); filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.play { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--gold-2); background: rgba(31,74,44,.85); color: var(--gold-2); font-size: 36px; cursor: pointer; }
.ribbon { background: var(--parch); color: var(--green); border: 2px solid var(--gold); border-radius: 99px; padding: 6px 22px; font-weight: 700; }
.platforms { display: flex; gap: 10px; }
.platforms span { background: var(--green); border: 2px solid var(--gold); padding: 6px 16px; border-radius: 99px; font-weight: 700; }
.counter { font-family: var(--font-head); font-size: clamp(40px, 7vw, 72px); color: var(--green); text-align: center; }
.counter small { display: block; font-family: var(--font-body); font-size: 18px; color: var(--text-dark); }
.cta { text-align: center; display: grid; justify-items: center; gap: 18px; background: linear-gradient(#fff6dc, var(--parch)); }
.track { position: relative; height: 10px; background: #e3d2a6; border-radius: 99px; margin: 40px 6% 70px; }
.track .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #f4c55a, #ffe08a); border-radius: 99px; width: 0; transition: width 1.2s; }
.track .node { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #cdb98a; border: 3px solid #fff; }
.track .node.on { background: var(--gold); box-shadow: 0 0 18px var(--gold-2); }
.track .node span { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-weight: 800; white-space: nowrap; }
.rewards { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 18px; }
.reward { text-align: center; opacity: .55; filter: grayscale(.6); transition: .3s; }
.reward.on { opacity: 1; filter: none; }
.reward .tag { display: inline-block; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 12px; border-radius: 99px; }
.reward img, .reward .ph { aspect-ratio: 1; max-width: 220px; margin: 10px auto; object-fit: contain; }
.reward.hero { border-color: var(--gold); background: linear-gradient(#fff3c4, var(--parch)); }
.story { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.story .big { font-size: clamp(26px, 3.4vw, 42px); font-weight: 800; color: var(--green); line-height: 1.35; }
.stamp { display: inline-block; transform: rotate(-6deg); border: 3px solid #b5302a; color: #b5302a; font-weight: 900; padding: 6px 18px; border-radius: 8px; font-size: 22px; letter-spacing: .05em; }
.classes { display: grid; grid-template-columns: 240px 1fr 300px; gap: 20px; }
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.tabs button, .class-list button { font: inherit; cursor: pointer; border: 2px solid var(--parch-edge); background: #fff8e6; border-radius: 12px; padding: 8px 16px; font-weight: 700; }
.tabs button[aria-selected="true"], .class-list button[aria-selected="true"] { background: var(--green); color: #fff; border-color: var(--gold); }
.class-list { display: grid; gap: 6px; align-content: start; }
.class-list button { text-align: left; }
.class-view { display: grid; grid-template-rows: auto auto; gap: 12px; }
.path { display: flex; align-items: center; gap: 12px; justify-content: center; font-weight: 700; flex-wrap: wrap; }
.path .arrow { color: var(--gold); font-size: 22px; }
.path .node { background: #fff8e6; border: 2px solid var(--parch-edge); border-radius: 12px; padding: 6px 14px; }
.dir { font-size: 13px; }
.dir table { width: 100%; border-collapse: collapse; }
.dir td { padding: 3px 4px; border-bottom: 1px dashed #d8c08a; }
.pets { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.pet { scroll-snap-align: start; text-align: center; padding: 16px; }
.pet img { height: 150px; margin: 0 auto 8px; object-fit: contain; }
.fusion { text-align: center; margin: 24px auto; background: var(--green); color: #fff; border-radius: 99px; padding: 10px 24px; width: fit-content; }
.olympus { margin-top: 24px; display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: center; }
.map { position: relative; border-radius: var(--radius); overflow: hidden; border: 4px solid var(--parch-edge); }
.map .pin { position: absolute; transform: translate(-50%, -100%); background: var(--green); color: #fff; border: 2px solid var(--gold); border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.map .pin:hover, .map .pin:focus { background: var(--gold); color: var(--text-dark); z-index: 2; }
.map .tip { position: absolute; z-index: 3; width: 240px; display: none; padding: 14px; font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 0; overflow: hidden; }
.feature .ph { border-radius: 0; border-width: 0 0 2px; }
.feature h3 { padding: 14px 18px 0; font-size: 20px; color: var(--green); }
.feature p { padding: 0 18px 18px; margin: 0; font-size: 15px; }
.theme-murabito footer { background: var(--green); color: var(--cream); border-top: 4px solid var(--gold); }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 460px; width: 92vw; }
dialog.modal::backdrop { background: rgba(10,15,8,.65); backdrop-filter: blur(3px); }
.modal form { background: var(--parch); border: 4px solid var(--gold); border-radius: 22px; padding: 28px; display: grid; gap: 14px; position: relative; }
.modal h3 { text-align: center; color: var(--green); font-size: 28px; }
.modal label { font-weight: 700; display: grid; gap: 4px; font-size: 14px; }
.modal input, .modal select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--parch-edge); background: #fffdf5; }
.modal .row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.modal .agree { display: flex; gap: 10px; font-weight: 400; align-items: flex-start; }
.modal .agree input { margin-top: 4px; }
.modal .close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--green); }
.modal .msg { text-align: center; font-weight: 700; min-height: 1.4em; }
.modal .msg.err { color: #b5302a; }
.modal .msg.ok { color: var(--green-2); }
.hp { position: absolute; left: -9999px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  section { padding: 64px 0; }
  .nav ul { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; padding: 16px 6vw; background: inherit; }
  .nav ul.open { display: flex; }
  .nav .menu-btn { display: block; }
  .carousel, .games, .features, .rewards { grid-template-columns: 1fr; }
  .carousel .slide { aspect-ratio: 16/10; }
  .about, .story, .classes, .olympus { grid-template-columns: 1fr; }
  .about .portrait { max-width: 260px; margin: 0 auto; }
  .timeline { grid-template-columns: 1fr 1fr; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .map .pin { font-size: 10px; padding: 1px 6px; }
}

/* sub pages: game pages, legal prose */
.game-page { padding: 120px 0 80px; text-align: center; }
.game-page .game-logo { max-width: 420px; width: 80%; }
.game-page .pitch { font-size: 1.25rem; max-width: 640px; margin: 16px auto; }
.game-page .badges { justify-content: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 40px; }
.shots img { width: 100%; border-radius: 14px; box-shadow: 0 8px 24px #0006; }
.prose { padding: 120px 0 80px; }
.prose .wrap { max-width: 760px; }
.prose h2 { margin-top: 32px; font-size: 1.3rem; }
.prose li { margin: 8px 0; }
.prose .draft { color: var(--gold-2); font-weight: 700; }
