/* Brainstorm Arena — 爽やか透明感テーマ (スカイブルー × ミント × ガラス) */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #eef6fb;
  --text: #2c4560;
  --dim: #7d95ad;
  --sky: #4aa3e8;
  --mint: #45c4a5;
  --coral: #f2989d;
  --amber: #f0b26b;
  --danger: #e57373;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-edge: rgba(150, 190, 225, 0.4);
  --glass-blur: blur(14px);
}

html, body { height: 100%; }
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background:
    radial-gradient(900px 500px at 15% -5%, #d8edfb 0%, transparent 60%),
    radial-gradient(800px 500px at 105% 10%, #d9f4ec 0%, transparent 55%),
    radial-gradient(700px 500px at 50% 110%, #e4f0fa 0%, transparent 60%),
    linear-gradient(180deg, #f2f9fd 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.dim { color: var(--dim); }

.view { min-height: 100vh; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 28px rgba(120, 160, 200, 0.16);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.btn {
  cursor: pointer;
  border: 1px solid var(--panel-edge);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  transition: transform .08s, box-shadow .2s, background .2s;
  backdrop-filter: var(--glass-blur);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(120, 160, 200, 0.25); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, #5ab6f2, #49c9a9); border: none; color: #fff; }
.btn.big { font-size: 18px; padding: 14px 26px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

input, select {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #c9dff0;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
input::placeholder { color: #a4b8cc; }
input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(74, 163, 232, 0.15); }
label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 4px; }
label input, label select { margin-top: 5px; }

/* ---------- ランディング ---------- */
.landing-wrap { max-width: 860px; margin: 0 auto; padding: 48px 20px; }
.logo { font-size: 44px; text-align: center; letter-spacing: 1px; color: #34506e; }
.logo span { background: linear-gradient(90deg, var(--sky), var(--mint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { text-align: center; color: var(--dim); margin: 8px 0 24px; font-size: 16px; }

/* ツールチップ (ホバー/フォーカスで詳細を表示) */
.tip { position: relative; cursor: help; outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%) translateY(-4px);
  background: #33475e; color: #fff; font-size: 12px; font-weight: normal;
  padding: 9px 13px; border-radius: 10px; line-height: 1.6;
  width: max-content; max-width: 280px; white-space: normal; text-align: left;
  box-shadow: 0 8px 24px rgba(50, 80, 110, 0.3);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 45;
}
.tip::before {
  content: ''; position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: #33475e;
  opacity: 0; transition: opacity .15s; z-index: 45;
}
.tip:hover::after, .tip:focus::after, .tip:focus-within::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tip:hover::before, .tip:focus::before, .tip:focus-within::before { opacity: 1; }
/* 吹き出しが後続パネルの裏に隠れないよう、表示中はそのパネルごと前面へ */
.panel { position: relative; }
.panel:has(.tip:hover), .panel:has(.tip:focus), .panel:has(.tip:focus-within) { z-index: 40; }

/* あそびかた 3ステップ */
.howto { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 13px 18px 11px; margin-bottom: 24px; }
.howto-solo { flex-basis: 100%; display: flex; justify-content: center; margin-top: 2px; }
.solo-chip {
  font-size: 12.5px; font-weight: 700; color: #2e9c81;
  background: rgba(69, 196, 165, 0.12); border: 1px dashed rgba(69, 196, 165, 0.5);
  border-radius: 99px; padding: 4px 14px;
}
.solo-chip:hover { background: rgba(69, 196, 165, 0.2); }
.howto-step { flex: 1; text-align: center; display: flex; flex-direction: row; gap: 8px; align-items: center; justify-content: center; border-radius: 10px; padding: 4px; }
.howto-step:hover { background: rgba(120, 170, 220, 0.08); }
.howto-step b { font-size: 14px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5ab6f2, #49c9a9); color: #fff; font-weight: 800; font-size: 14px;
}
.howto-arrow { align-self: center; color: #a4c4dd; font-size: 20px; font-weight: 700; flex: none; }

/* 認証まわり */
.user-bar {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin-bottom: 18px; font-size: 13.5px; color: var(--text);
}
.user-pic { width: 26px; height: 26px; border-radius: 50%; }
.user-badge { background: var(--sky); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.auth-panel { max-width: 470px; margin: 0 auto 22px; text-align: center; }
.auth-panel h2 { font-size: 18px; margin-bottom: 6px; }
.auth-panel p { font-size: 13px; margin-bottom: 14px; }
.google-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #d5e0ec; font-size: 15px; padding: 11px 22px;
}
.activate-row { display: flex; gap: 8px; }
.activate-row input { flex: 1; text-align: center; letter-spacing: 2px; font-weight: 700; }
.admin-note { font-size: 12.5px; margin-bottom: 12px; line-height: 1.6; }

/* 管理画面 */
.admin-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 18px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; }
.admin-head h1 { font-size: 26px; color: #34506e; }
.admin-wrap h3 { margin-bottom: 6px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.6); border-radius: 12px; padding: 9px 12px; font-size: 13.5px;
}
.user-row.off { opacity: .6; }
.user-row .user-pic.ph { display: flex; align-items: center; justify-content: center; background: #dce8f2; font-size: 14px; }
.u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.u-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-actions { display: flex; gap: 6px; flex: none; }
.u-badge { font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.u-badge.admin { background: var(--sky); color: #fff; }
.u-badge.ok { background: rgba(69, 196, 165, 0.18); color: #2e9c81; }
.u-badge.off { background: rgba(150, 160, 175, 0.2); color: #6d7b8c; }
.btn.danger { color: #c85a5a; border-color: #e8bcbc; }
.btn.danger:hover { background: #fbeeee; }
.admin-issue { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.admin-issue label { flex: 1; margin: 0; }
.invite-list { display: flex; flex-direction: column; gap: 6px; }
.invite-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 7px 10px; font-size: 13px;
}
.invite-row code { font-weight: 800; letter-spacing: 1px; color: #2b7cc0; }
.invite-row.spent { opacity: .55; }
.inv-status { color: var(--dim); font-size: 12px; }

/* スタートパネル (タブ + フォーム一体型) */
.start-panel { max-width: 520px; margin: 0 auto 22px; padding: 0; overflow: hidden; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; }
.tab {
  cursor: pointer; padding: 14px 10px 12px;
  background: rgba(210, 228, 242, 0.45);
  border: none; border-bottom: 2px solid var(--panel-edge);
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  font-family: inherit; font-weight: 700; font-size: 14.5px; color: var(--dim);
  transition: background .15s, color .15s, border-color .15s;
}
.tab + .tab { border-left: 1px solid var(--panel-edge); }
.tab small { font-size: 11px; font-weight: normal; line-height: 1.4; }
.tab:hover { background: rgba(210, 228, 242, 0.7); }
.tab.active {
  background: transparent; color: #2b7cc0;
  border-bottom-color: var(--sky);
}
.tab-body { padding: 20px 22px 22px; }
.tab-body .btn { width: 100%; margin-top: 18px; }
.btn-sub { display: block; font-size: 12px; font-weight: 600; opacity: .85; margin-top: 3px; }
.hint { display: none; font-weight: normal; font-size: 11.5px; color: #93aabf; margin-top: 4px; line-height: 1.5; }
label:hover .hint, label:focus-within .hint { display: block; }
.rules-intro.compact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 18px; }
.rules-label { font-weight: 800; font-size: 13.5px; color: #34506e; margin-right: 4px; }
.rule-chip {
  background: rgba(255, 255, 255, 0.75); border: 1px solid var(--panel-edge);
  border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--text);
}
.rule-chip:hover { border-color: var(--sky); background: #fff; }

/* ---------- ロビー ---------- */
.lobby-wrap { max-width: 640px; margin: 0 auto; padding: 60px 20px; }
.lobby-main { text-align: center; }
.room-label { color: var(--dim); font-size: 13px; }
.room-code {
  font-size: 64px; font-weight: 900; letter-spacing: 14px;
  background: linear-gradient(90deg, var(--sky), var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 6px 0 10px;
}
.lobby-theme { margin-bottom: 20px; }
.join-url { font-size: 13px; margin: -2px 0 16px; }
.join-url b { color: var(--sky); font-weight: 700; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.75); border: 1px solid var(--panel-edge);
  padding: 7px 12px; border-radius: 999px; font-size: 14px;
  animation: pop .3s ease;
}
.chip .role { font-size: 11px; color: #fff; background: var(--mint); border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.chip.host .role { background: var(--sky); }
.host-controls { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.host-controls label { width: 260px; text-align: left; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 15px !important; color: var(--text) !important; }
.toggle input { width: auto; }
#btn-start { margin-top: 16px; }
.solo-note { font-size: 12.5px; margin-top: 10px; }

/* ---------- ゲームヘッダー ---------- */
.game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 6px; gap: 16px;
}
.gh-theme { font-size: 17px; font-weight: 800; }
.gh-phase { font-size: 12px; color: var(--sky); font-weight: 700; letter-spacing: 1px; }
.gh-center { position: relative; width: 72px; height: 72px; flex: none; }
.timer-ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #d5e7f5; stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--sky); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 194.8; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .5s; }
.timer-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.gh-right { text-align: right; }
.team-score { font-size: 14px; color: var(--dim); }
.team-score b { color: var(--sky); font-size: 20px; }
.level-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 4px; }
.level-bar { width: 120px; height: 8px; background: #d5e7f5; border-radius: 99px; overflow: hidden; }
#level-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--sky), var(--mint)); transition: width .5s; }

.rules-strip { display: flex; gap: 14px; padding: 2px 20px 8px; font-size: 12px; color: var(--dim); align-items: center; }
.host-strip { display: flex; gap: 6px; margin-left: auto; }
.skip-btn { background: linear-gradient(135deg, #f2b8a0, #f2989d); border: none; color: #fff; }
.sound-btn { padding: 3px 10px; }
.rules-strip .sound-btn:first-child, .host-strip.hidden + .sound-btn { margin-left: auto; }
.gacha-btn { width: auto !important; margin: 2px 0 0 !important; align-self: flex-start; }
.sound-btn.sound-off { opacity: .55; }

/* 🎤 音声入力中の脈動 */
#btn-voice.listening {
  background: #e57373; color: #fff; border-color: #e57373;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 115, 115, 0.5); }
  50% { box-shadow: 0 0 0 9px rgba(229, 115, 115, 0); }
}

/* ---------- ゲーム本体 ---------- */
.game-body { display: flex; gap: 14px; padding: 0 20px; align-items: flex-start; }
.board-wrap { flex: 1; min-width: 0; position: relative; }

/* オートコンボ演出: 素材カード → 融合カードへのエネルギー線 */
#fusion-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; transition: opacity 1.4s; }
#fusion-fx.fade-out { opacity: 0; }
.fusion-line {
  fill: none; stroke: #a88ce0; stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 12 9; opacity: .9;
  filter: drop-shadow(0 0 6px rgba(168, 140, 224, 0.9));
  animation: dashFlow .4s linear infinite;
}
.fusion-line-glow {
  fill: none; stroke: rgba(200, 170, 250, 0.35); stroke-width: 12; stroke-linecap: round;
  filter: blur(4px);
}
@keyframes dashFlow { to { stroke-dashoffset: -21; } }
.fusion-orb { filter: drop-shadow(0 0 8px #a88ce0); }

/* 画面フラッシュ */
.fx-flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 55;
  background: radial-gradient(circle at 50% 40%, rgba(200, 170, 255, 0.5), rgba(200, 170, 255, 0.08) 70%);
  animation: flashOut .6s ease-out forwards;
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* 格闘ゲーム風コンボ文字 */
.fx-combo-callout {
  position: fixed; top: 24%; left: 50%; z-index: 60; pointer-events: none;
  transform: translateX(-50%);
  font-size: 58px; font-weight: 900; font-style: italic; letter-spacing: 2px; white-space: nowrap;
  background: linear-gradient(90deg, #5ab6f2, #a88ce0, #f2989d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 16px rgba(168, 140, 224, 0.7)) drop-shadow(0 0 2px #fff);
  animation: comboCallout 1.65s cubic-bezier(.2, 1.3, .4, 1) forwards;
}
@keyframes comboCallout {
  0% { transform: translateX(-50%) scale(2.8) rotate(-8deg); opacity: 0; }
  16% { transform: translateX(-50%) scale(1) rotate(-3deg); opacity: 1; }
  74% { transform: translateX(-50%) scale(1.02) rotate(-3deg); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.1) rotate(-3deg); opacity: 0; }
}

/* 着弾の衝撃波リング + 火花 */
.fx-ring {
  position: absolute; width: 20px; height: 20px;
  border: 3px solid #c9b0f2; border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px #a88ce0);
  animation: ringOut .75s ease-out forwards;
}
@keyframes ringOut {
  to { width: 200px; height: 200px; opacity: 0; border-width: 1px; }
}
.fx-spark {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: sparkFly .8s ease-out forwards;
}
@keyframes sparkFly {
  from { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  to { transform: translate(calc(var(--dx) - 50%), calc(var(--dy) - 50%)) scale(.2); opacity: 0; }
}

/* 連鎖時の画面シェイク */
body.shake { animation: screenShake .55s ease-in-out; }
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 3px); }
  30% { transform: translate(6px, -4px); }
  45% { transform: translate(-5px, -3px); }
  60% { transform: translate(4px, 3px); }
  75% { transform: translate(-3px, 1px); }
  90% { transform: translate(2px, -1px); }
}
.card.fusion-source { border-color: #a88ce0 !important; animation: sourcePulse .9s ease-in-out infinite; }
.card.fusion-source::after {
  content: '⚗️ 素材!'; position: absolute; top: -9px; right: 10px;
  background: #a88ce0; color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 99px; padding: 1px 8px;
}
@keyframes sourcePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(168, 140, 224, 0.35); }
  50% { box-shadow: 0 0 24px rgba(168, 140, 224, 0.95); }
}
/* フェーズ1-2: 卵状態 (中身は見えず、⚗️が揺れる) */
.card.fusion-forming { animation: eggPulse 1s ease-in-out infinite; border-color: #c9b0f2; }
.card.fusion-forming .author, .card.fusion-forming .text, .card.fusion-forming .base-ref,
.card.fusion-forming .card-actions, .card.fusion-forming .fusion-tag,
.card.fusion-forming .combo-tag, .card.fusion-forming .yellow-tag { opacity: 0; }
.card.fusion-forming::after {
  content: '⚗️'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; animation: eggWobble 1s ease-in-out infinite;
}
@keyframes eggPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(168, 140, 224, 0.35); background: rgba(243, 238, 253, 0.85); }
  50% { box-shadow: 0 0 26px rgba(168, 140, 224, 0.85); background: rgba(236, 228, 252, 0.95); }
}
@keyframes eggWobble {
  0%, 100% { transform: scale(1) rotate(-8deg); }
  50% { transform: scale(1.25) rotate(8deg); }
}

/* フェーズ3: 実体化 (ぼやけた状態から徐々にはっきり) */
.card.fusion-materializing { animation: materialize 2.1s ease forwards; }
.card.fusion-materializing::after {
  content: '⚗️'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; animation: eggFade 1.2s ease forwards;
}
@keyframes materialize {
  0% { filter: blur(9px) saturate(.4); opacity: .35; transform: scale(.94); }
  100% { filter: blur(0) saturate(1); opacity: 1; transform: scale(1); }
}
@keyframes eggFade {
  from { opacity: 1; }
  to { opacity: 0; transform: scale(2); }
}

/* フェーズ4: 完成の白発光 */
.card.fusion-complete { animation: completeFlash 1.1s ease forwards; }
@keyframes completeFlash {
  0% { box-shadow: 0 0 14px rgba(255, 255, 255, 0.3); transform: scale(1); }
  30% { box-shadow: 0 0 50px rgba(255, 255, 255, 0.95), 0 0 90px rgba(168, 140, 224, 0.9); transform: scale(1.09); }
  100% { box-shadow: 0 0 16px rgba(160, 130, 220, 0.5); transform: scale(1); }
}
.vote-banner { background: linear-gradient(90deg, rgba(90, 182, 242, 0.15), rgba(73, 201, 169, 0.15));
  border: 1px solid rgba(74, 163, 232, 0.45);
  border-radius: 12px; padding: 10px 16px; margin-bottom: 12px; font-size: 15px;
  backdrop-filter: var(--glass-blur); }
.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; padding-bottom: 140px;
}

.card {
  border-radius: 14px; padding: 12px 12px 8px;
  background: rgba(255, 255, 255, 0.78); border: 1px solid var(--panel-edge);
  border-top: 4px solid var(--author-color, var(--sky));
  animation: dealIn .45s cubic-bezier(.2, 1.4, .4, 1);
  position: relative;
  box-shadow: 0 4px 14px rgba(120, 160, 200, 0.14);
  backdrop-filter: var(--glass-blur);
}
.card.wild { box-shadow: 0 0 16px rgba(240, 178, 107, 0.4); border-color: var(--amber); }
.card.fusion { border-color: #b79ce8; box-shadow: 0 0 16px rgba(160, 130, 220, 0.3); border-top-color: #b79ce8; }
.card .fusion-tag {
  position: absolute; top: -9px; left: 10px;
  background: linear-gradient(90deg, #5ab6f2, #a88ce0); color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px;
}
.card .fusion-tag.chain { background: linear-gradient(90deg, #a88ce0, #f2989d); animation: fusionPulse 1.6s ease-in-out infinite; }
@keyframes fusionPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(168, 140, 224, 0.5); }
  50% { box-shadow: 0 0 12px rgba(168, 140, 224, 0.9); }
}
.fusion-ref { border-left-color: #cbb8ec !important; }
.card.flagged { opacity: .8; border-color: #eebfbf; }
.card .author { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.card .author .ai-tag { font-size: 10px; background: rgba(69, 196, 165, 0.12); color: #2e9c81; border: 1px solid rgba(69, 196, 165, 0.4); padding: 0 6px; border-radius: 99px; }
.card .text { font-size: 14.5px; line-height: 1.45; word-break: break-word; }
.card .combo-tag { position: absolute; top: -9px; right: 10px; background: var(--mint); color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px; }
.card .wild-tag { position: absolute; top: -9px; left: 10px; background: var(--amber); color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px; }
.card .yellow-tag { display: inline-block; margin-top: 6px; font-size: 11px; color: #b98737; background: rgba(240, 178, 107, 0.14); border: 1px solid rgba(240, 178, 107, 0.5); border-radius: 8px; padding: 2px 8px; }
.card .base-ref { font-size: 11px; color: var(--dim); margin-top: 6px; border-left: 3px solid #cfe3f2; padding-left: 6px; }
.card .card-actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.rx { cursor: pointer; border: none; background: rgba(226, 240, 250, 0.9); color: var(--text); border-radius: 99px;
  padding: 2px 8px; font-size: 11.5px; transition: transform .1s; animation: pop .18s ease; }
.rx:hover { transform: scale(1.15); }
.rx-add { background: rgba(255, 255, 255, 0.55); border: 1px dashed #aecbe2; color: var(--dim); }
.rx-add span { font-size: 10px; font-weight: 700; }
.rx.mine { background: rgba(74, 163, 232, 0.18); outline: 1px solid var(--sky); }
.rx.build { background: rgba(69, 196, 165, 0.14); outline: 1px solid rgba(69, 196, 165, 0.5); }
.rx.heart { font-size: 14px; }
.rx.heart.voted { background: rgba(90, 182, 242, 0.25); outline: 1px solid var(--sky); }

/* ---------- サイド ---------- */
.side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 150px); position: sticky; top: 10px; }
.side .panel { padding: 14px; }
.side h3 { font-size: 14px; margin-bottom: 10px; }
.score-panel { max-height: 34vh; overflow-y: auto; }
.score-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.score-row .sr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .sr-pts { font-weight: 800; color: var(--sky); }
.score-row .mini { font-size: 11px; color: var(--dim); }
.feed-panel { flex: 1; display: flex; flex-direction: column; min-height: 200px; }
.feed { flex: 1; overflow-y: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
.feed .f-system { color: #3a8dd0; }
.feed .f-facilitator { color: #2e9c81; }
.feed .f-referee { color: #b98737; background: rgba(240, 178, 107, 0.12); border-radius: 8px; padding: 4px 6px; }
.feed .f-fusion { color: #7c5fc0; background: rgba(168, 140, 224, 0.12); border-radius: 8px; padding: 4px 6px; }
.feed .f-chat b { color: var(--sky); font-weight: 700; }
.feed .f-flag { color: var(--danger); font-size: 11px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { flex: 1; padding: 7px 10px; font-size: 13px; }

/* ---------- 入力バー ---------- */
.input-bar {
  position: fixed; left: 0; right: 320px; bottom: 0;
  padding: 12px 20px 16px;
  background: linear-gradient(transparent, rgba(238, 246, 251, 0.95) 40%);
}
.input-bar form { display: flex; gap: 8px; max-width: 900px; }
.input-bar form .btn { white-space: nowrap; flex: none; }
#idea-input { font-size: 16px; padding: 13px 16px; border-radius: 14px; box-shadow: 0 6px 20px rgba(120, 160, 200, 0.18); }
.build-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(69, 196, 165, 0.14); border: 1px solid var(--mint);
  border-radius: 99px; padding: 4px 12px; font-size: 13px; margin-bottom: 8px; }
.build-chip button { background: none; border: none; color: var(--mint); font-size: 15px; cursor: pointer; }
.hint-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(90, 182, 242, 0.14); border: 1px solid var(--sky);
  border-radius: 99px; padding: 4px 12px; font-size: 13px; margin-bottom: 8px; margin-left: 8px; animation: pop .25s ease; }
.hint-chip button { background: none; border: none; color: var(--sky); font-size: 15px; cursor: pointer; }
.host-inline { margin-top: 8px; display: flex; gap: 8px; }

/* ---------- 結果 ---------- */
.results-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 18px; }
.results-wrap h1 { text-align: center; font-size: 36px; }
.results-theme { text-align: center; color: var(--dim); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; min-height: 210px; }
.pod { width: 200px; text-align: center; animation: pop .5s ease; }
.pod .p-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 10px; font-size: 13.5px; margin-bottom: 8px; backdrop-filter: var(--glass-blur); }
.pod .p-base { border-radius: 10px 10px 0 0; font-size: 26px; font-weight: 900; padding: 10px; color: #fff; }
.pod.p1 .p-base { background: linear-gradient(135deg, #f7cf8b, #f0b26b); height: 84px; }
.pod.p2 .p-base { background: #b9c9d9; height: 60px; }
.pod.p3 .p-base { background: #d8b9a5; height: 44px; }
.pod .p-votes { font-size: 12px; color: var(--sky); font-weight: 800; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.award { background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 12px; font-size: 13px; border: 1px solid var(--panel-edge); }
.award b { color: #3a8dd0; }
.results-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 40vh; overflow-y: auto; }
.r-row { display: flex; gap: 10px; align-items: baseline; font-size: 14px; padding: 6px 8px; background: rgba(255, 255, 255, 0.7); border-radius: 8px; }
.r-row .r-votes { flex: none; color: var(--sky); font-weight: 800; width: 46px; }
.results-wrap .btn { margin-right: 8px; }

/* ---------- エフェクト ---------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.fx-pop {
  position: absolute; font-size: 22px; font-weight: 900; color: var(--sky);
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9);
  animation: floatUp 1.4s ease-out forwards;
}
.fx-pop.combo { color: var(--mint); font-size: 26px; }
.fx-confetti { position: absolute; width: 10px; height: 14px; top: -20px; border-radius: 3px; animation: fall linear forwards; }
.fx-banner {
  position: fixed; top: 30%; left: 50%; transform: translateX(-50%);
  font-size: 40px; font-weight: 900; padding: 18px 40px; border-radius: 20px;
  background: linear-gradient(135deg, #5ab6f2, #49c9a9); color: #fff;
  animation: bannerIn 2.2s ease forwards; box-shadow: 0 20px 50px rgba(100, 150, 200, 0.35);
}
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: #fff; padding: 10px 20px; border-radius: 12px;
  font-weight: 700; z-index: 60; animation: pop .3s ease;
}

@keyframes dealIn { from { transform: translateY(24px) scale(.85) rotate(-2deg); opacity: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes floatUp { from { opacity: 1; } to { transform: translateY(-90px); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes bannerIn {
  0% { transform: translateX(-50%) scale(.3); opacity: 0; }
  15% { transform: translateX(-50%) scale(1.05); opacity: 1; }
  80% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .rules-grid { grid-template-columns: 1fr; }
  .howto { flex-direction: column; align-items: stretch; }
  .howto-arrow { display: none; }
  .game-body { flex-direction: column; }
  .side { width: 100%; position: static; max-height: none; flex-direction: row; }
  .side .panel { flex: 1; }
  .input-bar { right: 0; }
  .podium { flex-wrap: wrap; }
}
