@font-face {
  font-family: 'PixelJP';
  src: local('MS Gothic');
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0a0a1e;
  color: #fff;
  font-family: 'PixelJP', 'MS Gothic', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#app {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==== タイトル画面 ==== */
#screen-title {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a1e;
  cursor: pointer;
}
#screen-title[hidden] { display: none; }

.title-bg {
  position: absolute;
  inset: 0;
  background-image: url(../images/title/title-bg.png);
  background-size: cover;
  background-position: center;
}
/* 縦長画面では主人公が画面下部中央に大きく収まるよう構図し直した専用アセットに差し替える
   (横長版title-bg.pngをそのままcoverすると主人公が見切れてしまうため) */
@media (orientation: portrait) {
  .title-bg {
    background-image: url(../images/title/title-bg-portrait.png);
    background-position: center;
  }
}
.title-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,12,0.25) 0%, rgba(5,8,12,0.1) 40%, rgba(5,8,12,0.65) 100%);
}

.title-content { position: relative; z-index: 1; text-align: center; padding: 20px; }
.title-logo-img {
  display: block;
  width: min(90%, 480px);
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 18px rgba(106, 139, 255, 0.65));
}
.title-logo {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 16px #6a8bff, 0 0 2px #6a8bff, 2px 2px 0 #0b1a4d;
}
.title-sub {
  margin: 0 0 70px;
  color: #9db4ff;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.title-prompt {
  color: #ffd76e;
  font-size: 0.9rem;
  animation: confusion-pulse 1.2s ease-in-out infinite;
}

.titlebar {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 16px 0 8px;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
}
.titlebar .sub {
  display: block;
  font-size: 0.7rem;
  color: #9db4ff;
  margin-top: 4px;
}
.mute-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-width: 1px;
}

.screen {
  width: 100%;
  max-width: 640px;
  padding: 16px;
}
.screen.screen-battle { max-width: 1100px; }
.screen.screen-town { max-width: 1100px; }

.window {
  background: #0b1a4d;
  border: 4px solid #fff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 0 0 2px #0b1a4d, inset 0 0 0 2px #3a56b8;
}

.window h2 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 2px solid #3a56b8;
  padding-bottom: 8px;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 8px;
  background: #0b1a4d;
  color: #9db4ff;
  border: 2px solid #3a56b8;
  cursor: pointer;
  font-family: inherit;
}
.tab.active { background: #3a56b8; color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.auth-form input {
  padding: 10px;
  background: #050d2e;
  border: 2px solid #3a56b8;
  color: #fff;
  font-family: inherit;
}

button {
  padding: 12px;
  background: #050d2e;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
button:hover { background: #3a56b8; }
button.secondary {
  margin-top: 16px;
  border-color: #6a7bbf;
  color: #9db4ff;
}

.error { color: #ff8a8a; min-height: 1.2em; font-size: 0.85rem; }

#screen-town .window button { width: 100%; margin-bottom: 10px; }

.source-ref { color: #9db4ff; font-size: 0.75rem; margin-bottom: 8px; }
.question-body { line-height: 1.7; margin-bottom: 20px; }
.hint-btn { width: 100%; margin: 0 0 14px; font-size: 0.85rem; }
.hint-btn:disabled { cursor: default; opacity: 0.5; }

.choices { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.choices button {
  width: 100%;
  text-align: left;
  padding: 12px;
}
.choices button.correct { background: #1f5c33; border-color: #6ee89b; }
.choices button.wrong { background: #5c1f1f; border-color: #ff8a8a; }
.choices button:disabled { cursor: default; opacity: 0.85; }

.result { margin-top: 12px; padding: 12px; border-top: 2px solid #3a56b8; }

#btn-explain { width: 100%; margin: 10px 0; }
.explain-box {
  background: #050d2e;
  border: 2px solid #ffd76e;
  padding: 12px;
  margin: 10px 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #ffe9b0;
}
.explain-box[hidden] { display: none; }

.status-bar {
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px;
  margin-bottom: 4px;
  background: #050d2e;
  border-top: 2px solid #3a56b8;
  border-bottom: 2px solid #3a56b8;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.status-bar[hidden] { display: none; }

.streak-badge {
  color: #9db4ff;
  opacity: 0.7;
  filter: grayscale(1);
}
.streak-badge.streak-active {
  color: #ffd76e;
  opacity: 1;
  filter: none;
}

.monster-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
  background: #050d2e;
  border: 2px solid #3a56b8;
}
.monster-sprite {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.5));
}
.monster-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.monster-name { font-size: 0.9rem; }

.hpbar {
  width: 100%;
  height: 14px;
  background: #3a1010;
  border: 2px solid #fff;
  padding: 1px;
}
.hpbar-fill {
  height: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,0,0,0.35) 2px 3px),
    linear-gradient(180deg, #8ef5b0, #2fa860);
  transition: width 0.3s ease;
}
.hpbar-fill.low {
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,0,0,0.35) 2px 3px),
    linear-gradient(180deg, #ffb0b0, #c23a3a);
}
.hpbar-label { font-size: 0.7rem; color: #9db4ff; }

.monster-sprite { transition: transform 0.15s ease; }
.monster-sprite.hit { animation: monster-hit 0.35s ease; }
@keyframes monster-hit {
  0% { transform: translateX(0); filter: drop-shadow(0 6px 6px rgba(0,0,0,0.5)) brightness(1); }
  20% { transform: translateX(-6px); filter: drop-shadow(0 6px 6px rgba(0,0,0,0.5)) brightness(2.5) saturate(0); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  100% { transform: translateX(0); filter: drop-shadow(0 6px 6px rgba(0,0,0,0.5)) brightness(1); }
}

/* モンスター撃破時: 白く発光しながら縮んで消える */
.monster-sprite.defeated {
  animation: monster-defeat 0.7s ease forwards;
}
@keyframes monster-defeat {
  0% { transform: scale(1); filter: brightness(1) saturate(1); opacity: 1; }
  25% { transform: scale(1.12); filter: brightness(3) saturate(0); opacity: 1; }
  100% { transform: scale(0.4) translateY(12px); filter: brightness(3) saturate(0); opacity: 0; }
}

.status-bar.player-hit { animation: player-hit-flash 0.4s ease; }
@keyframes player-hit-flash {
  0% { background: #050d2e; }
  30% { background: #5c1f1f; }
  100% { background: #050d2e; }
}

.confusion-badge {
  color: #ffd76e;
  font-size: 0.8rem;
  margin: 0 0 8px;
  animation: confusion-pulse 1s ease-in-out infinite;
}
.confusion-badge[hidden] { display: none; }
@keyframes confusion-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.choices.shuffling li { animation: shuffle-in 0.4s ease; }
.choices.shuffling li:nth-child(1) { animation-delay: 0.02s; }
.choices.shuffling li:nth-child(2) { animation-delay: 0.06s; }
.choices.shuffling li:nth-child(3) { animation-delay: 0.10s; }
.choices.shuffling li:nth-child(4) { animation-delay: 0.14s; }
.choices.shuffling li:nth-child(5) { animation-delay: 0.18s; }
@keyframes shuffle-in {
  0% { transform: translateX(-14px) rotate(-2deg); opacity: 0.3; }
  50% { transform: translateX(10px) rotate(2deg); opacity: 0.7; }
  100% { transform: translateX(0) rotate(0deg); opacity: 1; }
}

.hint { color: #9db4ff; font-size: 0.75rem; margin: -4px 0 10px; }

.log-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
  z-index: 4;
}

/* ==== 戦闘画面(P0刷新) ==== */

.battle-view { display: flex; flex-direction: column; gap: 0; }

.battle-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  overflow: hidden;
  border: 3px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #26314b;
  background: #101820;
}

.battle-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: background-image 0.2s ease;
}
.battle-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,12,0.15) 0%, rgba(5,8,12,0.05) 60%, rgba(5,8,12,0.55) 100%);
}

.enemy-pane {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4%;
  width: min(80%, 420px);
}
.enemy-info {
  width: 100%;
  max-width: 240px;
  padding: 8px 12px;
  background: rgba(11, 26, 77, 0.85);
  border: 2px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.enemy-pane .monster-sprite {
  width: clamp(120px, 34vw, 240px);
  height: clamp(120px, 34vw, 240px);
  object-fit: contain;
}
/* ボスは通常モンスターよりさらに一回り大きく、迫力を出す */
.enemy-pane .boss-sprite {
  width: clamp(140px, 40vw, 280px);
  height: clamp(140px, 40vw, 280px);
}

.player-pane {
  position: absolute;
  left: 3%;
  bottom: 4%;
  z-index: 2;
}
/* 主人公の立ち絵をステータス枠の中(左端)に埋め込む */
.hero-sprite {
  width: clamp(40px, 9vw, 64px);
  height: clamp(40px, 9vw, 64px);
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
  flex-shrink: 0;
}
.player-info {
  min-width: 160px;
  padding: 8px 12px;
  background: rgba(11, 26, 77, 0.85);
  border: 2px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.player-info-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.player-info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
.player-name { font-weight: bold; }

.mpbar {
  width: 100%;
  height: 10px;
  background: #101830;
  border: 2px solid #fff;
  padding: 1px;
}
.mpbar-fill {
  height: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,0,0,0.35) 2px 3px),
    linear-gradient(180deg, #8fc4ff, #4b8ed8);
  transition: width 0.3s ease;
}

.player-pane.player-hit .player-info { animation: player-hit-flash 0.4s ease; }

.battle-stage.shake { animation: stage-shake 0.35s ease; }
@keyframes stage-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* ==== 戦闘開始演出(暗転→ズームイン＋メッセージ) ==== */
.battle-stage.encounter-start {
  animation: encounter-zoom-in 0.4s ease-out;
}
@keyframes encounter-zoom-in {
  0% { opacity: 0; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1); }
}

.encounter-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #000;
  pointer-events: none;
  opacity: 0;
}
.encounter-flash.playing {
  animation: encounter-flash-fade 0.5s ease-out;
}
@keyframes encounter-flash-fade {
  0% { opacity: 1; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

.encounter-window {
  text-align: center;
  padding: 12px 0;
}
.encounter-window[hidden] { display: none; }
.encounter-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  animation: encounter-message-in 0.3s ease-out;
}
@keyframes encounter-message-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.battle-controls {
  border: 3px solid #d9d1ad;
  border-top: none;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #26314b;
  background: #0b1a4d;
  padding: 16px;
}

.command-window .command-prompt { color: #9db4ff; font-size: 0.85rem; margin: 0 0 14px; }
.command-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
/* コマンドが「こうげき」「にげる」の2つだけになった分、1つ1つを大きめにして
   余白が寂しく見えないようにする */
.command-btn {
  width: 100%;
  text-align: left;
  padding: 20px 16px;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.flavor-window p { line-height: 1.7; margin: 0 0 12px; }

.quiz-window .source-ref { margin-top: 0; }

.battle-back-btn { width: 100%; max-width: 1100px; margin-top: 12px; }

@media (max-width: 640px) {
  .battle-stage { aspect-ratio: 1 / 1; min-height: 280px; max-height: 60vh; }
  .command-list { grid-template-columns: 1fr; }
}

/* ==== 街(町マップ、P1刷新) ==== */

.town-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.town-topbar h2 {
  margin: 0;
  font-size: 1.05rem;
  border: none;
  padding: 0;
}
.town-topbar button { padding: 8px 14px; font-size: 0.8rem; }

.town-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  border: 3px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #26314b;
  background: #101820;
}
.town-ground {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.town-info-panel {
  margin-top: 10px;
  padding: 12px 16px;
  min-height: 76px;
  background: #0b1a4d;
  border: 3px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #26314b;
}
.town-info-name {
  margin: 0 0 4px;
  color: #ffd76e;
  font-size: 0.9rem;
  font-weight: bold;
}
.town-info-desc {
  margin: 0;
  color: #e8ecff;
  font-size: 0.85rem;
  line-height: 1.7;
  animation: encounter-message-in 0.25s ease-out;
}

.town-building {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  width: var(--bw);
  transform: translate(-50%, -100%);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.town-building img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,0.45));
}
.town-building:hover,
.town-building:focus-visible {
  transform: translate(-50%, -100%) translateY(-4px);
}
.town-building:hover img {
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.55)) brightness(1.08);
}
.town-building-label {
  /* 画像の直下に絶対配置し、ラベルの文字高さがtown-buildingのtranslateY(-100%)計算に
     混ざらないようにする(混ざると--byの見た目位置が画面幅ごとのフォント比率で変わり、
     見切れの原因になる)。 */
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(11, 26, 77, 0.9);
  border: 1px solid #d9d1ad;
  white-space: nowrap;
}

.town-submenu {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 46, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}
.town-submenu[hidden] { display: none; }
.town-submenu .command-window {
  width: 100%;
  max-width: 360px;
  border: 3px solid #d9d1ad;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #26314b;
  background: #0b1a4d;
  padding: 16px;
}
.town-submenu .command-list { grid-template-columns: 1fr; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 46, 0.9);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 10;
}
.overlay[hidden] { display: none; }
.overlay .window { margin-top: 40px; max-height: 80vh; overflow-y: auto; }

.log-list { padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 0.85rem; }
.log-list li { border-bottom: 1px solid #3a56b8; padding-bottom: 10px; }
.log-list .log-source { color: #9db4ff; font-size: 0.7rem; margin-bottom: 2px; }
.log-list .log-body { margin: 4px 0; line-height: 1.5; }
.log-list .log-correct { color: #6ee89b; }
.log-list .log-wrong { color: #ff8a8a; }

.battle-message {
  text-align: center;
  padding: 20px;
  font-size: 1rem;
  line-height: 1.8;
}

.boss-area { border-color: #ff8a8a; }
.boss-sprite.hit { animation: monster-hit 0.35s ease; }

/* ボス戦専用: 登場時にバウンドしながら降りてくる演出(「導入を全部盛りに」対応) */
.boss-sprite.encounter-enter {
  animation: boss-encounter-drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes boss-encounter-drop {
  0% { transform: translateY(-70px) scale(0.7); opacity: 0; }
  55% { transform: translateY(10px) scale(1.06); opacity: 1; }
  75% { transform: translateY(-5px) scale(0.98); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.battle-stage.boss-stage {
  border-color: #ff8a8a;
  box-shadow: 0 0 0 2px #05080c, inset 0 0 0 2px #5c2a2a;
}
.boss-bg {
  background-image: url(../images/backgrounds/battle-exam-hall.png);
}
.boss-enemy-info { border-color: #ff8a8a; }
.boss-vs-label { color: #ffb0b0; }

.confirm-actions { display: flex; gap: 10px; margin-top: 12px; }
.confirm-actions button { flex: 1; }

.boss-progress { color: #9db4ff; font-size: 0.75rem; margin: 0 0 8px; }

.boss-hp-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.boss-hp-segments .seg {
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, #8ef5b0, #2fa860);
  border: 1px solid #0a0a1e;
  transition: background 0.2s ease;
}
.boss-hp-segments .seg.empty { background: #3a1010; }

.boss-final-score {
  font-size: 1.2rem;
  text-align: center;
  margin: 4px 0 20px;
}
.boss-final-score.passed { color: #6ee89b; }
.boss-final-score.failed { color: #ff8a8a; }

.window h3 {
  font-size: 0.9rem;
  color: #9db4ff;
  margin: 20px 0 8px;
  border-bottom: 1px solid #3a56b8;
  padding-bottom: 6px;
}

.mypage-summary { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.mypage-summary p { margin: 0; }

.chart-wrap {
  position: relative;
  height: 180px;
  background: #050d2e;
  border: 2px solid #3a56b8;
  padding: 8px;
  margin-bottom: 8px;
}

.weakness-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}
.weakness-list li {
  padding: 8px;
  background: #050d2e;
  border: 2px solid #3a56b8;
}

.ai-advice-box { margin: 16px 0; }
.ai-advice-box button:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-advice-box button:disabled:hover { background: #050d2e; }

.dex-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dex-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #050d2e;
  border: 2px solid #3a56b8;
}
.dex-item.locked { opacity: 0.55; border-color: #2a3a7a; }
.dex-sprite { width: 40px; height: 40px; image-rendering: pixelated; }
.dex-sprite.dex-silhouette { filter: brightness(0) saturate(0); opacity: 0.6; }
.dex-info { display: flex; flex-direction: column; gap: 2px; }
.dex-name { font-size: 0.9rem; }
.dex-meta { font-size: 0.7rem; color: #9db4ff; }

.achievement-toast { color: #ffd76e; font-size: 0.85rem; margin: 4px 0; }

.chat-messages {
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #050d2e;
  border: 2px solid #3a56b8;
}
.chat-empty { color: #9db4ff; font-size: 0.85rem; text-align: center; margin: auto; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.chat-bubble-user {
  align-self: flex-end;
  background: #3a56b8;
  color: #fff;
}
.chat-bubble-model {
  align-self: flex-start;
  background: #0b1a4d;
  border: 2px solid #ffd76e;
  color: #ffe9b0;
}

.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1;
  padding: 10px;
  background: #050d2e;
  border: 2px solid #3a56b8;
  color: #fff;
  font-family: inherit;
  resize: none;
}
.chat-form button { flex-shrink: 0; }
