:root {
  --ink: #0b0b0d;
  --paper: #fffefb;
  --yellow: #ffd765;
  --blue: #69bdf5;
  --lilac: #e9d5fa;
  --mint: #d8f5df;
  --soft-blue: #dff2ff;
  --line: #d8d8d8;
  --shadow: 4px 5px 0 #111;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
.shell { width: min(1230px, calc(100% - 40px)); margin-inline: auto; }
.site-header { min-height: 82px; padding: 14px max(20px, calc((100vw - 1230px)/2)); border-bottom: 1px solid var(--line); display:flex; align-items:center; gap:28px; background:rgba(255,254,251,.97); position:sticky; top:0; z-index:20; }
.mini-brand { display:flex; align-items:center; gap:10px; text-decoration:none; font-weight:950; letter-spacing:-.02em; }
.mini-cat { width:38px; height:38px; border-radius:50%; background:#111; display:grid; place-items:center; }
.mini-studio { letter-spacing:.35em; font-size:.78em; margin-left:4px; }
.main-nav { margin-left:auto; display:flex; align-items:center; gap:12px; font-weight:850; }
.main-nav a { text-decoration:none; padding:11px 14px; border-radius:14px; }
.main-nav a:hover, .main-nav a.active { background:var(--yellow); }
.main-nav .studio-link { background:#fff; border:2px solid #111; box-shadow:3px 3px 0 #111; }
.menu-button { display:none; margin-left:auto; font-size:22px; border:2px solid #111; background:#fff; border-radius:12px; padding:7px 10px; }
.hero { display:grid; grid-template-columns: 1.45fr .75fr; gap:45px; align-items:end; padding-top:42px; }
.eyebrow { display:inline-block; background:#f4f4f4; border:1px solid #ddd; border-radius:999px; padding:8px 13px; font-weight:800; font-size:.95rem; }
.hero h1, .page-title { font-size:clamp(3.7rem,8vw,7.2rem); line-height:.82; letter-spacing:-.075em; margin:22px 0 14px; font-weight:1000; }
.studio-pill { display:inline-block; padding:8px 26px 10px; border-radius:999px; background:var(--yellow); font-size:clamp(2rem,4vw,3.7rem); font-weight:950; letter-spacing:.17em; line-height:1; }
.hero h2 { font-size:clamp(1.45rem,2.5vw,2rem); margin:20px 0 4px; letter-spacing:-.035em; font-weight:850; }
.credit { font-size:1.08rem; margin:0 0 23px; font-weight:600; }
.hero-actions { display:flex; gap:16px; flex-wrap:wrap; }
.button { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; min-height:56px; padding:0 24px; border:2px solid #111; border-radius:14px; font-weight:950; box-shadow:var(--shadow); transition:.12s ease; }
.button:hover { transform:translate(-1px,-1px); box-shadow:6px 7px 0 #111; }
.button.blue { background:var(--blue); }
.button.yellow { background:var(--yellow); }
.button.small { min-height:44px; box-shadow:3px 3px 0 #111; margin-top:14px; }
.hero-mascot { min-height:350px; display:flex; align-items:flex-end; justify-content:center; position:relative; overflow:visible; transform:translateX(-50px); }
.hero-mascot img { width:min(450px,100%); max-height:350px; object-fit:contain; object-position:bottom center; image-rendering:auto; }
.speech { position:absolute; right:-3%; top:3%; z-index:2; background:#fff; border:3px solid #111; border-radius:28px; padding:17px 22px; font-size:1.25rem; font-weight:800; transform:rotate(-2deg); }
.feature-grid { display:grid; grid-template-columns: 2fr 1fr; gap:16px; margin-top:18px; }
.panel { border:1px solid #cfd5da; border-radius:24px; padding:18px; }
.games-panel { background:var(--soft-blue); }
.world-panel { background:var(--lilac); }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.panel h3, .section-title-row h3 { margin:0; font-size:2rem; letter-spacing:-.04em; }
.panel p { margin:3px 0 13px; font-size:1.05rem; }
.outline-link { text-decoration:none; border:2px solid #1474d4; background:#fff; padding:11px 16px; border-radius:14px; font-weight:900; white-space:nowrap; }
.game-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.game-card { overflow:hidden; border:1px solid #d4d7da; border-radius:16px; background:#fff; }
.placeholder-art { height:130px; display:grid; place-items:center; font-weight:950; letter-spacing:.12em; color:#fff; }
.placeholder-art.sky { background:linear-gradient(145deg,#62c9ff,#7ce091); }
.placeholder-art.purple { background:linear-gradient(145deg,#5d48c7,#a071e7); }
.placeholder-art.green { background:linear-gradient(145deg,#73d66b,#f1c052); }
.card-copy { padding:11px 12px 13px; display:flex; flex-direction:column; gap:2px; }
.card-copy strong { font-size:1.05rem; }
.card-copy span { color:#666; }
.world-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.world-grid a { min-height:58px; text-decoration:none; background:#fff; border:1px solid #d4d4d4; border-radius:14px; display:flex; align-items:center; gap:9px; padding:10px 12px; font-weight:800; font-size:1.05rem; }
.world-grid a:hover { transform:translateY(-1px); }
.latest-grid { display:grid; grid-template-columns:2fr 1fr; gap:16px; margin-top:16px; }
.section-title-row { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:8px; }
.section-title-row h3 { font-size:1.6rem; }
.section-title-row a { font-weight:800; color:#176dd4; text-decoration:none; }
.latest-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.latest-grid > div:last-child .latest-cards { grid-template-columns:1fr; }
.latest-card { background:#fff; border:1px solid #ddd; border-radius:14px; padding:14px; display:flex; flex-direction:column; min-height:78px; }
.latest-card span { color:#666; font-size:.92rem; margin-top:4px; }
.ad-slot { min-height:62px; border:1.5px dashed #b8c0cc; border-radius:12px; color:#7c8695; display:grid; place-items:center; margin-top:14px; font-weight:700; background:#fafcff; }
.ad-slot[hidden] { display:none; }
.site-footer { border-top:1px solid #ddd; margin-top:44px; padding:28px 0 36px; display:flex; justify-content:space-between; color:#555; }
.page-shell { padding-top:50px; min-height:70vh; }
.page-shell.narrow { max-width:900px; }
.page-title { font-size:clamp(4rem,8vw,7rem); }
.page-intro { max-width:720px; font-size:1.25rem; line-height:1.55; }
.catalog { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:30px; }
.empty-state { border:2px dashed #bbb; border-radius:20px; padding:38px; background:#fff; color:#555; min-height:180px; display:flex; flex-direction:column; justify-content:center; }
.world-section { margin:48px 0; scroll-margin-top:110px; }
.world-section h2 { font-size:2rem; }
.about-box { margin-top:30px; border:2px solid #111; border-radius:22px; padding:26px; box-shadow:6px 6px 0 #111; background:#fff; font-size:1.16rem; line-height:1.6; }
.privacy-note { background:#fff3c9; padding:14px 16px; border-radius:14px; }
@media (max-width: 900px) {
  .site-header { min-height:68px; }
  .mini-studio { display:none; }
  .menu-button { display:block; }
  .main-nav { display:none; position:absolute; right:20px; top:66px; background:#fff; border:2px solid #111; border-radius:16px; padding:10px; flex-direction:column; align-items:stretch; box-shadow:5px 5px 0 #111; }
  .main-nav.open { display:flex; }
  .hero { grid-template-columns:1fr; gap:14px; padding-top:22px; }
  .hero-mascot { order:-1; min-height:220px; justify-content:flex-end; transform:none; }
  .hero-mascot img { max-height:240px; width:320px; }
  .speech { left:0; right:auto; top:20px; font-size:1rem; }
  .feature-grid, .latest-grid { grid-template-columns:1fr; }
  .game-grid, .latest-cards, .catalog { grid-template-columns:1fr; }
  .panel-heading { align-items:center; }
}
@media (max-width: 520px) {
  .shell { width:min(100% - 24px,1230px); }
  .hero h1, .page-title { font-size:3.6rem; }
  .studio-pill { font-size:2rem; }
  .hero-actions { display:grid; }
  .button { width:100%; }
  .world-grid { grid-template-columns:1fr; }
  .site-footer { flex-direction:column; gap:8px; }
}


/* Creator Studio */
.studio-body { background:#f8f6ef; }
.studio-header { position:static; }
.studio-public-link { text-decoration:none; font-weight:900; border:2px solid #111; border-radius:12px; padding:10px 14px; background:#fff; box-shadow:3px 3px 0 #111; }
.studio-shell { padding-top:34px; padding-bottom:70px; }
.studio-intro { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:26px; }
.studio-title { font-size:clamp(3rem,7vw,6rem); line-height:.9; margin:16px 0 8px; letter-spacing:-.06em; }
.studio-intro p { margin:0; font-size:1.12rem; font-weight:650; }
.mode-badge { max-width:330px; background:#fff3c9; border:2px solid #111; border-radius:18px; padding:14px 16px; box-shadow:4px 4px 0 #111; }
.mode-badge strong, .mode-badge span { display:block; }
.mode-badge span { margin-top:4px; color:#555; font-size:.92rem; line-height:1.35; }
.studio-dashboard { display:grid; grid-template-columns:320px 1fr; gap:20px; align-items:start; }
.studio-sidebar, .studio-editor { background:#fff; border:2px solid #111; border-radius:22px; box-shadow:6px 6px 0 #111; }
.studio-sidebar { padding:16px; }
.studio-choice { width:100%; border:2px solid #111; border-radius:16px; background:#fff; padding:14px; display:flex; gap:12px; align-items:flex-start; text-align:left; cursor:pointer; margin-bottom:10px; }
.studio-choice.active { background:var(--yellow); }
.studio-choice > span:first-child { font-size:1.5rem; }
.studio-choice b, .studio-choice small { display:block; }
.studio-choice b { font-size:1rem; }
.studio-choice small { margin-top:2px; color:#555; line-height:1.3; }
.studio-list-wrap { margin-top:20px; border-top:1px solid #ddd; padding-top:14px; }
.studio-list-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.studio-list-head h2 { margin:0; font-size:1.15rem; }
.text-button { border:0; background:transparent; font:inherit; font-weight:900; cursor:pointer; }
.studio-items { display:grid; gap:8px; margin-top:10px; }
.studio-item { width:100%; border:1px solid #ddd; border-radius:13px; background:#fff; display:grid; grid-template-columns:auto 1fr auto; gap:9px; align-items:center; text-align:left; padding:10px; cursor:pointer; }
.studio-item.active { border-color:#111; background:#f9f9f9; }
.studio-item-icon { font-size:1.15rem; }
.studio-item-copy b, .studio-item-copy small { display:block; }
.studio-item-copy small { color:#666; margin-top:2px; }
.status-dot { width:9px; height:9px; border-radius:50%; background:#aaa; }
.status-dot.published { background:#2cb66c; }
.studio-empty { border:1px dashed #bbb; border-radius:12px; padding:16px; color:#777; }
.studio-editor { padding:22px; }
.studio-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.field { display:flex; flex-direction:column; gap:7px; font-weight:800; }
.field.full, .check-field.full { grid-column:1 / -1; }
.field > span { font-size:.95rem; }
.field em { font-weight:500; color:#777; }
.field input, .field select, .field textarea { width:100%; font:inherit; border:2px solid #cfcfcf; border-radius:12px; padding:12px 13px; background:#fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline:0; border-color:#111; box-shadow:0 0 0 3px rgba(255,215,101,.35); }
.field small { color:#777; font-weight:500; line-height:1.35; }
.check-field { display:flex; align-items:flex-start; gap:10px; font-weight:750; background:#fafafa; border:1px solid #ddd; border-radius:12px; padding:12px 13px; }
.check-field input { margin-top:3px; }
.cover-preview { min-height:180px; border:2px dashed #c8c8c8; border-radius:16px; display:grid; place-items:center; overflow:hidden; background:#fafafa; color:#888; }
.cover-preview img { width:100%; height:240px; object-fit:cover; display:block; }
.studio-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:22px; align-items:center; }
.button.white { background:#fff; }
.danger-button { margin-left:auto; border:0; background:transparent; color:#b00020; font-weight:900; cursor:pointer; padding:12px; }
.studio-toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); background:#111; color:#fff; padding:11px 16px; border-radius:999px; opacity:0; pointer-events:none; transition:.2s; z-index:90; font-weight:800; }
.studio-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.preview-modal { position:fixed; inset:0; background:rgba(0,0,0,.52); z-index:80; display:grid; place-items:center; padding:24px; }
.preview-modal[hidden] { display:none; }
.preview-dialog { position:relative; width:min(720px,100%); max-height:88vh; overflow:auto; background:#fff; border:3px solid #111; border-radius:22px; box-shadow:8px 8px 0 #111; padding:24px; }
.preview-dialog h2 { font-size:2.2rem; margin:12px 0; }
.preview-close { position:absolute; top:10px; right:12px; border:0; background:transparent; font-size:2rem; cursor:pointer; }
.preview-cover { width:100%; max-height:360px; object-fit:cover; border-radius:16px; border:1px solid #ddd; }
.preview-placeholder { min-height:220px; display:grid; place-items:center; background:linear-gradient(135deg,#dff2ff,#e9d5fa); font-weight:950; letter-spacing:.08em; }
.preview-note { background:#fff3c9; padding:12px 14px; border-radius:12px; margin:14px 0; }
.published-card .game-cover, .game-cover { width:100%; height:170px; object-fit:cover; display:block; background:#eee; }
.content-cover { width:130px; height:100px; object-fit:cover; border-radius:12px; background:#eee; }
.content-cover-empty { display:grid; place-items:center; background:linear-gradient(135deg,#f2e8ff,#dff6e5); font-weight:900; font-size:.75rem; letter-spacing:.06em; text-align:center; padding:8px; }
.card-play { margin-top:10px; align-self:flex-start; border:2px solid #111; border-radius:10px; background:var(--yellow); font-weight:900; padding:8px 11px; cursor:pointer; }
.world-card { display:grid; grid-template-columns:130px 1fr; gap:14px; align-items:center; background:#fff; border:1px solid #ddd; border-radius:16px; padding:12px; }
.world-card h3 { margin:0 0 4px; }
.world-card p { margin:0 0 5px; color:#444; }
.world-card small { color:#777; }

@media (max-width: 900px) {
  .studio-intro { align-items:flex-start; flex-direction:column; }
  .mode-badge { max-width:none; width:100%; }
  .studio-dashboard { grid-template-columns:1fr; }
  .studio-sidebar { order:2; }
  .studio-editor { order:1; }
}
@media (max-width: 600px) {
  .studio-form-grid { grid-template-columns:1fr; }
  .field.full, .check-field.full { grid-column:auto; }
  .studio-actions { display:grid; grid-template-columns:1fr 1fr; }
  .studio-actions .button, .danger-button { width:100%; margin-left:0; }
  .world-card { grid-template-columns:1fr; }
  .content-cover { width:100%; height:180px; }
}


/* Supabase Studio auth */
.studio-header-actions { margin-left:auto; display:flex; align-items:center; gap:12px; }
.studio-user-label { font-weight:850; color:#555; }
.studio-auth-card { width:min(560px,100%); margin:54px auto 0; background:#fff; border:2px solid #111; border-radius:24px; padding:26px; box-shadow:7px 7px 0 #111; }
.studio-auth-card h1 { margin:16px 0 8px; font-size:clamp(2.5rem,6vw,4.6rem); line-height:.9; letter-spacing:-.05em; }
.studio-auth-card > p { color:#555; font-size:1.05rem; line-height:1.5; }
.studio-sign-in-form { display:grid; gap:14px; margin-top:22px; }
.form-message { min-height:1.4em; margin:0; color:#9a1025; font-weight:750; }
.mode-badge.live-mode { background:#dff6e5; }
.editor-status-row { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.editor-status { display:inline-flex; align-items:center; min-height:30px; padding:5px 10px; border-radius:999px; background:#f0f0f0; font-size:.78rem; font-weight:950; letter-spacing:.06em; }
.approval-meta { color:#68716a; font-size:.88rem; }
.studio-filter-row { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.filter-chip { border:1px solid #cfcfcf; background:#fff; border-radius:999px; padding:6px 9px; font:inherit; font-size:.78rem; font-weight:850; cursor:pointer; }
.filter-chip.active { background:#111; color:#fff; border-color:#111; }
.status-dot.review { background:#f2a900; }
.parent-check-panel { border:2px solid #111; border-radius:18px; padding:16px; background:#fff8dc; display:grid; gap:10px; }
.parent-check-panel[hidden] { display:none; }
.parent-check-panel > div > strong { font-size:1.15rem; }
.parent-check-panel > div > p { margin:4px 0 2px; color:#555; }
.parent-check-panel .check-field { background:#fff; }
.world-open-link { display:inline-block; margin-top:8px; font-weight:900; text-decoration:none; color:#176dd4; }
.card-play { text-decoration:none; color:#111; }

@media (max-width: 700px) {
  .studio-header-actions { gap:8px; }
  .studio-user-label { display:none; }
  .studio-public-link { padding:8px 10px; font-size:.85rem; }
  .studio-auth-card { margin-top:28px; padding:20px; }
  .editor-status-row { align-items:flex-start; flex-direction:column; }
}
