/* css/style.css */
/* Reftria — 黄金羊皮紙ファンタジーテーマ */

:root {
  /* Gold — 深みのある琥珀金（落ち着いたトーン） */
  --gold: #7e5c0a;
  --gold-bright: #9e7408;
  --gold-dim: #5e4408;
  --gold-bg: rgba(126, 92, 10, 0.10);
  --gold-border: rgba(126, 92, 10, 0.30);

  /* Backgrounds — 落ち着いた羊皮紙（中程度の濃さ） */
  --bg-darkest: #c8b688;
  --bg-dark:    #d4c298;
  --bg-panel:   #ddd0a8;
  --bg-body:    #d0be90;

  /* Borders */
  --border:       rgba(100, 72, 8, 0.20);
  --border-light: rgba(100, 72, 8, 0.32);

  /* Text */
  --text-primary:   #1e1004;
  --text-secondary: #3e2408;
  --text-dim:       #6a4818;
  --text-muted:     #8a6428;
  --text-main:      #241305;

  /* Shared UI alias (legacy-compatible) */
  --accent:         #8d620a;
  --card-bg:        rgba(250, 241, 220, 0.94);

  /* Status */
  --red:    #9e1414;
  --green:  #145428;
  --blue:   #1a3494;
  --purple: #5a1eaa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-body);
  background-image:
    radial-gradient(ellipse 120% 60% at 50% 0%,  rgba(210,175,80,0.25) 0%, transparent 65%),
    radial-gradient(ellipse 80%  50% at 50% 100%, rgba(140,100,30,0.14) 0%, transparent 65%),
    linear-gradient(rgba(208,190,144,0.80), rgba(208,190,144,0.80)),
    url('../illust/PC壁紙.png');
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  body {
    background-image:
      radial-gradient(ellipse 120% 60% at 50% 0%,  rgba(210,175,80,0.25) 0%, transparent 65%),
      radial-gradient(ellipse 80%  50% at 50% 100%, rgba(140,100,30,0.14) 0%, transparent 65%),
      linear-gradient(rgba(208,190,144,0.80), rgba(208,190,144,0.80)),
      url('../illust/SP壁紙.png');
    background-attachment: scroll; /* iOS固定背景の不具合回避 */
  }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-darkest); }
::-webkit-scrollbar-thumb { background: #9a7830; border-radius: 3px; }

/* ─── アニメーション ─── */
@keyframes glow {
  0%, 100% { text-shadow: 0 0 18px rgba(196,144,10,0.35), 0 0 50px rgba(196,144,10,0.12); }
  50%       { text-shadow: 0 0 28px rgba(196,144,10,0.65), 0 0 80px rgba(196,144,10,0.22); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* ══════════════════════════════════════
   タイトル画面
══════════════════════════════════════ */
.title-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(210,175,80,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #d4bf90 0%, #c4aa70 100%);
  overflow: hidden;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.title-content {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: fadeIn 1s ease;
}

.title-genre {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.title-logo {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 900;
  color: var(--gold-bright);
  animation: glow 3s ease-in-out infinite;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 8px;
}

.title-sub {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-bottom: 40px;
}

/* ─── 認証フォーム ─── */
.auth-box {
  background: rgba(253, 246, 228, 0.96);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 24px;
  width: min(340px, 90vw);
  margin: 0 auto;
  backdrop-filter: blur(6px);
  box-shadow:
    0 6px 32px rgba(120,80,10,0.18),
    0 1px 0 rgba(255,220,100,0.6) inset,
    0 0 0 1px rgba(154,114,16,0.12);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-darkest);
  border-radius: 6px;
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--gold-bg);
  color: var(--gold-bright);
  border: 1px solid var(--gold-border);
  box-shadow: 0 1px 4px rgba(154,114,16,0.15);
}

.auth-tab:hover:not(.active) { color: var(--text-primary); }

.auth-err {
  color: var(--red);
  font-size: 12px;
  margin-top: 8px;
  min-height: 16px;
}

/* ══════════════════════════════════════
   共通コンポーネント
══════════════════════════════════════ */

/* ─── 入力 ─── */
.g-input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #fffcf4;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 3px rgba(120,80,10,0.08);
}

.g-input:focus {
  border-color: var(--gold-bright);
  box-shadow: inset 0 1px 3px rgba(120,80,10,0.08), 0 0 0 3px rgba(154,114,16,0.12);
}
.g-input::placeholder { color: var(--text-muted); }

.g-select { cursor: pointer; }
.g-num    { width: 80px; display: inline-block; margin-bottom: 0; }

/* ─── ボタン ─── */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: linear-gradient(180deg, #fdf4da 0%, #ecdab0 100%);
  color: var(--text-secondary);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  width: 100%;
  margin-top: 4px;
  box-shadow:
    0 2px 6px rgba(120,80,10,0.14),
    0 1px 0 rgba(255,230,130,0.7) inset,
    0 -1px 0 rgba(120,80,10,0.12) inset;
  position: relative;
  overflow: hidden;
}

.g-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,220,80,0.15) 50%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s;
}

.g-btn:hover:not(:disabled):not(.disabled) {
  border-color: var(--gold-dim);
  background: linear-gradient(180deg, #fff8e8 0%, #f0dcb0 100%);
  color: var(--gold-bright);
  box-shadow:
    0 3px 10px rgba(120,80,10,0.2),
    0 1px 0 rgba(255,230,130,0.8) inset,
    0 -1px 0 rgba(120,80,10,0.15) inset;
}

.g-btn:hover:not(:disabled):not(.disabled)::before {
  opacity: 1;
  animation: shimmer 1.5s infinite;
}

.g-btn:active:not(:disabled):not(.disabled) {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px rgba(120,80,10,0.14),
    0 -1px 0 rgba(255,230,130,0.4) inset;
}

.g-btn.primary {
  background: linear-gradient(180deg, rgba(196,144,10,0.22) 0%, rgba(154,114,16,0.18) 100%);
  border-color: var(--gold-border);
  color: var(--gold-bright);
  font-weight: 600;
  box-shadow:
    0 2px 10px rgba(154,114,16,0.2),
    0 1px 0 rgba(255,220,80,0.5) inset,
    0 -1px 0 rgba(120,80,10,0.15) inset;
}

.g-btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(196,144,10,0.32) 0%, rgba(154,114,16,0.24) 100%);
  border-color: var(--gold-bright);
  box-shadow:
    0 3px 14px rgba(154,114,16,0.28),
    0 1px 0 rgba(255,220,80,0.6) inset;
}

.g-btn.sm {
  width: auto;
  padding: 5px 10px;
  font-size: 11px;
  margin-top: 0;
}

.g-btn:disabled,
.g-btn.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ─── 共通テキスト ─── */
.sec-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 6px;
  margin-bottom: 12px;
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}

.sec-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.sec-count {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.empty {
  color: var(--text-dim);
  font-size: 12px;
  padding: 8px 0;
}

.warn { color: #b45309; font-size: 12px; }

/* ══════════════════════════════════════
   ゲームレイアウト
══════════════════════════════════════ */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
}

/* ─── ヘッダー ─── */
.game-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #faecc8 0%, #eddcaa 100%);
  border-bottom: 2px solid var(--gold-border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  box-shadow: 0 2px 12px rgba(120,80,10,0.18), 0 1px 0 rgba(255,220,100,0.6) inset;
}

.g-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 16px;
  color: var(--gold-bright);
  margin-right: 4px;
  flex-shrink: 0;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,230,120,0.8), 0 0 12px rgba(196,144,10,0.3);
}

.hstats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-board-btn {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

.hstat {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(255,248,220,0.8);
  border: 1px solid var(--border);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
}

.hstat b { color: var(--gold-bright); font-weight: 700; }

.hstat.hp     b { color: var(--green); }
.hstat.ap     b { color: var(--blue); }
.ap-regen { color: #2563eb; font-size: 0.85em; margin-left: 3px; }
.ap-next  { color: #1d4ed8; }
.hstat.gold   b { color: var(--gold-bright); }
.hstat.loc      { color: var(--text-secondary); }
.hstat.poison   { color: var(--purple); border-color: rgba(109,40,217,0.3); }
.hstat.buffs    { color: #92400e; border-color: rgba(180,120,30,0.3); font-size: 10px; }
.hstat.calendar { color: var(--gold-dim); border-color: var(--gold-border); }

/* ─── メッセージバー ─── */
.msg-bar {
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(196,144,10,0.14) 0%, rgba(196,144,10,0.08) 100%);
  border-bottom: 1px solid var(--gold-border);
  color: var(--gold-dim);
  font-size: 12px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 1px 0 rgba(255,220,80,0.3) inset;
}

/* ─── タブナビ ─── */
.tab-nav {
  display: flex;
  flex-shrink: 0;
  background: linear-gradient(180deg, #f0e0b0 0%, #e8d4a0 100%);
  border-bottom: 2px solid var(--gold-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: 60px;
  padding: 11px 4px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover   { color: var(--text-secondary); background: rgba(255,230,130,0.3); }
.tab-btn.active  {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  background: rgba(255,245,200,0.5);
  text-shadow: 0 0 8px rgba(196,144,10,0.3);
}

/* ─── タブコンテンツ ─── */
.tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  animation: fadeIn 0.2s ease;
}

/* ══════════════════════════════════════
   マップタブ
══════════════════════════════════════ */
.map-wrap,
.map-explore-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.map-explore-wrap .world-map,
.map-explore-wrap .world-map-wrap,
.map-explore-wrap .map-hint,
.map-explore-wrap .area-list,
.map-explore-wrap .sec-title,
.map-explore-wrap .result-box {
  width: 100%;
  max-width: 1100px;
  align-self: flex-start;
}

.world-map {
  width: 100%;
  max-width: 1100px;
  border: 2px solid var(--gold-border);
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 20px rgba(120,80,10,0.2), 0 1px 0 rgba(255,220,100,0.5) inset;
}

/* ─── マップ 2層構造（img背景 + SVGオーバーレイ） ─── */
.world-map-wrap {
  position: relative;
  width: 100%;
  max-width: 1100px;
  border: 2px solid var(--gold-border);
  border-radius: 10px;
  overflow: hidden;
  display: block;
  box-shadow: 0 4px 24px rgba(120,80,10,0.2), 0 1px 0 rgba(255,220,100,0.5) inset;
}

.world-map-img {
  display: block;
  width: 100%;
  height: auto;
}

.world-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.city-node text { user-select: none; }

.map-hint {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* ══════════════════════════════════════
   探索タブ
══════════════════════════════════════ */
.explore-wrap { display: flex; flex-direction: column; gap: 12px; }

/* 探索結果 */
.result-box {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  animation: fadeIn 0.3s ease;
  border: 1px solid transparent;
}

.result-box.miss    { background: rgba(180,160,110,0.12); border-color: rgba(180,150,80,0.25);  color: var(--text-secondary); }
.result-box.info    { background: rgba(30,64,175,0.06);   border-color: rgba(30,64,175,0.25);   color: #1e40af; }
.result-box.success { background: rgba(22,101,52,0.07);   border-color: rgba(22,101,52,0.25);   color: #166534; }
.result-box.danger  { background: rgba(185,28,28,0.07);   border-color: rgba(185,28,28,0.25);   color: #b91c1c; }

/* エリアカード */
.area-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.area-card {
  background: linear-gradient(145deg, var(--bg-panel) 0%, #f5e8c8 100%);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
}

.area-card:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 3px 16px rgba(154,114,16,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
}
.area-card.locked { opacity: 0.55; }

.field-card {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.field-card:hover {
  border-color: transparent;
  box-shadow: none;
}

.field-card-media {
  position: relative;
  background: transparent;
}

.field-card-media::after {
  content: none;
}

.field-card-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.field-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.16em;
  font-size: 14px;
  color: rgba(80,52,8,0.72);
}

.field-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.field-card-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  max-width: min(92%, 520px);
  padding: clamp(8px, 1.8vw, 14px) clamp(10px, 2.2vw, 16px);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.field-card-overlay::before {
  content: none;
}

.field-card.locked .field-card-img {
  filter: none;
}

.field-card.locked {
  opacity: 1;
}

.field-card.locked .field-card-stack {
  opacity: 1;
}

.field-card .area-name {
  color: #3c2608;
  text-shadow: 0 1px 0 rgba(255,246,222,0.85);
  background: rgba(255,244,214,0.78);
  border: 1px solid rgba(130,94,20,0.28);
  padding: 2px 10px;
  border-radius: 999px;
}

.field-card .area-head {
  width: 100%;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.field-card .area-tier {
  color: #5e3f0a;
  border-color: rgba(130,94,20,0.40);
  background: rgba(255,245,214,0.72);
}

.field-card .field-card-mid {
  position: relative;
  width: 100%;
  min-height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.field-card .area-meta {
  color: #4a2f0b;
  margin-bottom: 0;
  text-shadow: 0 1px 0 rgba(255,246,222,0.75);
  justify-content: center;
}

.field-card .area-meta span {
  background: rgba(255,244,210,0.78);
  border: 1px solid rgba(130,94,20,0.28);
  border-radius: 999px;
  padding: 3px 9px;
}

.field-card .lock-msg {
  color: #7f2308;
  margin-bottom: 0;
  text-shadow: 0 1px 0 rgba(255,246,222,0.82);
  background: rgba(255,235,198,0.88);
  border: 1px solid rgba(146,74,16,0.32);
  border-radius: 6px;
  padding: 3px 9px;
  align-self: center;
  text-align: center;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.field-card .field-card-mid .lock-msg {
  position: static;
  transform: none;
  margin: 2px 0 0;
  font-size: 11px;
  flex-direction: row;
}

.field-card .lock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.field-card .lock-row-key {
  font-size: 11px;
  color: #8b3c0f;
}

.field-card .lock-row-frag {
  font-size: 12px;
  color: #7f2308;
  font-weight: 700;
}

.field-card .lock-ico {
  width: 1em;
  text-align: center;
}

.field-card .lock-have {
  font-size: 11px;
  color: #9d4f1f;
  font-weight: 600;
}

.field-card .g-btn.explore {
  align-self: center;
  margin-top: 2px;
}

.field-card .g-btn.explore.is-dungeon.is-locked,
.field-card .g-btn.explore.is-dungeon.is-ap-low {
  display: none;
}

@media (max-width: 680px) {
  .field-card .field-card-mid {
    min-height: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
  .field-card .field-card-mid .lock-msg {
    position: static;
    transform: none;
  }
}

@media (max-width: 900px) {
  .field-card .area-meta {
    display: none;
  }
  .field-card .field-card-mid {
    min-height: 0;
  }
  .field-card .g-btn.explore.is-dungeon.is-locked,
  .field-card .g-btn.explore.is-dungeon.is-ap-low {
    display: none;
  }
}

@media (max-width: 1024px) {
  .field-card-media {
    min-height: clamp(128px, 34vw, 154px);
  }
  .field-card-img {
    height: clamp(128px, 34vw, 154px);
    object-fit: fill;
  }
  .field-card-overlay {
    align-items: flex-start;
    padding-top: 8px;
  }
  .field-card-stack {
    max-width: 96%;
    gap: 5px;
    padding: 6px 8px 8px;
  }
  .field-card .area-head {
    gap: 6px;
  }
  .field-card .area-name {
    font-size: 13px;
    padding: 1px 8px;
  }
  .field-card .area-tier {
    font-size: 10px;
    padding: 1px 6px;
  }
  .field-card .field-card-mid {
    min-height: 0;
    gap: 6px;
    flex-wrap: wrap;
  }
  .field-card .field-card-mid .lock-msg {
    position: static;
    transform: none;
  }
  .field-card .area-meta {
    gap: 6px;
    font-size: 10px;
  }
  .field-card .area-meta span {
    padding: 2px 7px;
  }
  .field-card .lock-msg {
    padding: 2px 7px;
    gap: 0;
  }
  .field-card .lock-row-key,
  .field-card .lock-row-frag,
  .field-card .lock-have {
    font-size: 10px;
  }
  .field-card .g-btn.explore {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.15;
  }
}

@media (max-width: 420px) {
  .field-card-media {
    min-height: 130px;
  }
  .field-card-img {
    height: 130px;
  }
  .field-card-stack {
    padding: 5px 6px 7px;
    gap: 4px;
  }
  .field-card .area-name {
    font-size: 12px;
    max-width: min(68vw, 210px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .field-card .area-meta span {
    font-size: 10px;
    padding: 1px 6px;
  }
  .field-card .g-btn.explore {
    padding: 5px 10px;
    font-size: 11px;
  }
}

@media (max-width: 900px) {
  .field-card-overlay {
    align-items: center;
    padding-top: 0;
  }
  .field-card-stack {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    column-gap: 7px;
    row-gap: 0;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  .field-card .area-head {
    order: 0;
    width: auto;
    margin-bottom: 0;
  }
  .field-card .g-btn.explore {
    order: 2;
    width: auto;
    margin-top: 0;
  }
  .field-card .field-card-mid {
    order: 1;
    width: auto;
    min-height: 0;
    display: none;
    justify-content: center;
  }
  .field-card .field-card-mid.has-lock {
    display: flex;
    align-items: center;
  }
  .field-card .lock-msg {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    white-space: nowrap;
  }
  .field-card .lock-row {
    gap: 3px;
  }
}

.area-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.area-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--text-primary);
}

.area-tier {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  background: rgba(255,240,190,0.6);
}

.area-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.fishing-req {
  font-size: 11px;
  color: #0369a1;
  margin-bottom: 8px;
  padding: 3px 6px;
  background: rgba(3,105,161,0.07);
  border-radius: 4px;
}

.lock-msg {
  font-size: 11px;
  color: #b45309;
  margin-bottom: 8px;
}

.g-btn.explore {
  width: auto;
  padding: 7px 16px;
  margin-top: 0;
}

/* ══════════════════════════════════════
   戦闘画面
══════════════════════════════════════ */
.battle-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(255,200,180,0.3) 0%, transparent 55%),
    var(--bg-body);
  padding: 16px 12px;
  max-width: 680px;
  margin: 0 auto;
}

.b-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.b-area { flex: 1; }

.boss-badge {
  padding: 3px 10px;
  background: rgba(185,28,28,0.1);
  border: 1px solid rgba(185,28,28,0.4);
  border-radius: 4px;
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0.1em;
  animation: pulse 1.5s infinite;
  text-shadow: 0 0 6px rgba(185,28,28,0.3);
}

/* コンバタント */
.b-combatants {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.b-fighter {
  flex: 1;
  min-width: 130px;
  max-width: 220px;
  background: linear-gradient(145deg, var(--bg-panel), #f0e0b0);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(120,80,10,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}

.b-fighter.enemy  { border-color: rgba(185,28,28,0.35); box-shadow: 0 3px 12px rgba(185,28,28,0.1), inset 0 1px 0 rgba(255,255,255,0.8); }
.b-fighter.player { border-color: var(--gold-border); box-shadow: 0 3px 12px rgba(154,114,16,0.15), inset 0 1px 0 rgba(255,255,255,0.8); }

.b-fname {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.hp-track {
  height: 8px;
  background: rgba(120,80,10,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
}

.hp-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.hp-fill.enemy-fill  { background: linear-gradient(90deg, #b91c1c, #ef4444); box-shadow: 0 0 4px rgba(185,28,28,0.4); }
.hp-fill.player-fill { background: linear-gradient(90deg, #166534, #34d399); box-shadow: 0 0 4px rgba(22,101,52,0.4); }

.b-fhp {
  font-size: 12px;
  color: var(--text-secondary);
}

.poison-ind {
  margin-top: 6px;
  font-size: 11px;
  color: var(--purple);
}

.b-vs {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 18px;
  color: var(--gold-dim);
  flex-shrink: 0;
  text-shadow: 0 1px 0 rgba(255,220,80,0.6);
}

/* バトルログ */
.b-log {
  flex: 1;
  background: rgba(255,248,220,0.6);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 16px;
  min-height: 120px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: inset 0 2px 6px rgba(120,80,10,0.1);
}

.blog-line {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  animation: fadeIn 0.2s ease;
}

/* バトルアクション */
.b-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.g-btn.battle-act {
  flex: 1;
  min-width: 90px;
  max-width: 160px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 0;
}

.g-btn.battle-act.atk  { border-color: rgba(185,28,28,0.4); color: #b91c1c; }
.g-btn.battle-act.atk:hover:not(:disabled) { background: linear-gradient(180deg,rgba(185,28,28,0.1),rgba(185,28,28,0.05)); border-color: var(--red); color: var(--red); box-shadow: 0 2px 12px rgba(185,28,28,0.2); }

.g-btn.battle-act.flee { border-color: rgba(30,64,175,0.4); color: #1e40af; }
.g-btn.battle-act.flee:hover:not(:disabled) { background: linear-gradient(180deg,rgba(30,64,175,0.08),rgba(30,64,175,0.04)); border-color: var(--blue); color: var(--blue); box-shadow: 0 2px 12px rgba(30,64,175,0.18); }

.g-btn.battle-act.herb { border-color: rgba(22,101,52,0.4); color: #166534; }
.g-btn.battle-act.herb:hover:not(:disabled) { background: linear-gradient(180deg,rgba(22,101,52,0.08),rgba(22,101,52,0.04)); border-color: var(--green); color: var(--green); box-shadow: 0 2px 12px rgba(22,101,52,0.18); }

.g-btn.battle-act.item { border-color: rgba(120,53,15,0.4); color: #92400e; }
.g-btn.battle-act.item:hover:not(:disabled) { background: linear-gradient(180deg,rgba(120,53,15,0.08),rgba(120,53,15,0.04)); border-color: #92400e; color: #78350f; box-shadow: 0 2px 12px rgba(120,53,15,0.18); }
.g-btn.battle-act.item.open { background: linear-gradient(180deg,rgba(120,53,15,0.08),rgba(120,53,15,0.04)); border-color: #92400e; color: #78350f; }

.b-item-panel {
  margin-top: 8px;
  border: 1px solid rgba(120,53,15,0.3);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255,248,220,0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}
.b-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.b-item-name {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   手持ちタブ
══════════════════════════════════════ */
.inv-wrap { display: flex; flex-direction: column; gap: 16px; }

/* パネル共通スタイル */
.equip-section,
.inv-section,
.warehouse-section {
  background: linear-gradient(160deg, var(--bg-panel) 0%, #f5e8c8 100%);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 12px 14px;
  box-shadow:
    0 3px 12px rgba(120,80,10,0.12),
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset 0 -1px 0 rgba(120,80,10,0.06);
}

.equip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(154,114,16,0.1);
  font-size: 13px;
}

.equip-row:last-child { border-bottom: none; padding-bottom: 0; }
.equip-row:first-of-type { padding-top: 0; }

.eq-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 72px;
  flex-shrink: 0;
}

.eq-item { flex: 1; font-size: 13px; }
.empty-slot { color: var(--text-muted); font-style: italic; }

.inv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(255,248,220,0.5);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.inv-row:hover {
  border-color: var(--gold-border);
  background: rgba(255,240,180,0.6);
  box-shadow: 0 1px 4px rgba(154,114,16,0.12);
}

.inv-row.locked-item {
  background: rgba(200,185,155,0.45);
  border-color: rgba(100,72,8,0.18);
}

.lock-btn {
  font-size: 13px;
  padding: 2px 5px;
  opacity: 0.55;
  min-width: 28px;
}
.lock-btn:hover { opacity: 1; }
.lock-btn.locked {
  opacity: 0.85;
  color: var(--red);
}

.inv-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}


.inv-q    { font-size: 11px; font-weight: 700; flex-shrink: 0; }
.inv-name { font-size: 13px; }
.inv-tags { font-size: 11px; color: var(--text-dim); }

.inv-qty {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,240,190,0.8);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.inv-acts { display: flex; gap: 4px; flex-shrink: 0; margin-left: 6px; }

.inv-chk, .wh-chk {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--gold-dim);
  cursor: pointer;
  margin-right: 2px;
}
.inv-chk-ph { width: 15px; flex-shrink: 0; margin-right: 2px; display: inline-block; }

.inv-batch-bar {
  display: flex; gap: 6px; align-items: center;
  padding: 4px 2px 6px;
  flex-wrap: wrap;
}
.inv-batch-bar .g-btn { margin-top: 0; }

.g-btn.equip { border-color: var(--gold-border); color: var(--gold-dim); }
.g-btn.equip:hover { border-color: var(--gold-bright); background: linear-gradient(180deg,rgba(196,144,10,0.18),rgba(154,114,16,0.12)); color: var(--gold-bright); }

.g-btn.use { border-color: rgba(22,101,52,0.35); color: var(--green); }
.g-btn.use:hover { border-color: var(--green); background: rgba(22,101,52,0.08); }

.g-btn.wh-move { border-color: rgba(30,64,175,0.35); color: #1e40af; }
.g-btn.wh-move:hover { border-color: var(--blue); background: rgba(30,64,175,0.08); }

.g-btn.wh-from { border-color: var(--gold-border); color: var(--gold-dim); }
.g-btn.wh-from:hover { border-color: var(--gold-bright); background: var(--gold-bg); color: var(--gold-bright); }

/* ─── 手持ち/倉庫 サブタブ ─── */
.inv-sub-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.inv-sub-btn {
  flex: 1;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fdf4da 0%, #ecdab0 100%);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  box-shadow: 0 1px 4px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.inv-sub-btn:hover { color: var(--text-secondary); border-color: var(--border-light); }
.inv-sub-btn.active {
  color: var(--gold-bright);
  border-color: var(--gold-border);
  background: linear-gradient(180deg,rgba(196,144,10,0.2),rgba(154,114,16,0.14));
  box-shadow: 0 1px 6px rgba(154,114,16,0.2), inset 0 1px 0 rgba(255,220,80,0.5);
}

/* ─── 手持ち/倉庫 カテゴリフィルター ─── */
.inv-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.inv-filter-btn {
  padding: 4px 10px;
  background: linear-gradient(180deg, #fdf4da, #ecdab0);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(120,80,10,0.08);
}

.inv-filter-btn:hover { color: var(--text-secondary); border-color: var(--border-light); }
.inv-filter-btn.active { color: var(--gold-bright); border-color: var(--gold-border); background: linear-gradient(180deg,rgba(196,144,10,0.18),rgba(154,114,16,0.12)); }

/* ─── 手持ち/倉庫 ソート ─── */
.inv-sort-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.inv-sort-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.inv-sort-select {
  margin-bottom: 0;
  width: min(100%, 240px);
  padding: 6px 10px;
  font-size: 12px;
}

/* ─── 倉庫 ─── */
.warehouse-locked {
  border-color: var(--border);
  text-align: center;
  padding: 20px 16px;
}

.wh-lock-msg {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.wh-lock-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  line-height: 1.6;
}

.wh-expand-hint {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   商売タブ
══════════════════════════════════════ */
.shop-wrap { display: flex; flex-direction: column; gap: 0; }

.sub-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--gold-border);
  padding-bottom: 0;
}

.sub-tab {
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -2px;
}

.sub-tab:hover  { color: var(--text-secondary); background: rgba(255,230,130,0.2); }
.sub-tab.active { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

.shop-fb {
  padding: 9px 12px;
  background: rgba(22,101,52,0.08);
  border: 1px solid rgba(22,101,52,0.28);
  border-radius: 6px;
  color: var(--green);
  font-size: 12px;
  margin-bottom: 12px;
  animation: fadeIn 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ─── 卸売り ─── */
.wholesale-wrap { display: flex; flex-direction: column; gap: 10px; }

.wholesale-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
}

.wholesale-toolbar .inv-sort-row,
.wholesale-toolbar .inv-filter-nav {
  margin-bottom: 0;
}

.sell-ctrl {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sell-ctrl .g-btn { margin-top: 0; }
.sell-ctrl .g-btn.primary { width: auto; }

.sell-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 55vh;
  overflow-y: auto;
}

.sell-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(145deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(120,80,10,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.sell-row:hover { border-color: var(--border-light); box-shadow: 0 2px 8px rgba(120,80,10,0.14); }

.sell-chk {
  width: 14px;
  height: 14px;
  accent-color: var(--gold-bright);
  cursor: pointer;
  flex-shrink: 0;
}

.sell-qty   { color: var(--text-secondary); margin-left: auto; }
.sell-price { color: var(--gold-dim); font-size: 11px; white-space: nowrap; }
.sell-stock-count { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.sell-qty-in {
  width: 52px !important;
  min-width: 52px;
  display: inline-block;
  margin-bottom: 0;
  padding: 6px 6px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.sell-qty-in::-webkit-outer-spin-button,
.sell-qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sell-qty-stepper { margin-left: auto; }

/* ─── NPC商店 ─── */
.npc-shop-wrap { display: flex; flex-direction: column; gap: 10px; }

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(145deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(120,80,10,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.shop-q     { font-size: 11px; font-weight: 700; flex-shrink: 0; }
.shop-name  { flex: 1; }
.shop-price { color: var(--gold-dim); font-size: 12px; white-space: nowrap; }
.shop-qty-in {
  width: 52px !important;
  min-width: 52px;
  display: inline-block;
  margin-bottom: 0;
  padding: 6px 6px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.shop-qty-in::-webkit-outer-spin-button,
.shop-qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.qty-step-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(180deg, #fdf4da 0%, #ecdab0 100%);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.qty-step-btn:hover:not(:disabled) {
  border-color: var(--gold-border);
  color: var(--gold-dim);
}
.qty-step-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── 露店 ─── */
.stall-wrap { display: flex; flex-direction: column; gap: 14px; }

.stall-open-section {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 14px;
  font-size: 13px;
  box-shadow: 0 3px 12px rgba(120,80,10,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
}

.stall-open-section b { color: var(--gold-bright); }

.stall-open-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}

.stall-open-form .g-input { margin-bottom: 0; flex: 1; min-width: 160px; }
.stall-open-form .g-btn   { width: auto; margin-top: 0; flex-shrink: 0; }

.my-stall {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--gold-border);
  border-radius: 9px;
  padding: 14px;
  box-shadow: 0 3px 14px rgba(154,114,16,0.16), inset 0 1px 0 rgba(255,255,255,0.8);
}

.my-stall h4 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold-bright);
  margin-bottom: 10px;
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}

.my-listings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.add-listing {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.add-listing .g-input { flex: 1; min-width: 120px; margin-bottom: 0; }
.add-listing .g-btn   { margin-top: 0; width: auto; }

.listing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,248,220,0.6);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  flex-wrap: wrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.listing-price  { color: var(--gold-dim); margin-left: auto; white-space: nowrap; }
.listing-seller { color: var(--text-dim); font-size: 11px; }
.listing-stock  { color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.listing-buy-price { margin-left: 0; }
.listing-qty-stepper { margin-left: auto; }
.listing-qty-stepper .shop-qty-in {
  width: 46px !important;
  min-width: 46px;
}
.npc-seller     { color: #7c3aed; font-style: italic; }

.market-items {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 12px 14px;
  box-shadow: 0 3px 12px rgba(120,80,10,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
}

.market-items h4 {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ══════════════════════════════════════
   状態タブ
══════════════════════════════════════ */
.status-wrap { display: flex; flex-direction: column; gap: 4px; }

.stat-grid {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 4px;
  box-shadow: 0 3px 12px rgba(120,80,10,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
}

.stat-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(154,114,16,0.1);
  font-size: 13px;
}

.stat-row:last-child { border-bottom: none; }

.stat-k {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--text-dim);
  width: 52px;
  flex-shrink: 0;
}

.stat-v { color: var(--text-primary); }

/* ─── アビリティ ─── */
.ab-sections { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }

.ab-cat-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.ab-max {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255,240,190,0.6);
}

.ab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(145deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ab-row:hover { border-color: var(--gold-border); box-shadow: 0 2px 8px rgba(154,114,16,0.16); }

.ab-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  width: 50px;
  flex-shrink: 0;
}

.ab-rank {
  font-size: 12px;
  font-weight: 700;
  width: 54px;
  flex-shrink: 0;
}

.exp-wrap {
  flex: 1;
  min-width: 80px;
  height: 6px;
  background: rgba(120,80,10,0.15);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 4px rgba(196,144,10,0.4);
}

.exp-txt {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── 称号 ─── */
.titles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.title-badge {
  padding: 4px 12px;
  background: linear-gradient(180deg,rgba(196,144,10,0.16),rgba(154,114,16,0.12));
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  color: var(--gold-bright);
  font-size: 12px;
  font-family: 'Cinzel', serif;
  box-shadow: 0 1px 4px rgba(154,114,16,0.14), inset 0 1px 0 rgba(255,220,80,0.4);
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}

/* ─── クリア表示 ─── */
.chapter-clear {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg,rgba(196,144,10,0.12),rgba(154,114,16,0.08));
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  color: var(--gold-bright);
  font-family: 'Cinzel', serif;
  font-size: 15px;
  text-align: center;
  animation: glow 3s ease-in-out infinite;
  box-shadow: 0 2px 16px rgba(154,114,16,0.18), inset 0 1px 0 rgba(255,220,80,0.4);
}

/* ══════════════════════════════════════
   レスポンシブ — SP（≤480px）
══════════════════════════════════════ */
@media (max-width: 480px) {
  .b-combatants { gap: 10px; }
  .b-fighter    { min-width: 110px; padding: 10px; }
  .b-vs         { font-size: 14px; }

  .g-btn.battle-act { min-width: 75px; font-size: 12px; padding: 10px 8px; }

  .hstats { gap: 4px; }
  .hstat  { font-size: 10px; padding: 2px 5px; }
  .header-actions .g-btn.sm { padding: 4px 8px; font-size: 10px; }

  .title-logo { font-size: 36px; }
  .auth-box   { padding: 16px; }
}

/* ══════════════════════════════════════
   レスポンシブ — タブレット（481px〜899px）
══════════════════════════════════════ */
@media (min-width: 481px) and (max-width: 899px) {
  .game-layout {
    max-width: 100%;
  }
  .battle-screen {
    max-width: 100%;
  }
}

/* ══════════════════════════════════════
   レスポンシブ — PC（≥900px）
   サイドナビ + メインコンテンツ グリッド
══════════════════════════════════════ */
@media (min-width: 900px) {

  #app {
    width: 100vw;
  }

  .game-layout {
    width: 100vw;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(192px, 192px) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
  }

  .game-header {
    grid-column: 1 / -1;
  }
  .msg-bar {
    grid-column: 1 / -1;
  }
  .site-footer {
    grid-column: 1 / -1;
  }

  .tab-nav {
    grid-column: 1;
    width: 192px;
    min-width: 192px;
    max-width: 192px;
    align-self: start;
    flex-direction: column;
    border-bottom: none;
    border-right: 2px solid var(--gold-border);
    overflow: hidden;
    background: linear-gradient(180deg, #f0e0b0, #e8d4a0);
    padding: 16px 0;
    min-height: 0;
    box-shadow: 2px 0 10px rgba(120,80,10,0.1);
  }

  .tab-btn {
    flex: 0 0 auto;
    text-align: left;
    padding: 13px 20px;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tab-btn.active {
    border-bottom-color: transparent;
    border-right-color: var(--gold-bright);
    background: linear-gradient(90deg, rgba(196,144,10,0.16), rgba(196,144,10,0.06));
    color: var(--gold-bright);
    box-shadow: inset 0 1px 0 rgba(255,220,80,0.3);
  }

  .tab-content {
    grid-column: 2;
    min-width: 0;
    min-height: 0;
    max-width: none;
    width: 100%;
    padding: 20px 28px;
  }

  .battle-screen {
    max-width: 1080px;
  }

  .ab-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .craft-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .inv-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto 1fr;
    gap: 16px;
    align-items: start;
  }

  .inv-wrap > .equip-section {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .inv-wrap > .inv-sub-nav {
    grid-column: 2;
    grid-row: 1;
  }

  .inv-wrap > .inv-section,
  .inv-wrap > .warehouse-section {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ══════════════════════════════════════
   都市移動確認モーダル
══════════════════════════════════════ */
.travel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60,30,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(3px);
}
.travel-modal {
  background: linear-gradient(160deg, #fdf6e4, #f0e0b4);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 340px;
  width: 88%;
  box-shadow:
    0 8px 40px rgba(120,80,10,0.28),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -1px 0 rgba(120,80,10,0.1);
  text-align: center;
}
.travel-modal-title {
  font-family: 'Cinzel', serif;
  color: var(--gold-bright);
  font-size: 15px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255,220,80,0.5);
}
.travel-modal-dest {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 16px;
}
.travel-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.travel-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
}
.travel-opt-label {
  font-weight: bold;
}
.travel-opt-cost {
  font-size: 12px;
  font-weight: bold;
}
.travel-opt-cost.cost-ap   { color: #16a34a; }
.travel-opt-cost.cost-gold { color: #ca8a04; }
.travel-opt-cost.cost-lack { color: #a1a1aa; }
.travel-cancel {
  font-size: 12px;
  padding: 6px 20px;
  opacity: 0.8;
}

/* ══════════════════════════════════════
   主軸アビリティ選択モーダル
══════════════════════════════════════ */
/* ─── 装備交換モーダル ─────────────────────────────────── */
.eex-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,10,0,0.72);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(3px);
  padding: 12px;
}
.eex-modal {
  background: linear-gradient(160deg, #fdf6e4, #f0e0b4);
  border: 2px solid var(--gold-border);
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.eex-modal-sm { max-width: 320px; text-align: center; }
.eex-title {
  font-size: 16px;
  font-weight: 700;
  color: #5c3a00;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.eex-sub {
  font-size: 12px;
  color: #8b6914;
  text-align: center;
  margin-bottom: 14px;
}
.eex-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eex-item {
  background: #fffef5;
  border: 1px solid #d4c090;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.eex-item:hover {
  background: #fff8dc;
  border-color: #a07820;
}
.eex-item-name {
  font-size: 14px;
  font-weight: 700;
  color: #2c2410;
}
.eex-item-sub {
  font-size: 11px;
  color: #8b6914;
  margin-top: 2px;
}
.eex-confirm-name {
  font-size: 16px;
  font-weight: 700;
  color: #2c2410;
  margin-bottom: 4px;
}
.eex-confirm-sub {
  font-size: 12px;
  color: #8b6914;
}

.main-axis-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60,30,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(3px);
}

.main-axis-modal {
  background: linear-gradient(160deg, #fdf6e4, #f0e0b4);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 420px;
  width: 92%;
  box-shadow:
    0 8px 40px rgba(120,80,10,0.28),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -1px 0 rgba(120,80,10,0.1);
}

.main-axis-title {
  font-family: 'Cinzel', serif;
  color: var(--gold-bright);
  font-size: 16px;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255,220,80,0.5);
}

.main-axis-sub {
  color: var(--text-primary);
  font-size: 13px;
  text-align: center;
  margin-bottom: 6px;
}

.main-axis-desc {
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.6;
}

.main-axis-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-axis-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(145deg,rgba(196,144,10,0.14),rgba(154,114,16,0.08));
  border: 1px solid var(--gold-border);
  border-radius: 7px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  box-shadow: 0 2px 8px rgba(120,80,10,0.12), inset 0 1px 0 rgba(255,220,80,0.3);
}

.main-axis-choice:hover {
  background: linear-gradient(145deg,rgba(196,144,10,0.24),rgba(154,114,16,0.15));
  border-color: var(--gold-bright);
  box-shadow: 0 3px 14px rgba(154,114,16,0.22);
}

.mac-name {
  font-family: 'Cinzel', serif;
  color: var(--gold-bright);
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.mac-rank {
  font-size: 12px;
  font-weight: 600;
}

.mac-cat {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(120,80,10,0.08);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── アビリティバッジ ── */
.ab-main {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-bright);
  background: linear-gradient(180deg,rgba(196,144,10,0.18),rgba(154,114,16,0.12));
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.03em;
}

.ab-star {
  font-size: 11px;
  color: #92400e;
  background: rgba(146,64,14,0.1);
  border: 1px solid rgba(146,64,14,0.3);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ══════════════════════════════════════
   クラフトタブ
══════════════════════════════════════ */
.craft-tab {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.craft-cat-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.craft-cat-sep {
  color: var(--text-dim);
  font-size: 14px;
  padding: 0 2px;
  user-select: none;
}

.craft-slot-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  padding: 5px 10px;
}

.craft-cat-btn {
  padding: 5px 16px;
  background: linear-gradient(180deg, #fdf4da, #ecdab0);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.craft-cat-btn:hover {
  border-color: var(--gold-border);
  color: var(--text-primary);
}

.craft-cat-btn.active {
  background: linear-gradient(180deg,rgba(196,144,10,0.22),rgba(154,114,16,0.15));
  border-color: var(--gold-border);
  color: var(--gold-bright);
  box-shadow: 0 2px 8px rgba(154,114,16,0.2), inset 0 1px 0 rgba(255,220,80,0.4);
}

/* ─── 倉庫トグル / 装備フィルター ─── */
.craft-option-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.craft-warehouse-btn {
  padding: 4px 14px;
  font-size: 12px;
  background: linear-gradient(180deg, #fdf4da, #ecdab0);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(120,80,10,0.08);
}

.craft-warehouse-btn.active {
  background: rgba(22,101,52,0.12);
  border-color: rgba(22,101,52,0.4);
  color: #166534;
}

.craft-equip-filter-nav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.craft-equip-filter-btn {
  padding: 3px 12px;
  font-size: 11px;
  background: linear-gradient(180deg, #fdf4da, #ecdab0);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(120,80,10,0.08);
}

.craft-equip-filter-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.craft-equip-filter-btn.active {
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-darkest));
  border-color: var(--border-light);
  color: var(--text-primary);
}

.craft-sort-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.craft-sort-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.craft-sort-select {
  margin-bottom: 0;
  width: min(100%, 240px);
  padding: 6px 10px;
  font-size: 12px;
}

/* 逆引き検索 */
.craft-reverse-btn.active {
  background: var(--accent-warm, #c07830);
  color: #fff;
}
.craft-reverse-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
}
.craft-reverse-mat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.craft-reverse-mat-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255,240,190,0.6);
  border: 1px solid var(--gold-border);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s;
}
.craft-reverse-mat-btn:hover {
  background: rgba(255,220,140,0.7);
}
.craft-reverse-mat-btn small {
  color: var(--text-dim);
  margin-left: 2px;
}
.craft-reverse-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.craft-reverse-back {
  white-space: nowrap;
}
.craft-reverse-selected {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.craft-cat-badge {
  font-size: 10px;
  color: #fff;
  background: var(--accent-warm, #b07020);
  padding: 1px 7px;
  border-radius: 3px;
  margin-right: 6px;
  white-space: nowrap;
}

.craft-heading {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold-border);
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}

.craft-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.craft-card {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(120,80,10,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
}

.craft-card:hover {
  border-color: var(--gold-border);
  box-shadow: 0 3px 16px rgba(154,114,16,0.18), inset 0 1px 0 rgba(255,255,255,0.8);
}

.craft-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.craft-result-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--gold-bright);
  text-shadow: 0 1px 0 rgba(255,220,80,0.3);
}

.craft-effect-desc {
  font-size: 11px;
  color: #166534;
  margin-left: 6px;
}

.craft-rank-badge {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,240,190,0.5);
}

.craft-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid rgba(154,114,16,0.12);
  border-bottom: 1px solid rgba(154,114,16,0.12);
}

.craft-mat {
  font-size: 12px;
  background: rgba(255,240,190,0.6);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.craft-mat-have {
  color: var(--text-dim);
  font-size: 10px;
}

.craft-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.craft-info > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.craft-skill-up b {
  color: #7c5a1a;
}

.craft-btn {
  border-color: var(--gold-border);
  color: var(--gold-dim);
}

.craft-btn:hover:not(:disabled):not(.disabled) {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg,rgba(196,144,10,0.18),rgba(154,114,16,0.12));
  color: var(--gold-bright);
}

/* ─── クラフト セクションラベル ─── */
.craft-section-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.craft-fav-label {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-border);
}

/* ─── お気に入りボタン ─── */
.craft-fav-btn {
  background: none;
  border-color: var(--border-light);
  color: var(--text-dim);
  font-size: 14px;
  padding: 2px 7px;
  width: auto;
  margin-top: 0;
}

.craft-fav-btn:hover:not(:disabled) {
  border-color: var(--gold-border);
  background: var(--gold-bg);
  color: var(--gold-bright);
}

.craft-fav-btn.active {
  color: var(--gold-bright);
  border-color: var(--gold-border);
  background: var(--gold-bg);
}

/* ─── お気に入りカードのハイライト ─── */
.craft-card.craft-fav {
  border-color: var(--gold-border);
  background: linear-gradient(160deg,rgba(196,144,10,0.08),rgba(154,114,16,0.04));
}

/* ─── 未経験セクション トグルボタン ─── */
.craft-uncrafted-toggle {
  margin-top: 8px;
  width: 100%;
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-darkest));
  border-color: var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 8px 14px;
  text-align: left;
  justify-content: flex-start;
}

.craft-uncrafted-toggle:hover:not(:disabled) {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* ─── 未経験セクション リスト ─── */
.craft-uncrafted-list {
  opacity: 0.8;
  margin-top: 8px;
}

/* ══════════════════════════════════════
   チャットパネル
══════════════════════════════════════ */

/* ─── フローティングトグルボタン（全デバイス表示） ─── */
#chat-toggle-btn {
  display: flex;
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 502;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  color: #fff8e8;
  border: none;
  border-radius: 24px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(154,114,16,0.38);
  transition: all 0.15s;
}
#chat-toggle-btn.active {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* ─── チャットコンテナ ─── */
#chat-container {
  position: fixed;
  width: min(100%, 760px);
  height: min(58vh, 420px);
  left: 50%;
  bottom: 0;
  top: auto;
  transform: translateX(-50%) translateY(100%);
  transition: transform 0.3s ease;
  z-index: 500;
}

#chat-container.open {
  transform: translateX(-50%) translateY(0);
}

/* ─── リサイズハンドル（PC のみ表示） ─── */
.chat-resize-handle {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s;
}
.chat-resize-handle::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-border);
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-resize-handle:hover::after,
.chat-resize-handle.dragging::after {
  opacity: 1;
  background: var(--gold-dim);
}

/* ─── チャットパネル本体 ─── */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #f8ecd0, #f0e0b4);
  border-left: 2px solid var(--gold-border);
  box-shadow: -3px 0 16px rgba(120,80,10,0.12);
}

/* ─── ヘッダー ─── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #faecc8, #eddcaa);
  border-bottom: 1px solid var(--gold-border);
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,220,100,0.5) inset;
}

.chat-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.chat-tab-btn {
  flex: 1;
  padding: 5px 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.chat-tab-btn:hover { color: var(--text-secondary); border-color: var(--border-light); }
.chat-tab-btn.active {
  background: var(--gold-bg);
  border-color: var(--gold-border);
  color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(255,220,80,0.3);
}

.chat-close-btn {
  display: block;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}
.chat-close-btn:hover { color: var(--text-primary); }

/* ─── メッセージ一覧 ─── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.chat-msg {
  background: rgba(255,252,240,0.85);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  animation: fadeIn 0.2s ease;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(120,80,10,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.chat-msg-avatar-col {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 1px;
}
.chat-msg-body {
  flex: 1;
  min-width: 0;
}
.chat-msg.npc-msg {
  background: rgba(255,248,200,0.85);
  border-color: var(--gold-border);
}

.chat-msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.chat-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}
.chat-msg.npc-msg .chat-sender { color: var(--purple); }
.chat-msg.tutorial-msg {
  background: rgba(255,107,157,0.07);
  border-color: #ff6b9d;
}
.chat-msg.tutorial-msg .chat-sender { color: #ff6b9d; }
.chat-avatar-tutorial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #ff6b9d;
}
.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.chat-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.55;
}

.chat-empty {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: 20px 8px;
  line-height: 1.7;
}
.chat-empty small { font-size: 11px; color: var(--text-muted); }

/* ─── 入力欄 ─── */
.chat-input-area {
  display: flex;
  gap: 5px;
  padding: 8px 8px;
  border-top: 1px solid var(--gold-border);
  background: linear-gradient(180deg, #eddcaa, #e4d0a0);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 6px 9px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  background: #fffcf4;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
  box-shadow: inset 0 1px 3px rgba(120,80,10,0.08);
}
.chat-input:focus { border-color: var(--gold-bright); box-shadow: inset 0 1px 3px rgba(120,80,10,0.08), 0 0 0 2px rgba(154,114,16,0.12); }
.chat-send-btn {
  padding: 6px 10px;
  background: linear-gradient(180deg,rgba(196,144,10,0.22),rgba(154,114,16,0.18));
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-bright);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: 0 1px 4px rgba(154,114,16,0.16), inset 0 1px 0 rgba(255,220,80,0.4);
}
.chat-send-btn:hover { background: linear-gradient(180deg,rgba(196,144,10,0.32),rgba(154,114,16,0.24)); }

/* ══════════════════════════════════════
   チャット — レスポンシブ
══════════════════════════════════════ */

@media (min-width: 900px) {
  body { padding-right: 0; }
  .chat-resize-handle { display: none; }
  #chat-container {
    height: min(60vh, 460px);
  }
}

@media (max-width: 899px) {
  #chat-container {
    width: 100%;
    left: 0;
    transform: translateY(100%);
  }
  #chat-container.open { transform: translateY(0); }

  .chat-panel {
    border-left: none;
    border-top: 2px solid var(--gold-border);
    box-shadow: 0 -4px 20px rgba(120,80,10,0.18);
  }
}

/* --- Top Tab --- */
.top-wrap { display:flex; flex-direction:column; gap:12px; padding:12px; max-width:480px; margin:0 auto; }

/* TOP掲示板バナー */
.top-board-banner {
  background: linear-gradient(160deg, #f7ecd2, #edd8aa);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.85);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.top-board-banner:hover,
.top-board-banner:focus-visible {
  transform: translateY(-1px);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 18px rgba(120,80,10,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
  outline: none;
}
.top-board-banner-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #5a3e1b;
}
.top-board-banner-sub {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #7a6140;
}

/* アバターカード */
.top-avatar-card {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border:1px solid var(--border-light); border-radius:12px; padding:16px;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}
.top-avatar-frame { display:flex; gap:16px; align-items:center; }
.top-avatar-placeholder {
  width:80px; height:80px; border-radius:12px;
  background:linear-gradient(145deg,rgba(196,144,10,0.18),rgba(154,114,16,0.1));
  border:2px solid var(--gold-border);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  box-shadow: 0 2px 10px rgba(154,114,16,0.18), inset 0 1px 0 rgba(255,220,80,0.4);
}
.top-avatar-glyph { font-size:36px; }
.top-avatar-img {
  width:80px; height:80px; border-radius:12px;
  object-fit:cover; border:2px solid var(--gold-border);
  flex-shrink:0; display:block;
  box-shadow: 0 2px 10px rgba(154,114,16,0.2);
}
.top-avatar-info { display:flex; flex-direction:column; gap:4px; }
.top-char-name { font-size:1.2rem; font-weight:700; color:var(--text-primary); font-family:'Noto Sans JP', sans-serif; }
.top-char-rank { font-size:0.85rem; color:var(--text-secondary); }
.top-char-loc  { font-size:0.8rem; color:var(--text-dim); }
.rank-badge {
  display:inline-block; padding:2px 10px; border-radius:4px;
  background:linear-gradient(180deg,rgba(196,144,10,0.2),rgba(154,114,16,0.14));
  border:1px solid var(--gold-border);
  color:var(--gold-bright); font-weight:700; font-size:0.9rem;
  box-shadow: 0 1px 4px rgba(154,114,16,0.16), inset 0 1px 0 rgba(255,220,80,0.4);
}

/* ステータスカード */
.top-stats-card {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border:1px solid var(--border-light); border-radius:12px; padding:14px;
  display:flex; flex-direction:column; gap:8px;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}
.top-bar-row { display:flex; align-items:center; gap:8px; }
.top-bar-label { font-size:0.78rem; font-weight:700; width:24px; flex-shrink:0; }
.top-bar-label.hp { color:var(--red); }
.top-bar-label.ap { color:var(--blue); }
.top-bar-label.mp { color:#0f766e; }
.top-bar-track { flex:1; height:10px; background:rgba(120,80,10,0.14); border-radius:5px; overflow:hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.top-bar-fill.hp { height:100%; background:linear-gradient(90deg,#b91c1c,#f87171); border-radius:5px; transition:width 0.3s; }
.top-bar-fill.ap { height:100%; background:linear-gradient(90deg,#1d4ed8,#60a5fa); border-radius:5px; transition:width 0.3s; }
.top-bar-fill.mp { height:100%; background:linear-gradient(90deg,#0f766e,#5eead4); border-radius:5px; transition:width 0.3s; }
.top-bar-val { font-size:0.8rem; color:var(--text-secondary); width:80px; text-align:right; flex-shrink:0; }
.top-mini-stats { display:flex; gap:12px; flex-wrap:wrap; margin-top:4px; font-size:0.82rem; color:var(--text-secondary); }
.top-mini-stats b { color:var(--text-primary); }

/* タイマーカード */
.top-timers-card {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border:1px solid var(--border-light); border-radius:12px;
  padding:10px 14px; display:flex; gap:16px; flex-wrap:wrap;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}
.top-timer { font-size:0.82rem; color:var(--text-secondary); }
.top-timer.full { color:var(--green); font-weight:600; }

/* クイックアクションカード */
.top-actions-card {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border:1px solid var(--border-light); border-radius:12px; padding:14px;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}
.top-action-title { font-size:0.8rem; font-weight:700; color:var(--text-dim); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.05em; }
.top-action-loc { font-size:0.82rem; color:var(--text-secondary); margin-bottom:10px; }
.top-action-btns { display:flex; gap:8px; flex-wrap:wrap; }
.top-action-btns .g-btn { flex:1; min-width:120px; }
.top-actions-card .result-box { margin-top: 10px; }

/* ══════════════════════════════════════
   ヘッダーアイコン
══════════════════════════════════════ */
.header-icon-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 6px;
}
.header-player-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-border);
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(154,114,16,0.2);
}
.header-player-icon:hover { border-color: var(--gold-bright); opacity: 0.85; box-shadow: 0 2px 8px rgba(154,114,16,0.3); }
.header-icon-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.header-icon-placeholder:hover { border-color: var(--gold-dim); }

/* ══════════════════════════════════════
   設定タブ
══════════════════════════════════════ */
.settings-wrap {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-section {
  background: linear-gradient(160deg, var(--bg-panel), #f5e8c8);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(120,80,10,0.14), inset 0 1px 0 rgba(255,255,255,0.8);
}
.settings-section-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 6px;
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}
.settings-icon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.settings-icon-display {
  flex-shrink: 0;
}
.settings-icon-preview {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--gold-border);
  display: block;
  box-shadow: 0 3px 12px rgba(154,114,16,0.2);
}
.settings-icon-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-muted);
  background: var(--bg-darkest);
}
.settings-icon-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.settings-upload-label {
  width: auto !important;
  margin-top: 0 !important;
  cursor: pointer;
}
.settings-danger-btn {
  width: auto !important;
  margin-top: 0 !important;
  color: var(--red) !important;
  border-color: rgba(185,28,28,0.35) !important;
}
.settings-danger-btn:hover:not(:disabled) {
  background: rgba(185,28,28,0.08) !important;
  border-color: var(--red) !important;
  color: var(--red) !important;
}
.settings-icon-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ══════════════════════════════════════
   チャットアバター
══════════════════════════════════════ */
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.chat-avatar-char {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg,rgba(196,144,10,0.18),rgba(154,114,16,0.12));
  border: 1px solid var(--gold-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
  flex-shrink: 0;
}

/* クリッカブルな送信者名 */
.chat-sender-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.chat-sender-link:hover { color: var(--gold-bright); }

/* ══════════════════════════════════════
   プレイヤープロフィールモーダル
══════════════════════════════════════ */
.pf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60,30,0,0.6);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.pf-modal {
  background: linear-gradient(160deg, #fdf6e4, #f0e0b4);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  width: min(480px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 48px rgba(120,80,10,0.3), inset 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
}
.pf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--gold-border);
  background: linear-gradient(180deg, #faecc8, #eddcaa);
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,220,100,0.5) inset;
}
.pf-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255,220,80,0.4);
}
.pf-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.pf-close-btn:hover { color: var(--text-primary); background: rgba(120,80,10,0.08); }

.pf-modal-body {
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* アバター行 */
.pf-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pf-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--gold-border);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(154,114,16,0.2);
}
.pf-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(145deg,rgba(196,144,10,0.16),rgba(154,114,16,0.1));
  border: 2px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.pf-name-block { display: flex; flex-direction: column; gap: 4px; }
.pf-username {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.pf-rank-line { font-size: 13px; color: var(--text-secondary); }

/* プロフ本文 */
.pf-bio {
  background: rgba(255,252,240,0.7);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 3px rgba(120,80,10,0.08);
}

/* セクションタイトル */
.pf-section-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 5px;
  margin-bottom: 2px;
}

/* ステータス */
.pf-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 8px;
}
.pf-stat-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,248,210,0.7);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.pf-sk { font-size: 10px; color: var(--text-dim); min-width: 30px; }
.pf-sv { font-size: 12px; font-weight: 700; color: var(--text-primary); }

/* 装備 */
.pf-eq-list { display: flex; flex-direction: column; gap: 4px; }
.pf-eq-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255,248,210,0.5);
}
.pf-eq-slot {
  min-width: 52px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}
.pf-eq-val { color: var(--text-primary); }
.pf-eq-val small { color: var(--text-secondary); font-size: 10px; margin-left: 2px; }
.pf-eq-none { color: var(--text-muted); }

/* アビリティ */
.pf-ab-section { display: flex; flex-direction: column; gap: 8px; }
.pf-ab-cat { display: flex; flex-direction: column; gap: 4px; }
.pf-ab-cat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pf-ab-items { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-ab-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg,rgba(196,144,10,0.14),rgba(154,114,16,0.08));
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,220,80,0.3);
}
.pf-ab-rank {
  font-weight: 700;
  font-size: 11px;
}

/* 称号 */
.pf-titles { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-title-badge {
  background: rgba(109,40,217,0.08);
  border: 1px solid rgba(109,40,217,0.25);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--purple);
}

/* データなし */
.pf-no-data {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0;
}
.pf-empty-note {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* 設定タブ — バイオ入力 */
.settings-bio-input {
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0;
}
.settings-bio-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

/* ─── 目標ボード ─────────────────────────────────────────────────────── */
.goal-board {
  background: rgba(255,248,210,0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.goal-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.goal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 5px;
  line-height: 1.4;
}
.goal-title { flex: 1; }
.goal-meta  { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.goal-reward-label {
  font-size: 11px;
  color: var(--text-muted);
}
.goal-claimed-label {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}
.goal-claim-btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
  background: rgba(74,222,128,0.15) !important;
  border-color: rgba(74,222,128,0.5) !important;
  color: #166534 !important;
}
.goal-claim-btn:hover {
  background: rgba(74,222,128,0.25) !important;
}
.goal-item.done {
  color: var(--text-muted);
  opacity: 0.55;
}
.goal-item.done .goal-title {
  text-decoration: line-through;
}
.goal-item.ready {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.3);
}
.goal-item.ready .goal-title {
  color: #166534;
  font-weight: 600;
}
.goal-item.ready .goal-reward-label {
  color: #166534;
  opacity: 0.8;
}
.goal-item.current {
  color: var(--gold-bright);
  background: rgba(196,144,10,0.1);
  border: 1px solid rgba(196,144,10,0.3);
  font-weight: 700;
}
.goal-item.current .goal-reward-label {
  color: var(--gold-bright);
  opacity: 0.85;
}
.goal-item.future {
  color: var(--text-dim);
  opacity: 0.45;
}

/* ═══════════════════════════════════════════════════════════
   ランキングタブ
   ═══════════════════════════════════════════════════════════ */
.ranking-wrap {
  padding: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.ranking-header {
  text-align: center;
  margin-bottom: 10px;
}
.ranking-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}
.ranking-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}
.ranking-subtab-btn {
  flex: 1;
  padding: 7px 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ranking-subtab-btn:hover {
  background: var(--gold-bg);
  color: var(--gold-bright);
}
.ranking-subtab-btn.active {
  background: var(--gold-bg);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  font-weight: bold;
}
.rank-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.rank-desc {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
}
.rank-week-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: var(--gold-bg);
  border-bottom: 1px solid var(--gold-border);
  font-size: 0.82rem;
}
.rank-week-label {
  font-weight: bold;
  color: var(--gold-bright);
}
.rank-week-reset {
  color: var(--text-dim);
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.rank-table thead tr {
  background: var(--bg-darkest);
}
.rank-table th {
  padding: 7px 10px;
  color: var(--text-secondary);
  font-weight: bold;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}
.rank-th-num  { width: 48px; text-align: center; }
.rank-th-val  { width: 100px; text-align: right; }
.rank-th-sub  { width: 90px; text-align: right; color: var(--text-muted); }
.rank-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--gold-bg); }
.rank-row.rank-self {
  background: rgba(154, 114, 16, 0.13);
}
.rank-row.rank-self:hover {
  background: rgba(154, 114, 16, 0.2);
}
.rank-num {
  padding: 9px 6px;
  text-align: center;
  font-weight: bold;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.rank-medal {
  font-size: 1.1rem;
}
.rank-name {
  padding: 9px 10px;
}
.rank-player-name {
  color: var(--gold-bright);
  cursor: pointer;
  font-weight: bold;
}
.rank-player-name:hover {
  text-decoration: underline;
}
.rank-self-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  background: var(--gold-border);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--gold-bright);
}
.rank-val {
  padding: 9px 10px;
  text-align: right;
}
.rank-badge-sm {
  font-weight: bold;
  font-size: 0.88rem;
}
.rank-gold-val {
  font-weight: bold;
  color: var(--gold-bright);
}
.rank-sub {
  padding: 9px 10px;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.rank-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.rank-empty-cell {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
   スキルシステム
   ═══════════════════════════════════════════════════════════ */

/* ─── ヘッダーMP ─── */
.hstat.mp b { color: var(--blue); }

/* ─── 戦闘画面 MP バー ─── */
.mp-track { margin-top: 3px; }
.mp-fill  { height: 100%; background: linear-gradient(90deg, var(--blue), #8ab4f8); border-radius: 5px; transition: width 0.3s; }
.b-fmp    { font-size: 0.78rem; color: var(--blue); }

/* ─── 戦闘スキルボタン ─── */
.b-skill-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.b-skill-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 110px;
  font-size: 0.82rem;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.b-skill-mp {
  font-size: 0.75rem;
  color: var(--blue);
  font-weight: bold;
  margin-left: auto;
}

/* ─── スキル編成タブ ─── */
.skills-wrap {
  padding: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.skills-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: 12px;
}
.skills-section-title {
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--gold-bright);
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.skill-select-hint {
  font-size: 0.80rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding: 5px 8px;
  background: var(--gold-bg);
  border-radius: 5px;
  border: 1px solid var(--gold-border);
}

/* スロット */
.skill-slots { display: flex; flex-direction: column; gap: 6px; }
.skill-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.skill-slot:hover    { border-color: var(--gold-bright); background: var(--gold-bg); }
.skill-slot.selected { border-color: var(--gold-bright); background: var(--gold-bg); box-shadow: 0 0 0 2px var(--gold-border); }
.skill-slot.empty    { opacity: 0.65; }
.skill-slot-num {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--gold-bright);
  flex-shrink: 0;
}
.skill-slot-body  { flex: 1; min-width: 0; }
.skill-slot-name  { font-weight: bold; font-size: 0.88rem; color: var(--text-primary); }
.skill-slot-desc  { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.skill-slot-cond  { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.skill-slot-cond.warn { color: var(--red); }
.skill-slot-mp    { font-size: 0.75rem; color: var(--blue); }
.skill-slot-empty-label { color: var(--text-muted); font-size: 0.85rem; }
.skill-unequip-btn { flex-shrink: 0; font-size: 0.78rem; padding: 3px 8px; }

/* スキルバッジ */
.skill-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.70rem;
  font-weight: bold;
  margin-left: 4px;
  vertical-align: middle;
}
.skill-badge.active  { background: rgba(90,136,216,0.15); color: var(--blue); border: 1px solid rgba(90,136,216,0.3); }
.skill-badge.passive { background: rgba(144,96,204,0.12); color: var(--purple); border: 1px solid rgba(144,96,204,0.3); }

/* 解放済みスキルリスト */
.skill-unlocked-list { display: flex; flex-direction: column; gap: 8px; }
.skill-unlock-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.8;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.skill-list-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.skill-list-item.equipped { border-color: var(--gold-bright); background: var(--gold-bg); }
.skill-list-header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.skill-list-name   { font-weight: bold; font-size: 0.92rem; color: var(--text-primary); }
.skill-list-mp     { font-size: 0.78rem; color: var(--blue); margin-left: 4px; }
.skill-list-desc   { font-size: 0.83rem; color: var(--text-secondary); margin-bottom: 3px; }
.skill-list-flavor { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-bottom: 5px; }
.skill-list-meta   { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 6px; }
.skill-list-cond.warn { color: var(--red); }
.skill-list-action { display: flex; justify-content: flex-end; }
.skill-equipped-label { font-size: 0.80rem; color: var(--gold-bright); font-weight: bold; }
.skill-not-equipped   { font-size: 0.80rem; color: var(--text-muted); }

/* 未習得スキルリスト */
.skill-locked-section {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 7px;
  opacity: 0.75;
}
.skill-locked-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.skill-locked-item:last-child { border-bottom: none; }
.skill-locked-name { font-weight: bold; }
.skill-locked-cond { font-size: 0.75rem; color: var(--text-muted); }

/* ─── チュートリアルバナー ──────────────────────────────────────────────── */
.tutorial-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fdf6e3 0%, #f0e2b8 100%);
  border: 2px solid #c8a84b;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(120,80,10,0.15);
  position: relative;
}

/* ミライラスト */
.tut-left {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
}
.tut-mira-img {
  width: 72px;
  height: 108px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 2px 5px rgba(80,50,10,0.22));
}

/* 吹き出し */
.tut-bubble-wrap {
  flex: 1;
  min-width: 0;
}
.tut-bubble {
  background: #fffbf0;
  border: 1.5px solid #d4af60;
  border-radius: 10px;
  padding: 9px 13px;
  position: relative;
}
/* 左向き三角（ミラ方向） */
.tut-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #d4af60;
}
.tut-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #fffbf0;
}
.tut-speaker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.tut-speaker-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: #7a5a18;
  letter-spacing: 0.05em;
}
.tut-prog {
  font-size: 10px;
  color: #a08040;
  background: rgba(200,168,75,0.18);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.tut-text {
  font-size: 13px;
  line-height: 1.65;
  color: #2e1e08;
}

/* スキップボタンエリア */
.tut-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-skip-btn {
  font-size: 11px;
  color: #8a6a28;
  background: transparent;
  border: 1px solid #c8a84b;
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
  transition: background 0.15s;
}
.tut-skip-btn:hover { background: rgba(200,168,75,0.18); }
.tut-skip-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.tut-skip-q {
  font-size: 11px;
  color: #7a5a20;
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .tut-mira-img { width: 48px; height: 72px; }
  .tut-bubble::before, .tut-bubble::after { display: none; }
  .tut-right { flex-basis: 100%; }
  .tutorial-banner { flex-wrap: wrap; }
}

/* タブナビ: スマホ横スクロール対応 */
@media (max-width: 899px) {
  .tab-btn {
    flex: 0 0 auto;
    font-size: 11px;
    padding: 10px 8px;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   サーバー起動待ち画面
═══════════════════════════════════════════════════════ */
.server-wake-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fdf8ee;
}
.server-wake-box {
  text-align: center;
  padding: 40px 32px;
  background: #fffdf5;
  border: 1.5px solid #e0c870;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(200,168,75,0.15);
  max-width: 320px;
}
.server-wake-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.server-wake-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 24px;
  color: #7a5a20;
  margin-bottom: 16px;
}
.server-wake-msg {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #6b5020;
  line-height: 1.7;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════
   アビリティツリータブ
═══════════════════════════════════════════════════════ */
.abt-wrap {
  padding: 10px 8px 20px;
}

/* ── カテゴリタブ ── */
.abt-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.abt-cat-btn {
  padding: 6px 18px;
  border: 1.5px solid #c8a84b;
  border-radius: 20px;
  background: #fffdf5;
  color: #7a5a20;
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(200,168,75,0.15);
}
.abt-cat-btn:hover {
  background: #fdf0c2;
  box-shadow: 0 2px 8px rgba(200,168,75,0.35);
}
.abt-cat-btn.active {
  background: linear-gradient(135deg, #d4a843 0%, #c8903a 100%);
  color: #fff;
  border-color: #b8852e;
  box-shadow: 0 2px 8px rgba(200,140,50,0.45);
}

/* ── セクション ── */
.abt-body { display: flex; flex-direction: column; gap: 20px; }
.abt-section { display: flex; flex-direction: column; gap: 10px; }
.abt-section-hd {
  font-size: 12px;
  font-weight: 700;
  color: #7a5a20;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: linear-gradient(90deg, #fdf0c2 0%, transparent 100%);
  border-left: 3px solid #c8a84b;
  border-radius: 0 4px 4px 0;
}

/* ── チェーン行 ── */
.abt-chain {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow-x: auto;
  padding: 6px 4px 8px;
  gap: 0;
  /* スクロールバー非表示（Webkit） */
  scrollbar-width: thin;
  scrollbar-color: #e0d0a0 transparent;
}
.abt-chain::-webkit-scrollbar { height: 4px; }
.abt-chain::-webkit-scrollbar-track { background: transparent; }
.abt-chain::-webkit-scrollbar-thumb { background: #e0d0a0; border-radius: 2px; }

/* ── ノード列 ── */
.abt-node-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 92px;
}

/* ── ノード本体 ── */
.abt-node {
  width: 86px;
  min-height: 58px;
  border-radius: 10px;
  padding: 8px 6px 7px;
  text-align: center;
  border: 1.5px solid;
  border-top: 3.5px solid;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  transition: transform 0.1s, box-shadow 0.15s;
}
.abt-node:hover { transform: translateY(-1px); }

/* 解放済み */
.abt-node-open {
  background: linear-gradient(160deg, #fffef6 0%, #fef8e0 100%);
  border-color: #c8a84b;
  box-shadow: 0 2px 8px rgba(200,168,75,0.25), inset 0 1px 0 rgba(255,255,200,0.8);
}
/* 未解放 */
.abt-node-lock {
  background: #f4f1eb;
  border-color: #ccc5b4;
  border-top-color: #bbb5a4 !important;
  box-shadow: none;
  opacity: 0.78;
}

/* ノード内テキスト */
.abt-node-label {
  font-size: 11px;
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.3;
  color: #3a2a08;
  word-break: keep-all;
}
.abt-node-lock .abt-node-label {
  color: #a09585;
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ランクバッジ（丸） */
.abt-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.abt-rank-none {
  background: #d0c8bc;
  color: #888;
  font-size: 13px;
  text-shadow: none;
  box-shadow: none;
}

/* ── スキルタグ ── */
.abt-skills-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  width: 88px;
}
.abt-sk {
  font-size: 10px;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  text-align: center;
}
.abt-sk-open {
  background: #e6f5e6;
  color: #286028;
  border: 1px solid #90cc90;
  box-shadow: 0 1px 3px rgba(60,140,60,0.12);
}
.abt-sk-lock {
  background: #eeeae4;
  color: #aca090;
  border: 1px solid #d4cfc6;
  letter-spacing: 0.04em;
}

/* ── コネクタ（矢印ライン） ── */
.abt-conn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 22px;   /* ノード中央に合わせる (58/2 - lineH/2) */
  width: 18px;
  position: relative;
  height: 14px;
  display: flex;
  align-items: center;
}
.abt-conn::before {
  content: '';
  display: block;
  width: 10px;
  height: 2px;
  background: linear-gradient(to right, #c8a84b, #e0b84a);
}
.abt-conn::after {
  content: '▶';
  font-size: 9px;
  color: #c8a84b;
  line-height: 1;
  margin-left: -1px;
}
/* 未解放→未解放のコネクタ */
.abt-conn-dim::before { background: #ccc5b0; }
.abt-conn-dim::after  { color: #ccc5b0; }

/* ═══════════════════════════════════════════════════════
   サイトフッター（タイトル・ゲーム共通）
═══════════════════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 12px 16px 16px;
  font-size: 11px;
  color: #7a5c1e;
  border-top: 1px solid rgba(100,72,8,0.20);
  background: rgba(180,150,70,0.07);
  margin-top: auto;
  flex-shrink: 0;
}
.site-footer a {
  color: #7a5c1e;
  text-decoration: none;
  margin: 0 8px;
  opacity: 0.85;
}
.site-footer a:hover {
  color: #4a2e08;
  text-decoration: underline;
  opacity: 1;
}
.site-footer .footer-sep {
  color: #c9a84c;
  margin: 0 2px;
}
/* ═══════════════════════════════════════════════════════════
   経済PvP: 市場相場・一括購入
═══════════════════════════════════════════════════════════ */
.market-summary-section {
  margin: 12px 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.market-summary-title {
  font-size: 13px; font-weight: 700; color: var(--accent);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: #f5edd8; margin: 0;
}
.market-summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.market-summary-table th {
  padding: 6px 10px; background: #f0e8d0; color: var(--accent);
  font-size: 11px; font-weight: 700; text-align: left; border-bottom: 1px solid var(--border);
}
.market-sum-row td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.market-sum-row:last-child td { border-bottom: none; }
.market-sum-row:hover td { background: #faf5e8; }
.market-sum-q     { font-weight: 700; }
.market-sum-price { font-weight: 700; color: var(--text-main); white-space: nowrap; }
.market-unit      { font-size: 11px; color: var(--text-secondary); }
.market-sum-qty   { color: var(--text-secondary); white-space: nowrap; }
.market-count     { font-size: 11px; }
.market-sum-action { text-align: right; }
.market-buyall-btn {
  background: #fff3e0; border-color: #c9740c; color: #7a4000;
  white-space: nowrap;
}
.market-buyall-btn:hover { background: #ffe0b0; }
.market-detail-title { font-size: 13px; font-weight: 700; color: var(--accent); margin: 12px 0 6px; }

/* 出品フォーム拡張 */
.listing-price-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.listing-price-row .g-input { flex: 0 0 120px; }
.min-price-hint {
  font-size: 12px; color: var(--text-secondary);
  background: #f5f0e0; border-radius: 4px; padding: 3px 8px;
  border: 1px solid var(--border); flex: 1;
}
/* 自分の出品の価格ステータス */
.price-lowest  { font-size: 11px; color: #2a8a2a; font-weight: 700; background: #e8f5e8; padding: 1px 6px; border-radius: 3px; }
.price-undercut { font-size: 11px; color: #c44; background: #fee; padding: 1px 6px; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════
   冒険者ギルドタブ
═══════════════════════════════════════════════════════════ */
.guild-wrap { padding: 12px 4px; max-width: 740px; margin: 0 auto; }
.guild-loading { text-align: center; color: var(--text-secondary); padding: 40px; }
.guild-page-title { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }

/* 招待バナー */
.guild-invite-banner {
  background: #fdf6e3;
  border: 1px solid #c9a84c;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.guild-invite-banner-title { font-weight: 700; color: #8a6a00; margin-bottom: 8px; font-size: 13px; }
.guild-inv-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-top: 1px solid #e8d8a0; flex-wrap: wrap;
}
.guild-inv-name  { font-weight: 700; color: var(--text-main); }
.guild-inv-from  { font-size: 12px; color: var(--text-secondary); flex: 1; }

/* 未所属グリッド */
.guild-noguild-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) { .guild-noguild-grid { grid-template-columns: 1fr; } }

/* パネル共通 */
.guild-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.guild-panel-title {
  font-size: 14px; font-weight: 700; color: var(--accent);
  margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}

/* 設立フォーム */
.guild-form { display: flex; flex-direction: column; gap: 4px; }
.guild-label { font-size: 12px; color: var(--text-secondary); }
.guild-desc-input { min-height: 60px; resize: vertical; }
.guild-cost-row {
  display: flex; align-items: center; gap: 8px;
  background: #f5edd8; border-radius: 4px; padding: 6px 10px; margin: 6px 0;
}
.guild-cost-label { font-size: 12px; color: var(--text-secondary); }
.guild-cost-val   { font-weight: 700; color: var(--accent); }
.guild-cost-have  { font-size: 11px; }
.guild-create-btn { margin-top: 4px; width: 100%; }

/* 検索 */
.guild-search-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.guild-search-bar .g-input { flex: 1; }
.guild-search-hint { text-align: center; color: var(--text-secondary); padding: 20px 0; font-size: 13px; }
.guild-search-results { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.guild-search-row {
  background: #faf5e8; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
}
.guild-search-info { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.guild-search-name { font-weight: 700; color: var(--text-main); font-size: 14px; }
.guild-search-meta { font-size: 12px; color: var(--text-secondary); }
.guild-search-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ギルドカード（所属中） */
.guild-card {
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.guild-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.guild-card-name { font-size: 20px; font-weight: 700; color: var(--text-main); }
.guild-rank-badge { font-weight: 700; font-size: 13px; }
.guild-card-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.guild-card-meta b { color: var(--text-main); }
.guild-card-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; font-style: italic; }
.guild-card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.guild-expand-btn { background: #e8f4e8; border-color: #4a8a4a; color: #2a5a2a; }

/* 招待フォーム */
.guild-invite-form { margin-bottom: 14px; }
.guild-invite-row-form { display: flex; gap: 8px; margin-top: 8px; }
.guild-invite-row-form .g-input { flex: 1; }

/* セクションタイトル */
.guild-section-title {
  font-size: 13px; font-weight: 700; color: var(--accent);
  margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}

/* メンバーテーブル */
.guild-member-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.guild-member-table th {
  background: #f0e8d0; color: var(--accent);
  padding: 6px 8px; text-align: left; font-size: 12px; border-bottom: 2px solid var(--border);
}
.guild-member-row td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.guild-member-row:last-child td { border-bottom: none; }
.guild-member-row:hover td { background: #faf5e8; }
.guild-member-row.guild-self td { background: #f5f0e0; }
.guild-role-cell   { font-size: 12px; white-space: nowrap; color: var(--text-secondary); }
.guild-contrib-cell { font-size: 12px; color: var(--text-secondary); text-align: right; }
.guild-action-cell { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.guild-role-sel {
  border: 1px solid var(--border); background: var(--card-bg); border-radius: 4px;
  padding: 2px 4px; font-size: 11px; color: var(--text-main); cursor: pointer;
}
/* ギルド一覧パネル */
.guild-list-panel { margin-top: 14px; }
.guild-search-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.guild-search-main { flex: 1; min-width: 0; }
.guild-search-action { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding-top: 2px; }
.guild-applied-badge { font-size: 11px; color: #6a4; font-weight: 700; white-space: nowrap; }
.guild-full-badge    { font-size: 11px; color: #a44; font-weight: 700; white-space: nowrap; }
/* 加入申請パネル（マスター/役員向け） */
.guild-section-applications { margin-bottom: 14px; }
.guild-app-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.guild-app-row:last-child { border-bottom: none; }
.guild-app-name { font-weight: 700; color: var(--text-main); flex: 1; }
.guild-app-date { font-size: 11px; color: var(--text-secondary); }

/* タイトル画面：フッターを画面最下部に固定 */
.title-screen .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(240,228,195,0.90);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(180,140,50,0.35);
  z-index: 10;
}

/* ════════════════════════════════════════════════════════════════
   コロシアム (Colosseum Tab)
   ════════════════════════════════════════════════════════════════ */
.col-wrap { max-width: 680px; margin: 0 auto; padding: 0 0 24px; }

.col-header { margin-bottom: 12px; }
.col-title  { font-size: 20px; color: var(--accent); margin: 0 0 4px; font-family: 'Cinzel Decorative', serif; }
.col-desc   { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* サブタブ */
.col-subtabs { display: flex; gap: 6px; margin-bottom: 16px; }
.col-stab {
  padding: 6px 18px; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text-main); font-size: 13px; cursor: pointer;
}
.col-stab.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 登録カード */
.col-register-card {
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
}
.col-reg-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.col-snap-row  { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.col-snap-stat { font-size: 13px; }
.col-reg-info  { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.col-rating-badge { font-size: 15px; font-weight: 600; color: var(--accent); }
.col-record       { font-size: 13px; color: var(--text-secondary); }
.col-daily-badge  { font-size: 13px; background: #f0e8d0; padding: 2px 8px; border-radius: 4px; }
.col-reg-btn      { margin-top: 2px; }

/* 対戦カード */
.col-battle-card {
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
}
.col-match-row { display: flex; gap: 16px; flex-wrap: wrap; }
.col-match-box {
  flex: 1; min-width: 220px; background: #faf5e8; border-radius: 8px;
  padding: 12px 14px;
}
.col-match-title { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.col-match-desc  { font-size: 12px; color: var(--text-secondary); margin: 0 0 10px; }
.col-fight-btn   { width: 100%; }
.col-target-row  { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.col-target-in   { flex: 1; min-width: 100px; }

/* 対戦結果 */
.col-result-card {
  border-radius: 10px; padding: 16px; margin-top: 14px;
  border: 2px solid var(--border);
}
.col-result-card.col-win  { border-color: #4a9e5c; background: #f0faf2; }
.col-result-card.col-lose { border-color: #b84848; background: #fdf2f2; }
.col-result-title {
  font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 12px;
}
.col-win  .col-result-title { color: #2e7d40; }
.col-lose .col-result-title { color: #8b2020; }
.col-result-vs { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 12px; }
.col-result-side { text-align: center; }
.col-result-sep  { font-size: 22px; font-weight: 700; color: var(--text-secondary); }
.col-result-name { font-size: 15px; font-weight: 700; }
.col-result-hp   { font-size: 12px; color: var(--text-secondary); }
.col-result-rating { font-size: 13px; }

/* ランキング */
.col-ranking { margin-top: 2px; }
.col-refresh-btn { margin-bottom: 10px; }
.col-rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.col-rank-table th {
  background: #f0e8d0; color: var(--accent); padding: 6px 8px;
  text-align: left; font-size: 12px; border-bottom: 2px solid var(--border);
}
.col-rank-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.col-rank-table tr:last-child td { border-bottom: none; }
.col-rank-table tr:hover td { background: #faf5e8; }
.col-me-row td { background: #f5f0e0; font-weight: 600; }

/* 履歴 */
.col-history { display: flex; flex-direction: column; gap: 6px; }
.col-hist-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-bg); font-size: 13px;
}
.col-hist-win  { border-left: 4px solid #4a9e5c; }
.col-hist-lose { border-left: 4px solid #b84848; }
.col-hist-badge {
  font-weight: 700; font-size: 13px; min-width: 22px; text-align: center;
  padding: 1px 6px; border-radius: 4px;
}
.col-hist-win  .col-hist-badge { background: #d4f0dc; color: #2e7d40; }
.col-hist-lose .col-hist-badge { background: #fdd8d8; color: #8b2020; }
.col-hist-opp     { flex: 1; }
.col-hist-rating  { min-width: 110px; }
.col-hist-turns   { font-size: 12px; color: var(--text-secondary); }
.col-hist-date    { font-size: 11px; color: var(--text-secondary); margin-left: auto; }

/* 戦闘ログ */
.col-log-details { margin-top: 8px; font-size: 12px; }
.col-log-details summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.col-log { max-height: 200px; overflow-y: auto; background: #fdf8ec; border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.col-log-turn { color: var(--text-secondary); font-size: 11px; margin: 6px 0 2px; }
.col-log-line { padding: 1px 0; }
.col-crit     { color: #c05020; }

/* 汎用 */
.col-up   { color: #2e7d40; }
.col-down { color: #8b2020; }
.col-hint { color: var(--text-secondary); font-size: 13px; margin: 8px 0; }

/* ════════════════════════════════════════════════════════════════
   NPC露店 (NPC Stall Section)
   ════════════════════════════════════════════════════════════════ */
.npc-stall-section { margin-top: 18px; }
.npc-stall-section-title {
  font-size: 14px; font-weight: 700; color: var(--accent);
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.npc-stall-section-title small { font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.npc-stall-refresh-btn { margin-left: auto; }

.npc-stall-card {
  background: #fdf8ec; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px;
}
.npc-stall-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.npc-stall-name-title { font-weight: 700; font-size: 14px; color: var(--accent); }
.npc-stall-title-tag {
  font-size: 11px; background: var(--border); color: var(--text-secondary);
  padding: 1px 7px; border-radius: 10px;
}

.npc-stall-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 5px 2px; border-bottom: 1px dashed #e8dfc0;
}
.npc-stall-row:last-child { border-bottom: none; }
.npc-stall-row.npc-stall-sold { opacity: 0.5; }

.npc-stall-name  { flex: 1; font-size: 13px; }
.npc-stall-qty   { font-size: 12px; color: #4a8; min-width: 60px; }
.npc-stall-soldout { font-size: 12px; color: #b84; min-width: 60px; font-weight: 600; }
.npc-stall-price { font-size: 13px; font-weight: 600; color: var(--accent); min-width: 72px; text-align: right; }
.npc-stall-qty-in {
  width: 52px !important;
  min-width: 52px;
  padding: 6px 6px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.npc-stall-qty-in::-webkit-outer-spin-button,
.npc-stall-qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ═══ 個人商店 ══════════════════════════════════════════════════════════════ */
.pshop-open-wrap { max-width: 560px; margin: 0 auto; padding: 8px 0 24px; }
.pshop-conds { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.pshop-cond {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-radius: 8px; border: 1.5px solid var(--border); font-size: 13px;
}
.pshop-cond.met   { background: #f0fdf0; border-color: #6cba6c; }
.pshop-cond.unmet { background: #fdf5f0; border-color: #d4a070; }
.pshop-cond-icon  { font-weight: 700; font-size: 15px; min-width: 16px; }
.pshop-cond.met   .pshop-cond-icon { color: #3a8a3a; }
.pshop-cond.unmet .pshop-cond-icon { color: #c06030; }
.pshop-cond-label { flex: 1; }
.pshop-cond-hint  { font-size: 11px; color: var(--text-secondary); }
.pshop-open-form  { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

.pshop-manager { }
.pshop-rank-badge {
  display: inline-block; font-size: 11px; background: var(--accent); color: #fff;
  padding: 1px 8px; border-radius: 10px; margin-left: 4px; font-weight: 600;
}
.pshop-browser { margin-top: 18px; }
.pshop-profile {
  font-size: 12px; color: var(--text-secondary); margin: 4px 0 8px;
  padding: 4px 8px; background: #fafaf5; border-left: 2px solid var(--border); border-radius: 2px;
}
.pshop-surcharge { font-size: 10px; color: #c06030; margin-left: 2px; }

/* Personal shop toolbar */
.pshop-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; }
.pshop-toolbar-label { font-size: 12px; color: var(--text-secondary); margin-right: 2px; }
.pshop-filter-btn { font-size: 12px; padding: 3px 10px; border: 1.5px solid var(--border); background: var(--bg); border-radius: 12px; cursor: pointer; color: var(--text-secondary); transition: all .15s; }
.pshop-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pshop-sort-select { font-size: 12px; padding: 3px 8px; border: 1.5px solid var(--border); background: var(--bg); border-radius: 6px; cursor: pointer; color: var(--text); }
.pshop-toolbar-sep { flex: 1; }

/* Personal shop collapsible sections */
.pshop-section { margin-bottom: 10px; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.pshop-section-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f5f3ec; cursor: pointer; user-select: none; }
.pshop-section-header:hover { background: #ede9de; }
.pshop-section-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.pshop-section-count { font-size: 11px; color: var(--text-secondary); background: var(--border); padding: 1px 7px; border-radius: 10px; }
.pshop-section-arrow { font-size: 11px; color: var(--text-secondary); transition: transform .15s; }
.pshop-section-arrow.open { transform: rotate(90deg); }
.pshop-section-body { padding: 8px 10px; background: var(--bg); }

.pshop-stall-city { margin-bottom: 12px; }
.pshop-stall-city-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  padding: 4px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}

/* ═══ レイドボス共闘タブ ═══════════════════════════════════════════════════ */
.raid-wrap { max-width: 640px; margin: 0 auto; padding: 8px 0 24px; }
.raid-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.raid-title { font-size: 17px; font-weight: 700; color: var(--accent); margin: 0; flex: 1; }
.raid-refresh-btn {
  font-size: 12px; padding: 4px 10px; border: 1.5px solid var(--border);
  background: var(--bg-panel); border-radius: 6px; cursor: pointer; color: var(--text-secondary);
}
.raid-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

.raid-boss-card {
  background: linear-gradient(135deg, #2d1a1a 0%, #1a0a0a 100%);
  border: 2px solid #8b1a1a; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 14px; color: #f5e6d0;
}
.raid-boss-name { font-size: 22px; font-weight: 700; text-align: center; color: #ffccaa; margin-bottom: 4px; }
.raid-boss-sub  { text-align: center; font-size: 13px; color: #d4b896; margin-bottom: 10px; }
.raid-hp-bar-bg {
  width: 100%; height: 14px; background: #3a1a1a; border-radius: 7px;
  overflow: hidden; border: 1px solid #5a2020; margin-bottom: 10px;
}
.raid-hp-bar-fill { height: 100%; border-radius: 7px; transition: width .5s; }
.raid-boss-meta { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: #c8a880; flex-wrap: wrap; }

.raid-reward-info {
  background: #fffbf0; border: 1.5px solid #e8d88a; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px;
}
.raid-reward-title { font-weight: 700; font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.raid-reward-list  { display: flex; flex-wrap: wrap; gap: 6px; }
.raid-reward-badge {
  font-size: 12px; background: #f5f0d8; border: 1px solid #d8c870;
  border-radius: 20px; padding: 2px 10px; color: #7a6030;
}
.raid-reward-badge.top3 { background: #fff3d0; border-color: #e8a820; color: #905010; }

.raid-attack-area { text-align: center; margin: 16px 0; }
.raid-attack-note { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.raid-attack-btn {
  padding: 12px 36px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: #fff; border: none; border-radius: 8px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(185,28,28,.4);
}
.raid-attack-btn:hover:not(:disabled) { background: linear-gradient(135deg, #dc2626, #991b1b); }
.raid-attack-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.raid-attacked-msg {
  text-align: center; padding: 12px; margin: 12px 0;
  background: #f0f8f0; border: 1.5px solid #6aa; border-radius: 8px;
  color: #2a6a2a; font-size: 14px;
}

.raid-section { margin-top: 16px; }
.raid-section-title { font-weight: 700; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

.raid-participants { display: flex; flex-direction: column; gap: 4px; }
.raid-participant-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; background: var(--bg-panel); border: 1px solid var(--border);
}
.raid-participant-row.raid-me { background: #f0f8ff; border-color: #7aa; }
.raid-rank    { font-size: 16px; min-width: 28px; text-align: center; }
.raid-pname   { flex: 1; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.raid-pname:hover { text-decoration: underline; }
.raid-damage  { font-size: 13px; color: #b84040; font-weight: 600; }

.raid-history-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  border-bottom: 1px dashed var(--border); font-size: 13px; flex-wrap: wrap;
}
.raid-history-name { font-weight: 600; flex: 1; }
.raid-history-meta { color: var(--text-secondary); font-size: 12px; }
.raid-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.raid-status.defeated { background: #d4edda; color: #155724; }
.raid-status.expired  { background: #f5c6cb; color: #721c24; }

.raid-no-boss { text-align: center; padding: 32px 16px; }
.raid-no-boss-icon { font-size: 48px; margin-bottom: 12px; }
.raid-no-boss-msg  { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.raid-no-boss-sub  { font-size: 13px; color: #aaa; margin-bottom: 24px; }

.raid-loading { color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.raid-loading:hover { color: var(--accent); text-decoration: underline; }

/* ═══ 冒険者協会タブ ═══════════════════════════════════════════════════════ */
.assoc-wrap       { max-width: 680px; margin: 0 auto; padding: 8px 0 24px; }
.assoc-header     { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.assoc-title      { font-size: 17px; font-weight: 700; color: var(--gold); margin: 0; }
.assoc-location   { font-size: 13px; color: var(--text-secondary); }
.assoc-empty      { color: var(--text-secondary); font-size: 14px; padding: 24px 0; text-align: center; }

.assoc-quest-list { display: flex; flex-direction: column; gap: 10px; }

.assoc-card {
  position: relative;
  display: flex; align-items: stretch;
  min-height: 150px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.assoc-card::before {
  content: none;
}
.assoc-card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.assoc-card-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}
.assoc-card-media.fallback::before {
  content: "QUEST";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.16em;
  font-size: 14px;
  color: rgba(80,52,8,0.74);
}
.assoc-card.status-done      { opacity: 0.72; }
.assoc-card.status-locked    { opacity: 0.62; }
.assoc-card.status-active    { box-shadow: none; }
.assoc-card.status-ready     { box-shadow: none; }
.assoc-card.status-available { box-shadow: none; }

.assoc-card-left  { position: relative; z-index: 2; flex: 1; padding: 26px 14px 12px; min-width: 0; }
.assoc-card-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 14px 12px;
  border-left: 0;
  background: transparent;
  min-width: 128px;
}

.assoc-card-top   { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.assoc-card-title { font-size: 14px; font-weight: 700; color: #2e1a06; text-shadow: 0 1px 0 rgba(255,250,232,0.70); }
.assoc-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
  background: transparent;
  color: #4a3810;
}
.assoc-status-badge.status-ready     { color: #2f7a2f; }
.assoc-status-badge.status-active    { color: #2b5f9a; }
.assoc-status-badge.status-available { color: #1f8a3c; }
.assoc-status-badge.status-done      { color: #2f7a2f; }
.assoc-status-badge.status-locked    { color: #7a6a58; }

.assoc-card-desc   { font-size: 12px; color: #40270b; margin-bottom: 4px; line-height: 1.5; text-shadow: 0 1px 0 rgba(255,250,232,0.70); }
.assoc-card-obj    { font-size: 12px; color: #5a3e08; background: transparent; border: 0; border-radius: 0; padding: 0; margin-bottom: 4px; display: inline-block; }
.assoc-card-reward { font-size: 12px; color: #2e1a06; margin-bottom: 4px; text-shadow: 0 1px 0 rgba(255,250,232,0.72); }
.assoc-card-npc    { font-size: 11px; color: #5a4420; text-shadow: 0 1px 0 rgba(255,250,232,0.68); }

.assoc-rwd-gold    { color: #b87800; font-weight: 700; margin-right: 4px; }
.assoc-rwd-item    { margin-right: 6px; }

.assoc-progress    { font-size: 12px; color: #1a3e80; background: transparent; padding: 0; border-radius: 0; font-weight: 700; }
.assoc-done-badge  { font-size: 13px; color: #1a5a1a; font-weight: 700; }
.assoc-lock-badge  { font-size: 11px; color: #7a6a58; text-align: center; line-height: 1.5; background: transparent; }

@media (max-width: 640px) {
  .assoc-card {
    min-height: 132px;
  }
  .assoc-card-left {
    padding: 20px 12px 10px;
  }
  .assoc-card-right {
    min-width: 104px;
    padding: 20px 8px 10px;
  }
}

@media (max-width: 900px) {
  .assoc-card {
    min-height: clamp(136px, 34vw, 176px);
    align-items: center;
  }
  .assoc-card-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0;
    padding-bottom: 0;
  }
  .assoc-card-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ─── クエストダイアログ ─── */
.quest-dialogue-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.quest-dialogue-box {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  max-width: 520px;
  width: 92%;
  min-height: 320px;
  overflow: hidden;
  box-shadow: none;
}
.quest-dlg-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.quest-dlg-bg-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}
.quest-dlg-bg.fallback::before {
  content: "QUEST";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.16em;
  font-size: 16px;
  color: rgba(80,52,8,0.74);
}
.quest-dlg-overlay-content {
  position: relative;
  z-index: 2;
  padding: 62px 20px 20px;
}
.quest-dlg-overlay-content::before {
  content: none;
}
.quest-dlg-npc-row   { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.assoc-npc-frame     { width: 72px; height: 72px; border-radius: 8px; border: 1px solid rgba(140,100,20,0.3); background: #ede0c0; overflow: hidden; flex-shrink: 0; }
.assoc-npc-img       { width: 100%; height: 100%; object-fit: cover; display: block; }
.assoc-npc-emoji     { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.quest-dlg-bubble    { flex: 1; background: transparent; border: 0; border-radius: 0; padding: 0; }
.quest-dlg-speaker   { font-size: 13px; font-weight: 700; color: #6a4609; margin-bottom: 6px; text-shadow: 0 1px 0 rgba(255,250,232,0.75); }
.quest-dlg-text      { font-size: 13px; color: #2a1807; line-height: 1.7; text-shadow: 0 1px 0 rgba(255,250,232,0.58); }
.quest-dlg-reward    { background: transparent; border: 0; border-radius: 0; padding: 0; margin-bottom: 12px; }
.quest-dlg-reward-label { font-size: 11px; color: #8a6000; font-weight: 700; margin-bottom: 4px; }
.quest-dlg-reward-items { font-size: 13px; color: #2a1807; text-shadow: 0 1px 0 rgba(255,250,232,0.55); }
.quest-dlg-actions   { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ═══ アクティビティログタブ ═══════════════════════════════════════════════ */
.log-wrap        { max-width: 640px; margin: 0 auto; padding: 8px 0 24px; }
.log-title       { font-size: 17px; font-weight: 700; color: var(--accent); margin: 0 0 12px; }

.log-filter-row  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.log-filter-btn  {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text-secondary); cursor: pointer;
}
.log-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.log-list  { display: flex; flex-direction: column; gap: 6px; }
.log-empty { color: var(--text-secondary); font-size: 14px; text-align: center; padding: 32px 0; }

.log-entry {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px;
  border-left-width: 3px;
}
.log-gather    { border-left-color: #4a9a4a; }
.log-drop      { border-left-color: #9a4a4a; }
.log-wholesale { border-left-color: #c8900a; }
.log-npc-buy   { border-left-color: #6a6aaa; }
.log-stall-buy { border-left-color: #4a7aaa; }
.log-stall-sell{ border-left-color: #2a9a6a; }
.log-craft-ok  { border-left-color: #8a4aaa; }
.log-craft-ng  { border-left-color: #888; }
.log-quest     { border-left-color: #d4a830; }

.log-icon  { font-size: 16px; flex-shrink: 0; line-height: 1.4; }
.log-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.log-label { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.log-detail{ font-size: 13px; color: var(--text-main); word-break: break-word; }
.log-party { font-size: 11px; color: var(--text-secondary); }
.log-time  { font-size: 11px; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; align-self: center; }

/* ═══ コロシアム ログ拡張 ═══════════════════════════════════════════════════ */
.col-log-stun    { color: #7a60cc; }
.col-log-miss    { color: #aaa; font-style: italic; }
.col-log-buff    { color: #2a7a4a; }
.col-log-heal    { color: #2a9a5a; font-weight: 700; }
.col-log-endure  { color: #d4a830; font-weight: 700; }
.col-log-counter { color: #c06020; font-size: 11px; margin-left: 4px; }

/* ─── 掲示板タブ ─── */
.board-wrap { padding: 12px; max-width: 800px; margin: 0 auto; }
.board-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.board-title { font-size: 1.05rem; font-weight: 700; color: #5a3e1b; }
.board-new-btn { padding: 6px 14px; background: #c9a96e; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.board-new-btn:hover { background: #b8935a; }
.board-new-form { background: #fdf6e3; border: 1px solid #d4b483; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.board-input { width: 100%; padding: 8px 10px; border: 1px solid #d4b483; border-radius: 6px; background: #fff; font-size: .9rem; margin-bottom: 8px; box-sizing: border-box; }
.board-textarea { width: 100%; padding: 8px 10px; border: 1px solid #d4b483; border-radius: 6px; background: #fff; font-size: .9rem; resize: vertical; box-sizing: border-box; }
.board-form-btns { display: flex; gap: 8px; margin-top: 8px; }
.board-submit-btn { padding: 7px 18px; background: #c9a96e; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.board-submit-btn:hover { background: #b8935a; }
.board-cancel-btn { padding: 7px 14px; background: #e8dcc8; color: #5a3e1b; border: none; border-radius: 6px; cursor: pointer; font-size: .88rem; }
.board-thread-list { display: flex; flex-direction: column; gap: 6px; }
.board-thread-row { background: #fdf6e3; border: 1px solid #e8dcc8; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: background .15s; }
.board-thread-row:hover { background: #f5ead0; }
.board-thread-title { font-size: .95rem; font-weight: 600; color: #3a2a0a; margin-bottom: 6px; }
.board-thread-meta { display: flex; gap: 12px; font-size: .78rem; color: #888; }
.board-thread-replies { color: #c9a96e; }
.board-back-btn { padding: 6px 12px; background: #e8dcc8; color: #5a3e1b; border: none; border-radius: 6px; cursor: pointer; font-size: .85rem; }
.board-back-btn:hover { background: #d4c09a; }
.board-del-thread-btn { padding: 5px 12px; background: #f5e0e0; color: #a33; border: none; border-radius: 6px; cursor: pointer; font-size: .82rem; }
.board-thread-detail { background: #fdf6e3; border: 1px solid #e8dcc8; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.board-thread-ttl { font-size: 1.05rem; font-weight: 700; color: #3a2a0a; margin-bottom: 6px; }
.board-thread-info { font-size: .78rem; color: #888; }
.board-posts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.board-post { background: #fff; border: 1px solid #e8dcc8; border-radius: 8px; padding: 12px 14px; }
.board-post-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: #888; margin-bottom: 6px; }
.board-post-num { background: #e8dcc8; color: #5a3e1b; border-radius: 4px; padding: 1px 6px; font-weight: 700; font-size: .75rem; }
.board-post-author { color: #5a3e1b; font-weight: 600; }
.board-del-post-btn { margin-left: auto; padding: 2px 8px; background: #f5e0e0; color: #a33; border: none; border-radius: 4px; cursor: pointer; font-size: .75rem; }
.board-post-text { font-size: .9rem; color: #3a2a0a; line-height: 1.6; white-space: pre-wrap; }
.board-reply-form { background: #fdf6e3; border: 1px solid #d4b483; border-radius: 8px; padding: 14px; }
.board-reply-form h4 { font-size: .9rem; color: #5a3e1b; margin-bottom: 8px; }
.board-loading { padding: 30px; text-align: center; color: #888; }
.board-empty { padding: 20px; text-align: center; color: #888; font-size: .88rem; }
.board-error { padding: 20px; text-align: center; color: #c44; font-size: .88rem; }
.board-login-note { font-size: .82rem; color: #888; text-align: center; padding: 12px; }

/* ─── 冒険者一覧タブ ─── */
.players-wrap { padding: 12px; max-width: 800px; margin: 0 auto; }
.players-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.players-title-h { font-size: 1.05rem; font-weight: 700; color: #5a3e1b; }
.players-refresh-btn { padding: 5px 12px; background: #e8dcc8; color: #5a3e1b; border: none; border-radius: 6px; cursor: pointer; font-size: .83rem; }
.players-refresh-btn:hover { background: #d4c09a; }
.players-summary { font-size: .82rem; color: #888; margin-bottom: 10px; }
.players-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.players-tab-btn { padding: 6px 14px; background: #e8dcc8; color: #5a3e1b; border: none; border-radius: 6px; cursor: pointer; font-size: .83rem; font-weight: 600; }
.players-tab-btn.active { background: #c9a96e; color: #fff; }
.players-list { display: flex; flex-direction: column; gap: 6px; }
.players-card { background: #fdf6e3; border: 1px solid #e8dcc8; border-radius: 8px; padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background .15s; }
.players-card:hover { background: #f5ead0; }
.players-card-left { display: flex; align-items: center; gap: 8px; }
.players-online-dot  { width: 8px; height: 8px; background: #4caf50; border-radius: 50%; flex-shrink: 0; }
.players-offline-dot { width: 8px; height: 8px; background: #bbb;    border-radius: 50%; flex-shrink: 0; }
.players-name { font-size: .95rem; font-weight: 600; color: #3a2a0a; }
.players-title { font-size: .75rem; color: #888; background: #e8dcc8; border-radius: 4px; padding: 1px 6px; }
.players-card-right { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: #888; }
.players-city { color: #666; }
.players-tower { color: #c9a96e; font-weight: 600; }
.players-lastseen { color: #aaa; font-size: .75rem; }
.players-loading { padding: 30px; text-align: center; color: #888; }
.players-empty { padding: 20px; text-align: center; color: #888; font-size: .88rem; }
.players-error { padding: 20px; text-align: center; color: #c44; font-size: .88rem; }

/* ─── テストプレイ ─────────────────────────────────── */
.demo-entry { margin-top: 20px; text-align: center; }
.demo-sep { color: #888; font-size: 0.85rem; margin-bottom: 10px; position: relative; }
.demo-sep::before, .demo-sep::after { content: ""; display: inline-block; width: 40px; height: 1px; background: #ccc; vertical-align: middle; margin: 0 8px; }
.demo-btn { background: #f5f0e8; color: #5a4a2f; border: 1.5px solid #c9b890; width: 100%; font-size: 0.95rem; }
.demo-btn:hover { background: #ede8d8; }
.demo-note { font-size: 0.75rem; color: #999; margin-top: 6px; }

.demo-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: #7c6030; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 6px 16px; font-size: 0.82rem;
}
.demo-banner-text { flex: 1; text-align: center; }
.demo-banner-reg {
  background: #fff; color: #7c6030; border: none;
  padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; white-space: nowrap;
}
.demo-banner-reg:hover { background: #f5f0e8; }

body.demo-active #app { padding-top: 32px; }

/* Gather popup */
.gather-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  z-index: 4000;
  transition: opacity .18s ease, transform .18s ease;
}
.gather-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gather-toast-inner {
  min-width: 220px;
  max-width: min(90vw, 420px);
  background: rgba(22, 20, 14, 0.94);
  color: #f7ecd0;
  border: 1px solid rgba(232, 190, 96, 0.65);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  padding: 10px 14px;
}
.gather-toast-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #f3cc6e;
  margin-right: 8px;
}
.gather-toast-item {
  font-size: 13px;
  font-weight: 600;
}
.gather-toast-warn {
  font-size: 11px;
  color: #ffb87a;
  margin-top: 4px;
}

/* Board per-post reply */
.board-post {
  transition: box-shadow .18s ease, border-color .18s ease;
}
.board-post.reply-highlight {
  border-color: #c9a96e;
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.24);
}
.board-post-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.board-post-reply-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid #d7c099;
  background: #f7edd9;
  color: #7a5424;
  font-size: .67rem;
  font-weight: 700;
}
.board-reply-btn {
  padding: 2px 8px;
  background: #efe4cf;
  color: #6a4a1f;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: .75rem;
}
.board-reply-btn:hover {
  background: #e0ceb0;
}
.board-reply-target {
  margin: 0 0 8px;
  padding: 6px 8px;
  font-size: .78rem;
  border: 1px solid #d4b483;
  border-radius: 6px;
  background: #fff8e8;
  color: #5a3e1b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-reply-target button {
  padding: 2px 8px;
  font-size: .74rem;
  border: none;
  border-radius: 4px;
  background: #eadcc4;
  color: #6a4a1f;
  cursor: pointer;
}
.board-reply-target button:hover {
  background: #dcc8a4;
}
.board-reply-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  padding: 2px 8px;
  border: 1px solid #d7c099;
  border-radius: 999px;
  background: #fdf6e6;
  color: #79501f;
  cursor: pointer;
  font-size: .74rem;
}
.board-reply-ref:hover {
  background: #f3e7cd;
}
.board-post-wrap {
  display: block;
}
.board-post-children {
  margin-top: 8px;
  margin-left: 20px;
  padding-left: 10px;
  border-left: 2px solid #e1d0ad;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-post-depth-2 .board-post-children,
.board-post-depth-3 .board-post-children,
.board-post-depth-4 .board-post-children {
  margin-left: 14px;
}
.board-inline-reply {
  margin-top: 8px;
  padding: 8px;
  background: #fdf7ea;
  border: 1px solid #d4b483;
  border-radius: 8px;
}
.board-inline-reply-to {
  font-size: .78rem;
  color: #6a4a1f;
  margin-bottom: 6px;
}
.board-children-label {
  margin-top: 6px;
  font-size: .74rem;
  color: #8a6630;
}
@media (max-width: 640px) {
  .board-post-children {
    margin-left: 12px;
    padding-left: 8px;
  }
}

@media (min-width: 900px) {
  .top-wrap { max-width: 680px; }
  .guild-wrap,
  .col-wrap,
  .raid-wrap,
  .assoc-wrap,
  .log-wrap,
  .board-wrap,
  .players-wrap {
    max-width: 1100px;
  }
}

/* ── 共有依頼板（依頼板ページ）─────────────────────────────────── */
.assoc-page-tabs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.assoc-page-tab {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82em;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.assoc-page-tab.active {
  background: var(--accent, #8b6914);
  color: #fff;
  border-color: var(--accent, #8b6914);
}
.assoc-page-tab.btn:hover { opacity: 0.85; }

/* 受注中バナー */
.sq-active-banner {
  background: linear-gradient(135deg, #fdf3d0 0%, #fce8a0 100%);
  border: 2px solid #d4a017;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.sq-active-header { font-weight: bold; font-size: 0.95em; margin-bottom: 8px; }
.sq-active-progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sq-progress-bar {
  flex: 1;
  height: 10px;
  background: #e8d8a0;
  border-radius: 6px;
  overflow: hidden;
}
.sq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a017, #f0c040);
  border-radius: 6px;
  transition: width 0.3s;
}
.sq-progress-text { font-size: 0.82em; color: #7a5c00; min-width: 40px; text-align: right; }
.sq-active-meta { font-size: 0.82em; color: #6b5200; margin-bottom: 8px; }
.sq-active-actions { display: flex; gap: 8px; }

/* 依頼カード */
.sq-list { display: flex; flex-direction: column; gap: 10px; }
.sq-card {
  background: var(--bg-card, #fdf6e3);
  border: 1.5px solid var(--border, #d4b87a);
  border-radius: 10px;
  padding: 12px 14px;
}
.sq-card-active { border-color: #d4a017; background: #fffbea; }
.sq-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sq-type-icon { font-size: 1.1em; flex-shrink: 0; }
.sq-card-title { font-weight: bold; font-size: 0.95em; flex: 1; }
.sq-card-action { flex-shrink: 0; }
.sq-card-flavor { font-size: 0.82em; color: var(--text-muted, #7a6030); margin-bottom: 6px; }
.sq-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.80em;
  color: var(--text-sub, #8a7040);
}
.sq-requester { color: var(--text-sub, #8a7040); }
.sq-reward { color: #5a3e00; }
.sq-slots-ok { color: #2a6e1a; background: #e8f5e3; padding: 1px 6px; border-radius: 10px; }
.sq-slots-last { color: #b03000; background: #fde8e0; padding: 1px 6px; border-radius: 10px; font-weight: bold; }
.sq-claimers { color: #5a3e8a; background: #ede8f8; padding: 1px 6px; border-radius: 10px; }
.sq-badge-active { color: #d4a017; font-weight: bold; font-size: 0.85em; }
.sq-badge-busy { color: #888; font-size: 0.82em; }
.sq-badge-full { color: #aaa; font-size: 0.82em; }
.sq-time { color: #8a6030; background: #f5ead0; padding: 1px 6px; border-radius: 10px; }
.sq-item-reward { color: #2a5a8a; font-weight: bold; }

/* ═══ テロップ ════════════════════════════════════════════════════════════════ */
@keyframes telop-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}
.sys-telop {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  background: #7e1a00; color: #fff8e0;
  height: 28px; overflow: hidden;
  display: flex; align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.sys-telop.hidden { display: none; }
.sys-telop.telop-static {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sys-telop-text {
  white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  display: inline-block;
}
.sys-telop-text.scrolling {
  animation: telop-scroll 30s linear infinite;
  padding-left: 100vw;
}

/* ═══ メンテナンス画面 ════════════════════════════════════════════════════════ */
.sys-maintenance {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #1a1206 0%, #2e1f08 100%);
  display: flex; align-items: center; justify-content: center;
}
.sys-maintenance.hidden { display: none; }
.sys-maint-inner {
  text-align: center; padding: 40px 32px;
  max-width: 480px; width: 90%;
}
.sys-maint-icon {
  font-size: 64px; display: block; margin-bottom: 16px;
  animation: spin-slow 4s linear infinite;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.sys-maint-title {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-size: 28px; color: #c9a84c; margin-bottom: 16px; letter-spacing: 2px;
}
.sys-maint-msg {
  font-size: 16px; color: #e8d8a0; margin-bottom: 12px; line-height: 1.7;
}
.sys-maint-sub {
  font-size: 13px; color: #8a7040;
}
