/* WyWorld — page styles (chrome comes from site-chrome.css + lwc-chrome.css) */
html, body { background: #050508; color: #eee; }
.ww-main { padding-top: 84px; min-height: 100vh; }

/* Landing */
.ww-landing { max-width: 880px; margin: 0 auto; padding: 60px 20px 90px; text-align: center; }
.ww-landing h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: -1px; margin-bottom: 14px; }
.ww-grad { background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ww-tag { color: #bbb; font-size: 1.12rem; line-height: 1.6; max-width: 640px; margin: 0 auto 36px; }
.ww-feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 40px; text-align: left; }
.ww-feat { background: #0d0d14; border: 1px solid #1d1d2b; border-radius: 14px; padding: 18px; }
.ww-feat b { display: block; margin-bottom: 6px; color: #fff; }
.ww-feat span { color: #999; font-size: .92rem; line-height: 1.5; }
.ww-cta { display: inline-block; padding: 14px 34px; border-radius: 999px; font-weight: 700; color: #fff; text-decoration: none;
  background: linear-gradient(90deg, #a855f7, #ec4899); transition: transform .15s, box-shadow .15s; }
.ww-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(168, 85, 247, .35); }
.ww-note { color: #777; font-size: .85rem; margin-top: 18px; }

/* Game */
.ww-game { padding: 8px 10px 30px; }
.ww-canvas-wrap { position: relative; max-width: 1280px; margin: 0 auto; border: 1px solid #1d1d2b; border-radius: 14px; overflow: hidden; background: #07070c; }
#ww-canvas { display: block; width: 100%; height: min(72vh, 720px); cursor: crosshair; touch-action: none; }
.ww-hud-top { position: absolute; top: 10px; left: 12px; display: flex; gap: 10px; pointer-events: none; }
.ww-hud-top span { background: rgba(5,5,8,.72); border: 1px solid #26263a; border-radius: 8px; padding: 5px 11px; font-size: .82rem; color: #ddd; backdrop-filter: blur(4px); }
#ww-minimap { position: absolute; top: 10px; right: 12px; border: 1px solid #26263a; border-radius: 8px; background: rgba(5,5,8,.8); }
.ww-hud-bottom { position: absolute; bottom: 10px; right: 12px; display: flex; gap: 8px; }
.ww-hbtn { background: rgba(13,13,20,.85); border: 1px solid #2a2a40; border-radius: 8px; color: #ddd; padding: 7px 13px; font-size: .82rem; cursor: pointer; }
.ww-hbtn:hover { border-color: #a855f7; }
.ww-hbtn.on { border-color: #ec4899; color: #fff; }

/* NPC chat panel */
.ww-chat { position: absolute; bottom: 10px; left: 12px; width: min(360px, calc(100% - 24px)); background: rgba(8,8,13,.94);
  border: 1px solid #2a2a40; border-radius: 12px; backdrop-filter: blur(6px); display: flex; flex-direction: column; }
.ww-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid #1d1d2b; font-weight: 700; }
.ww-chat-head button { background: none; border: none; color: #888; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.ww-chat-log { max-height: 200px; overflow-y: auto; padding: 10px 12px; font-size: .88rem; line-height: 1.45; }
.ww-chat-log .me { color: #c084fc; margin: 4px 0; }
.ww-chat-log .npc { color: #ddd; margin: 4px 0; }
.ww-chat-log .sys { color: #666; font-style: italic; margin: 4px 0; }
#ww-chat-form { display: flex; gap: 6px; padding: 9px; border-top: 1px solid #1d1d2b; }
#ww-chat-input { flex: 1; background: #0d0d14; border: 1px solid #26263a; border-radius: 8px; color: #eee; padding: 8px 10px; font-size: .88rem; }
#ww-chat-form button { background: linear-gradient(90deg, #a855f7, #ec4899); border: none; border-radius: 8px; color: #fff; font-weight: 700; padding: 0 14px; cursor: pointer; }

/* hidden attribute must always win over display rules */
[hidden] { display: none !important; }

/* Modals */
.ww-modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.ww-modal-card { background: #0d0d14; border: 1px solid #26263a; border-radius: 16px; padding: 26px; max-width: 460px; width: 100%; }
.ww-modal-card h3 { margin-bottom: 10px; }
.ww-modal-card p { color: #aaa; font-size: .9rem; line-height: 1.55; margin-bottom: 16px; }
.ww-modal-card label { display: block; color: #ccc; font-size: .85rem; margin-bottom: 12px; }
.ww-modal-card input, .ww-modal-card select { display: block; width: 100%; margin-top: 5px; background: #07070c; border: 1px solid #26263a;
  border-radius: 8px; color: #eee; padding: 9px 11px; font-size: .9rem; color-scheme: dark; }
.ww-modal-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ww-modal-btns button { background: #16161f; border: 1px solid #2a2a40; border-radius: 8px; color: #ddd; padding: 9px 16px; cursor: pointer; }
.ww-modal-btns button:first-child { background: linear-gradient(90deg, #a855f7, #ec4899); border: none; color: #fff; font-weight: 700; }

@media (max-width: 700px) {
  .ww-main { padding-top: 70px; }
  #ww-canvas { height: 62vh; }
  #ww-minimap { width: 96px; height: 72px; }
}

/* ── v2: 16:9 stage + fullscreen ── */
.ww-stage { position: relative; max-width: 1120px; margin: 0 auto; aspect-ratio: 16 / 9;
  border: 1px solid #1d1d2b; border-radius: 14px; overflow: hidden; background: #07070c; }
.ww-stage #ww-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.ww-stage #ww-canvas.dragging { cursor: grabbing; }
.ww-stage:fullscreen { max-width: none; border-radius: 0; border: none; aspect-ratio: auto; }
.ww-stage:fullscreen #ww-canvas { height: 100%; }
.ww-chat-target { padding: 4px 12px 8px; color: #777; font-size: .75rem; }

/* My AIs modal */
.ww-modal-wide { max-width: 560px; max-height: 86vh; overflow-y: auto; }
.ww-modal-card h4 { margin: 14px 0 10px; color: #ddd; }
.ww-ais-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.ww-ai-row { display: flex; align-items: center; gap: 10px; background: #07070c; border: 1px solid #26263a; border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.ww-ai-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.ww-ai-row .ww-ai-info { flex: 1; min-width: 0; }
.ww-ai-row .ww-ai-info b { display: block; color: #fff; }
.ww-ai-row .ww-ai-info span { color: #888; font-size: .78rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww-ai-row button { background: #16161f; border: 1px solid #2a2a40; border-radius: 7px; color: #ccc; padding: 5px 10px; cursor: pointer; font-size: .78rem; }
.ww-ai-row button.danger:hover { border-color: #e11d48; color: #fda4af; }
.ww-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ww-add-grid label { margin-bottom: 0; }
.ww-span2 { grid-column: span 2; }
.ww-chat-log .ai { color: #93c5fd; margin: 4px 0; }
@media (max-width: 700px) { .ww-add-grid { grid-template-columns: 1fr; } .ww-span2 { grid-column: span 1; } }

/* ── v3: fullscreen-only world + lobby ─────────────────────────────────────── */
.ww-main { padding-top: 72px; }
.ww-landing { padding: 28px 20px 60px; }
.ww-playbtn { border: 0; cursor: pointer; font-size: 1.2rem; }
html.ww-noscroll, html.ww-noscroll body { overflow: hidden !important; height: 100%; }
.ww-shell:fullscreen, .ww-shell.ww-fs { position: fixed; inset: 0; z-index: 5000; background: #050508;
  display: flex; align-items: center; justify-content: center; }
.ww-shell:fullscreen .ww-stage, .ww-shell.ww-fs .ww-stage { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border: 0; border-radius: 0; }
.ww-rotate { display: none; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 400;
  background: rgba(8,8,13,.9); border: 1px solid #2a2a40; border-radius: 99px; padding: 7px 16px; font-size: .85rem; color: #ccc; pointer-events: none; }
@media (orientation: portrait) {
  .ww-shell:fullscreen .ww-rotate, .ww-shell.ww-fs .ww-rotate { display: block; }
}
@media (max-width: 700px) { .ww-main { padding-top: 64px; } }

.ww-embedded body { background: #050508; overflow: hidden; }
.ww-embedded #lwc-header, .ww-embedded #lwc-footer, .ww-embedded #ww-landing, .ww-embedded #ww-lobby { display: none !important; }
.ww-embedded .ww-main { padding: 0; min-height: 100vh; background: #050508; }
.ww-embedded #ww-game[hidden] { display: block !important; visibility: hidden; }
.ww-embedded #ww-shell { position: fixed; inset: 0; z-index: 5000; background: #050508; display: flex; align-items: center; justify-content: center; }
.ww-embedded #ww-shell.ww-fs, .ww-embedded #ww-shell.ww-fs #ww-game { visibility: visible; }
