:root {
  --sidebar-width: 250px;
  --bg: #e0ffc8;
  --topbar: #177a06;
  --topbar-height: 60px;
  --text-dark: #0f2b0a;
  --text: #0e1b10;
  --muted: #2d5a2d;
  --panel: #f3ffe8;
  --border: #bfe7a6;
  --pill: #ffffff;
  --pill-border: #cde9c8;
  --accent: #23c55e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif; }

.app { display: flex; min-height: 100vh; width: 100%; max-width: 100%; }

.sidebar { width: var(--sidebar-width); background: #b9f495; display: flex; flex-direction: column; border-right: 1px solid var(--border); padding: 8px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px; background: transparent; color: var(--text-dark); }
.brand-mascot { width: 33px; height: 33px; }
.brand-name { font-weight: 800; letter-spacing: 4px; font-size: 1.25rem; white-space: nowrap; }

.menu { display: flex; flex-direction: column; padding: 12px; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--text-dark); text-decoration: none; border-radius: 10px; }
.menu-item .nav-icon { font-size: 18px; line-height: 1; }
.menu-item p { margin: 0; }
.menu .dropdown { position: relative; margin: 0; }
.menu .dropdown-toggle { display: flex; align-items: center; gap: 10px; color: var(--text-dark); text-decoration: none; padding: 12px 14px; border-radius: 10px; background: transparent; border: none; }
.menu .dropdown-toggle:hover { background: rgba(0,0,0,0.08); }
.menu .dropdown-toggle img { width: 18px; height: 18px; }
.menu .dropdown-toggle p { margin: 0; }
.menu .dropdown-menu { position: absolute; display: none; top: calc(100% + 6px); left: 0; min-width: 160px; padding: 6px; margin: 0; background: #157D00; border: none; border-radius: 10px; z-index: 1100; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.menu .dropdown-item { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.menu .dropdown-item img { width: 18px; height: 18px; }
.menu .dropdown-item span { font-size: 14px; }
.menu .dropdown-item:hover { background: rgba(255,255,255,0.12); }
.menu-item.active { background: rgba(0,0,0,0.08); }

.divider { border: none; border-top: 1px solid var(--border); margin: 10px 12px; }
.sidebar-links { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.sidebar-links .link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 10px; }
.sidebar-links .link .nav-icon { font-size: 16px; line-height: 1; }
.sidebar-links .link p { margin: 0; display: inline; }
.sidebar-links .link.active { background: rgba(0,0,0,0.08); color: var(--text-dark); border-radius: 10px; padding: 6px 8px; display: inline-flex; align-items: center; gap: 8px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar { height: var(--topbar-height); display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--topbar) url('images/logo-light.png') no-repeat center; background-size: auto 28px; color: #fff; white-space: nowrap; overflow: hidden; }
.menu-toggle { display: none; background: transparent; color: #fff; border: none; font-size: 22px; }

.top-actions { flex-wrap: nowrap; min-width: 0; }

.hero { position: relative; height: calc(var(--vh, 1vh) * 100 - var(--topbar-height)); height: calc(100dvh - var(--topbar-height)); overflow: hidden; display: block; }
.hero-bg { width: 100%; height: 100%; object-fit: cover; opacity: 0.25; pointer-events: none; }
.avatar-wrap { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.ready-badge { margin-top: 8px; background: #d5f5d5; color: #2a6b2a; padding: 4px 10px; border-radius: 999px; font-size: 14px; border: 1px solid #bfe7a6; }

/* Live2D canvas area should not be clipped */
.canvas-container { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
#canvas { background: transparent; z-index: 1; width: 100%; height: 100%; display: block; }
.image-display { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.speech-bubble { z-index: 5; }

/* Hero overlay mask: green cover with centered rectangular window */
.hero-mask {
  position: absolute;
  /* Make the window rectangle sized by margins */
  top: 10%;
  left: 10%;
  right: 10%;
  bottom: 20%;
  pointer-events: none;
  z-index: 3; /* above canvas/speech-bubble background, below composer */
  border-radius: 20px;
  border: 4px solid #ffffff;
  /* Draw green overlay outside the window using a huge spread box-shadow */
  box-shadow: 0 0 0 9999px rgba(10, 160, 0, 0.92);
}

/* Ensure composer container sits above the mask */
.composer-fixed #textInputContainer { position: relative; z-index: 4; }

/* Composer fixed */
.composer { display: none; }
.composer-fixed { position: fixed; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; pointer-events: none; z-index: 900; }
html { scroll-padding-top: var(--topbar-height); }
.composer-fixed #textInputContainer { width: 85%; max-width: 85%; position: relative; }
.composer-fixed #textInput { width: 100%; background: var(--pill); border: 2px solid var(--pill-border); border-radius: 999px; padding: 14px 54px 14px 18px; color: var(--text); font-size: 16px; pointer-events: auto; }
.composer-fixed #sendBtn.send-pill, .composer-fixed .send-pill { left: -48px; width: 40px; height: 40px; border-radius: 999px; border: 2px solid #8de0a5; background: #09a833; display: grid; place-items: center; pointer-events: auto; }

/* Input top controls (status + skip button) */
.composer-fixed .input-top-controls { position: absolute; top: -45px; right: 7.5%; display: flex; align-items: center; gap: 8px; pointer-events: auto; z-index: 901; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .25s ease; z-index: 1000; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: inline-block; }
}

.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 900; }
body.sidebar-open .backdrop { display: block; }

/* Desktop: keep composer within main (not over sidebar) */
@media (min-width: 769px) {
  .composer-fixed { left: var(--sidebar-width); right: 0; }
  .composer-fixed #textInputContainer { width: 85%; max-width: 85%; }
  .composer-fixed #textInput { width: 100%; }
}


