:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --accent: #38bdf8;
  --coral: #fb7185;
  --coral-text: #4a1020;
  --amber: #fbbf24;
  --danger: #ef4444;
  --dot: #1c2740;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--text); }
button, input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }

/* ---- 汎用ボタン ---- */
.btn {
  border: 1px solid var(--line);
  background: #0f172a;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #07263a; border: none; font-weight: 700; }

/* ---- SpeakUp 吹き出しロゴ ---- */
.su-logo {
  position: relative; display: inline-block;
  background: #13233f; border: 1.6px solid var(--accent); border-radius: 16px;
  padding: 9px 20px;
}
.su-logo::after {
  content: ""; position: absolute; left: 24px; bottom: -9px; width: 15px; height: 15px;
  background: #13233f; border-right: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent);
  transform: rotate(45deg);
}
.su-logo b { font-weight: 700; font-size: 1.8rem; letter-spacing: -0.5px; color: var(--text); }
.su-logo b .up { color: var(--accent); }
.su-logo.sm { padding: 6px 14px; }
.su-logo.sm b { font-size: 1.15rem; }

/* ---- ふわっと吹き出し背景 ---- */
.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-decor .b { position: absolute; border-radius: 14px; opacity: .14; }
.bg-decor .b::after { content: ""; position: absolute; left: 16px; bottom: -8px; width: 15px; height: 15px; background: inherit; border-radius: 2px; transform: rotate(45deg); }
.btn.danger { border-color: var(--danger); color: #fca5a5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   部屋作成(index.html)
   ============================================================ */
.create-wrap {
  max-width: 600px; margin: 0 auto; padding: 32px 16px;
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 1;
}
.su-hero { text-align: center; margin-bottom: 10px; }
.su-hero .su-logo { margin-bottom: 22px; }
.su-hero .lead { color: var(--muted); margin: 0 0 24px; line-height: 1.6; }
.field-label { display: block; font-size: 0.85rem; color: var(--muted); margin: 16px 0 8px; }
.input, .ta {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.05rem;
  padding: 12px;
}
.input:focus, .ta:focus { outline: 2px solid var(--accent); }
.presets { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.preset {
  text-align: left; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 0.95rem;
}
.preset:hover { border-color: var(--accent); }

.links-box { margin-top: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.link-row { margin-bottom: 16px; }
.link-row:last-child { margin-bottom: 0; }
.link-row .cap { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.link-row .cap.admin { color: #fca5a5; }
.link-flex { display: flex; gap: 8px; }
.link-flex .input { font-size: 0.85rem; }
.warn { background: #422006; border: 1px solid #b45309; color: #fde68a; border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; line-height: 1.5; margin-top: 12px; }
#qrbox { margin-top: 14px; text-align: center; }
#qrbox > div { display: inline-block; background: #fff; padding: 8px; border-radius: 10px; }

/* ============================================================
   参加者(post.html)
   ============================================================ */
.app { display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }
.su-postbar { text-align: center; padding: 14px 16px 0; }
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar .title { font-size: 1.25rem; font-weight: 700; flex: 1 1 auto; min-width: 0; }
.count-badge { background: var(--accent); color: #07263a; font-weight: 700; border-radius: 999px; padding: 6px 14px; font-size: 0.95rem; }

.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); }
.tab { flex: 1; text-align: center; padding: 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; font-size: 1.05rem; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

.tabpane { flex: 1; min-height: 0; display: flex; }
.tabpane.hidden { display: none; }

.post-form { max-width: 560px; margin: 0 auto; padding: 20px 16px; width: 100%; }
.post-prompt { font-size: 1.5rem; font-weight: 700; line-height: 1.5; margin: 4px 0 16px; }
.notice { background: #422006; border: 1px solid #b45309; color: #fde68a; border-radius: 10px; padding: 12px 14px; font-size: 1rem; line-height: 1.5; margin-bottom: 16px; }
.post-body { min-height: 120px; resize: vertical; }
.counter { text-align: right; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.counter.over { color: var(--danger); }
.submit-btn { margin-top: 18px; width: 100%; padding: 16px; font-size: 1.15rem; font-weight: 700; border: none; border-radius: 12px; background: var(--accent); color: #07263a; cursor: pointer; }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.flash { margin-top: 16px; padding: 14px; border-radius: 10px; text-align: center; font-weight: 700; }
.flash.ok { background: #064e3b; color: #6ee7b7; }
.flash.err { background: #450a0a; color: #fca5a5; }

/* ============================================================
   ボード(共有/管理)— post.html のボードタブ & board.html
   ============================================================ */
.stage {
  position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden;
  background-color: #0b1220;
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.board-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.25rem; pointer-events: none; }

.note {
  position: absolute; width: 210px; padding: 14px 16px 15px;
  border-radius: 14px; border: 0.5px solid rgba(0,0,0,.18);
  color: #2C2C2A; box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: left .25s ease, top .25s ease;
  animation: popin .42s cubic-bezier(.2,1.3,.4,1) both;
}
.note.noanim { animation: none; }
.note.dragging { transition: none; cursor: grabbing; box-shadow: 0 12px 28px rgba(0,0,0,.5); }
.note .nbody { font-size: 18px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.note .nhide { position: absolute; top: 5px; right: 5px; background: transparent; border: none; color: rgba(0,0,0,.4); font-size: 1rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.note:hover .nhide { opacity: 1; }
@keyframes popin { 0% { opacity: 0; transform: scale(.5); } 70% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }

/* 管理者のボードはドラッグ可能 */
.stage.draggable .note { cursor: grab; }

.closed-banner { background: #450a0a; color: #fca5a5; text-align: center; padding: 8px; font-size: 0.9rem; font-weight: 700; }
