/* Love In Action Virtual Headquarters v1. Brand: red #FF0000, black, white only. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --red: #FF0000; --black: #000; --white: #fff; --grey: #f2f2f2; --darkgrey: #222; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #000; color: #111; overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--red); }
#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.hidden { display: none !important; }

/* Language screen */
#lang-screen { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow-y: auto; }
#lang-screen img.logo { width: min(320px, 70vw); margin-bottom: 18px; }
#lang-screen h1 { font-size: clamp(22px, 5vw, 34px); letter-spacing: .02em; }
#lang-screen .tagline { color: #fff; font-size: 17px; margin: 8px 0 4px; }
#lang-screen .mission { color: #bbb; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 22px; }
#lang-screen p.choose { font-size: 16px; margin-bottom: 14px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: min(680px, 100%); }
.lang-grid button { background: #fff; color: #000; border: 2px solid #fff; border-radius: 10px; padding: 13px 10px; font-size: 16px; font-weight: 600; }
.lang-grid button:hover, .lang-grid button:focus-visible { border-color: var(--red); outline: 3px solid var(--red); outline-offset: 2px; }
#lang-screen .hint { color: #bbb; font-size: 13px; margin-top: 18px; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
#hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(#000d, #0000); color: #fff; pointer-events: none; }
#hud-top img { height: 38px; }
#hud-top .title { font-weight: 700; font-size: 15px; line-height: 1.2; }
#hud-top .floor-pill { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
#hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); overflow-x: auto; background: linear-gradient(#0000, #000c); pointer-events: auto; }
#hud-bottom button { flex: 0 0 auto; background: #fff; color: #000; border: 2px solid #000; border-radius: 999px; padding: 10px 14px; font-size: 14px; font-weight: 700; min-height: 44px; }
#hud-bottom button.primary { background: var(--red); color: #fff; border-color: var(--red); }
#hud-bottom button[aria-pressed="true"] { background: #000; color: #fff; }
#hud-bottom button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
#hint-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 74px; background: #000d; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
#preview-banner { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; z-index: 25; white-space: nowrap; }

/* Panels */
.panel { position: absolute; z-index: 30; background: #fff; color: #111; border-radius: 16px; box-shadow: 0 12px 40px #0009; padding: 20px; max-width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 140px); overflow-y: auto; }
.panel h2 { font-size: 21px; margin-bottom: 8px; padding-right: 28px; }
.panel p { font-size: 15px; line-height: 1.55; margin-bottom: 12px; }
.panel .note { font-size: 13px; color: #555; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.panel .actions a, .panel .actions button { display: inline-block; text-decoration: none; border-radius: 999px; padding: 11px 16px; font-size: 15px; font-weight: 700; min-height: 44px; }
.panel .actions a.cta { background: var(--red); color: #fff; }
.panel .actions button.ghost { background: #fff; color: #000; border: 2px solid #000; }
.panel .close-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #000; background: #fff; font-size: 17px; font-weight: 700; }
#room-panel { left: 50%; bottom: 84px; transform: translateX(-50%); width: min(480px, calc(100vw - 24px)); }
#lovi-dialog { left: 12px; bottom: 84px; width: min(430px, calc(100vw - 24px)); }
#lovi-dialog .lovi-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
#lovi-dialog .lovi-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--red); }
#lovi-dialog .lovi-say { background: var(--grey); border-radius: 12px; padding: 12px; font-size: 15px; line-height: 1.5; margin-bottom: 12px; }
#lovi-dialog .opts { display: flex; flex-direction: column; gap: 8px; }
#lovi-dialog .opts button { text-align: left; background: #fff; border: 2px solid #000; border-radius: 10px; padding: 11px 12px; font-size: 15px; font-weight: 600; }
#lovi-dialog .opts button:hover { border-color: var(--red); }
#elevator-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 24px)); text-align: center; }
#elevator-panel .floor-btns { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
#elevator-panel .floor-btns button { padding: 14px; font-size: 17px; font-weight: 700; border-radius: 10px; border: 2px solid #000; background: #fff; }
#elevator-panel .floor-btns button:hover { border-color: var(--red); }
#elevator-panel .indicator { font-size: 15px; font-weight: 700; }
#elevator-panel .indicator .big { display: block; font-size: 40px; color: var(--red); line-height: 1.1; }
#directory-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); }
#directory-panel input { width: 100%; padding: 11px 12px; font-size: 16px; border: 2px solid #000; border-radius: 10px; margin: 10px 0 14px; }
.dir-floor { margin-bottom: 14px; }
.dir-floor h3 { font-size: 16px; margin-bottom: 6px; border-bottom: 2px solid var(--red); padding-bottom: 4px; }
.dir-floor ul { list-style: none; }
.dir-floor li button { width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #ddd; padding: 11px 4px; font-size: 15px; }
.dir-floor li button:hover { color: var(--red); }
.dir-floor li button:disabled { color: #999; }
#lang-menu { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 24px)); }
#lang-menu .lang-grid { grid-template-columns: 1fr 1fr; }

/* Express fallback / no WebGL */
#express { position: absolute; inset: 0; z-index: 15; background: #fff; overflow-y: auto; padding: 76px 16px 120px; }
#express h2 { font-size: 20px; margin-bottom: 6px; }
#express .banner { background: #000; color: #fff; padding: 12px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
#toast { position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); background: #000; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 40; white-space: nowrap; }
#lovi-chip { position: absolute; right: 12px; bottom: 84px; z-index: 18; display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #000; border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 14px; font-weight: 700; box-shadow: 0 6px 20px #0006; }
#lovi-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
@media (max-width: 560px) {
  #hud-top .title { font-size: 13px; }
  #hint-bar { bottom: 78px; font-size: 12px; }
  #lovi-dialog, #room-panel { bottom: 78px; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
