* { box-sizing: border-box; }
body { margin: 0; padding-top: 0; font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: #e8eaed; background: linear-gradient(180deg, #171a20 0%, #101216 100%); min-height: 100vh; }
.floatbar { display: none !important; }
header { padding: 20px 16px 14px; background: linear-gradient(135deg, #16283d 0%, #1f4066 70%, #28517e 100%); border-bottom: 3px solid #e8a33d; color: #fff; text-align: center; }
h1 { font-size: 25px; margin: 0 0 8px; letter-spacing: .14em; font-weight: 800; background: linear-gradient(180deg, #ffedb5 0%, #f7c948 45%, #e8890c 80%, #f7c948 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
h1.titleImg { background: none; text-align: center; margin: 0 0 4px; }
h1.titleImg img { width: min(350px, 82vw); height: auto; display: inline-block; }
h1 .orn { font-size: 15px; color: #ffd977; -webkit-text-fill-color: #ffd977; vertical-align: 4px; margin: 0 10px; }
.lead { font-size: 13px; color: #b9cfe6; margin: 0; line-height: 1.6; }
.controls { padding: 4px 16px 8px; background: #1d2026; border-bottom: 1px solid #33373f; }
/* アコーディオンヘッダー：タップしやすいカード風ボタンスタイル */
.accHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: #232730;
  border: 1px solid #3d4554;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  color: #e8eaed;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.accHead:hover {
  background: #2a303c;
  border-color: #5ea0e6;
}
.accHead:active {
  background: #1f232b;
}
.accHead > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.accSummary { font-weight: 400; font-size: 13px; color: #aeb4bc; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.accSummary b { font-size: 16px; color: #fff; }
.accSummary .neg { color: #ff9a9a; }
/* 開閉トグルバッジ：文字＋アイコンで直感的に押せるボタン */
.accMark {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #5ea0e6;
  background: rgba(94, 160, 230, 0.15);
  color: #9ec7f5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.15s ease;
}
.accHead:hover .accMark {
  background: rgba(94, 160, 230, 0.3);
  color: #ffffff;
  border-color: #82b9f5;
}
.accBody { padding: 8px 2px 6px; }
.controls label { display: inline-block; font-size: 13.5px; margin: 4px 16px 4px 0; color: #c9ced6; }
.controls input[type="number"] { width: 118px; padding: 5px 6px; font-size: 17px; margin-left: 6px; background: #2b2f36; color: #fff; border: 1px solid #4a5058; border-radius: 6px; }
.totals { font-size: 15.5px; margin: 8px 0 4px; line-height: 1.7; }
.totals b { font-size: 18px; color: #fff; }
.totals .neg { color: #ff9a9a; }
.sub { color: #8f959e; font-size: 12px; }
.btnrow { margin: 6px 0; }
.btnrow button { padding: 7px 12px; margin-right: 8px; font-size: 13px; border: 1px solid #4a5058; background: #2b2f36; color: #e8eaed; border-radius: 999px; cursor: pointer; }
.btnrow #share { background: #2f6db3; border-color: #2f6db3; color: #fff; font-weight: 700; }
.msg { color: #ff9a9a; font-size: 13px; min-height: 18px; }
.treeselect { padding: 4px 12px 0; }
#treeHead { background: linear-gradient(180deg, #242c38, #1b212b); border: 1px solid #3a4554; border-radius: 10px; padding: 10px 12px; margin-top: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.th-label { font-size: 11px; font-weight: 400; color: #8a8f98; white-space: nowrap; }
.th-cur { font-size: 17px; font-weight: 800; color: #ffd98a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-change { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #5ea0e6; color: #9ec7f5; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.th-change #treeMark { font-size: 11px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0 8px; }
.tabs[hidden] { display: none; }
.tab { padding: 8px 2px; font-size: 12.5px; border: 1px solid #43484f; background: #22252b; color: #d5d9de; border-radius: 8px; cursor: pointer; text-align: center; }
.tab.on { background: linear-gradient(180deg, #3574b8, #2f6db3); border-color: #5ea0e6; color: #fff; box-shadow: 0 2px 6px rgba(47,109,179,.45); font-weight: 700; }
.tabsp { background: #e8890c; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 12px; font-weight: 700; margin-left: 2px; }
#treeinfo { padding: 2px 16px 6px; }
.treenote { font-size: 13px; color: #aeb4bc; margin: 4px 0; }
.provbanner { font-size: 13px; line-height: 1.5; color: #ffd98a; background: #3a3220; border: 1px solid #8a6d2f; border-radius: 6px; padding: 7px 10px; margin: 4px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.chip { font-size: 12px; background: #2e3238; color: #c9ced6; border-radius: 4px; padding: 3px 7px; }
.chip.locked { background: #24262b; color: #767c85; }
.hint { font-size: 12px; color: #8f959e; padding: 0 12px; margin: 2px 0 0; }
.canvas { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 4px 6px; background: #191c21; border: 1px solid #33373f; border-radius: 10px; box-shadow: inset 0 0 24px rgba(0,0,0,.35); }
.canvasIn { position: relative; margin: 0 auto; }
.helpList { font-size: 13.5px; line-height: 1.85; margin: 2px 0 8px; padding-left: 20px; color: #d5d9de; }
.canvasIn > svg { position: absolute; left: 0; top: 0; }
.edge { fill: none; stroke: #aeb6c2; stroke-width: 2.5; }
.edge.off { stroke: #828b96; stroke-dasharray: 4 4; }
.edge.on { stroke: #6db3f2; stroke-width: 3.5; }
.node { position: absolute; background: linear-gradient(180deg, #2b2f36, #23262c); border: 1.5px solid #596069; border-radius: 6px; padding: 3px; cursor: pointer; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.node.pressing { transform: scale(1.08); border-color: #f5a623; z-index: 5; }
.node .nname { font-size: 10.5px; line-height: 1.2; font-weight: 600; color: #eef1f4; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.node .nname.nl1 { font-size: 9.5px; }
.node .nname.nl2 { font-size: 8.5px; }
.node .nname.nl3 { font-size: 8px; }
.node.t1 { border-left: 5px solid #7ac74f; }
.node.t2 { border-left: 5px solid #2dd4bf; }
.node.t3 { border-left: 5px solid #5ea0e6; }
.node.t4 { border-left: 5px solid #b39df0; }
.node.t5 { border-left: 5px solid #f5a623; }
.node.alloc { background: linear-gradient(180deg, #26507e, #1d4066); border-color: #6db3f2; }
.node.alloc .nname { color: #eaf5ff; }
.node.gemon { background: linear-gradient(180deg, #452a75, #37205e); border-color: #b78ef7; }
.node.gemon .nname { color: #f4eaff; }
.node.unmet { background: #1e2025; border-color: #4c525a; }
.node.unmet .nname { color: #a7adb6; }
.node.locked { background: #202126; border-color: #3f444b; }
.node.locked .nname { color: #6d747d; }
.node .badges { position: absolute; right: 2px; bottom: 2px; display: flex; gap: 2px; }
.badge { font-size: 10.5px; font-weight: 700; line-height: 1.35; border-radius: 3px; padding: 0 3px; background: #3a3f46; color: #d5d9de; }
.badge.sp { background: #2f6db3; color: #fff; }
.badge.gem { background: #7e3ff2; color: #fff; }
.badge.lock { background: #4c525a; color: #cfd3d9; }
.badge.allp { background: none; padding: 0; line-height: 0; }
.allpic { display: inline-block; vertical-align: middle; }
.node.sel { border-color: #f5a623; box-shadow: 0 0 0 2.5px #f5a623, 0 2px 6px rgba(0,0,0,.5); }
/* スキル詳細パネル：モダンゲーミングUI */
.detail {
  position: sticky;
  bottom: 8px;
  margin: 10px 12px;
  background: linear-gradient(180deg, #1c222c 0%, #131720 100%);
  border: 1px solid #3c495c;
  border-top: 3px solid #f59e0b;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.65), 0 0 1px rgba(255,255,255,0.15) inset;
  max-height: 64dvh;
  overflow-y: auto;
  z-index: 50;
  transition: all 0.2s ease;
}
.dclose {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 1px solid #4a5568;
  background: #28303e;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.dclose:hover {
  background: #334155;
  color: #fff;
  border-color: #64748b;
}
.dempty { color: #8f959e; font-size: 13px; }
.dhead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-right: 74px; }
.dname { font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.dmeta { font-size: 12.5px; color: #94a3b8; font-weight: 500; }

/* スキル未選択時（画面下部固定バー）：残りポイントを常時目立つように表示 */
.dempty-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dempty-sp {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.dempty-sp-lbl {
  font-size: 14.5px;
  font-weight: 800;
  color: #a7f3d0;
}
.dempty-sp.neg .dempty-sp-lbl {
  color: #fca5a5;
}
.dempty-sp-val {
  font-size: 24px;
  font-weight: 900;
  color: #4ade80;
  line-height: 1;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.45);
}
.dempty-sp.neg .dempty-sp-val {
  color: #ff8585;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}
.dempty-sp-unit {
  font-size: 13.5px;
  font-weight: 800;
  color: #86efac;
}
.dempty-sp.neg .dempty-sp-unit {
  color: #fca5a5;
}
.dempty-sp-sub {
  font-size: 12.5px;
  color: #94a3b8;
  margin-left: auto;
}
.dempty-sp-sub b {
  color: #38bdf8;
}
.dempty-text {
  color: #8f959e;
  font-size: 12px;
}

.drow { font-size: 13px; margin-top: 4px; line-height: 1.55; color: #d5d9de; }
.drow.sub { color: #8f959e; font-size: 12px; }
.ddesc { font-size: 13px; line-height: 1.65; margin-top: 6px; background: #232832; color: #e6e9ec; border: 1px solid #333c4a; border-radius: 6px; padding: 7px 9px; }
.gemtoggle { display: flex; align-items: center; width: 100%; background: #232832; border: 1px solid #333c4a; border-radius: 8px; color: #e8eaed; font-size: 13px; font-weight: 600; padding: 8px 10px; margin-top: 8px; cursor: pointer; transition: background 0.15s ease; }
.gemtoggle:hover { background: #2b3240; }
.dctl { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: nowrap; }
.dlabel { font-size: 13px; font-weight: 700; flex: 0 0 88px; width: 88px; color: #f1f5f9; white-space: nowrap; }

/* クイックLv配分ボタン群（0 / - / + / 10）の立体ボタンスタイル */
.qctl { display: flex; align-items: center; gap: 6px; }
.qctl button {
  width: 48px;
  height: 42px;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid #475569;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
  transition: all 0.1s ease;
}
.qctl button:hover {
  background: linear-gradient(180deg, #3b4d66 0%, #253347 100%);
  border-color: #5ea0e6;
  color: #fff;
}
.qctl button:active {
  transform: translateY(2px);
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.qctl .qlv {
  font-size: 21px;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
}
.qctl.sp .qlv {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.qctl.gem .qlv {
  color: #c084fc;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}
.dwarn { color: #ff9a9a; font-size: 12.5px; margin-top: 5px; }
footer { padding: 12px 16px 24px; font-size: 12px; color: #8f959e; line-height: 1.7; }
footer a { color: #7db8f0; }
.wicon { width: 17px; height: 17px; vertical-align: -3.5px; margin-right: 2px; }
.wrow { display: flex; flex-wrap: wrap; align-items: flex-start; }
.wlabel { padding-top: 7px; }
.wchip { display: inline-flex; flex-direction: column; align-items: center; margin-right: 7px; }
.wchip .wicon { width: 21px; height: 21px; margin-right: 0; vertical-align: baseline; }
.wname { font-size: 9.5px; color: #a7adb6; line-height: 1.3; }
.wtext { padding-top: 7px; margin-right: 7px; }
.flabel .wicon { width: 16px; height: 16px; vertical-align: -3px; }
.subw { position: relative; display: inline-block; }
.subw i { position: absolute; right: -6px; bottom: -2px; font-size: 7px; font-style: normal; background: #6b4fa1; color: #fff; border-radius: 3px; padding: 0 2px; line-height: 1.4; letter-spacing: 0.02em; }
.fcond { font-size: 11.5px; color: #ffd977; margin-left: 3px; }
.fgroup { border-top: 1px solid #2b3a52; padding: 5px 2px 3px; }
.flabel { font-weight: 700; font-size: 12.5px; color: #ffd977; }
.frow { font-size: 13px; line-height: 1.5; word-break: break-all; }

@media (max-width: 760px) {
  .detail { position: sticky; bottom: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.55); max-height: 58dvh; overflow-y: auto; margin: 8px 6px; padding: 10px; }
  .ddesc { max-height: 92px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .dempty-sp-val { font-size: 21px; }
  .qctl { gap: 4px; }
  .qctl button { width: 40px; height: 38px; font-size: 14.5px; }
  .qctl .qlv { min-width: 44px; font-size: 18px; }
}
@media (min-width: 1100px) {
  .controls, .treeselect, #treeinfo, .hint, .detail, footer { max-width: 1440px; margin-left: auto; margin-right: auto; }
  .canvas { max-width: 1440px; margin-left: auto; margin-right: auto; }
  .node .nname { font-size: 12px; }
}

/* 言語切替（まけぱす方式：地球儀＋ドロップダウン） */
.langbar { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-bottom: 6px; font-size: 13px; color: #b9c2cf; }
.langbar select { background: #232a35; color: #e8ecf1; border: 1px solid #3a4353; border-radius: 6px; padding: 5px 8px; font-size: 13px; }

/* レジスタレット */
.rrow { padding: 7px 2px; border-bottom: 1px solid #2b303c; }
.rrow:last-child { border-bottom: none; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rname { font-weight: 700; font-size: 14px; color: #ffd98a; }
.rmax { font-size: 11.5px; color: #9fd0ff; white-space: nowrap; }
.reff { font-size: 13px; color: #dfe4ee; margin-top: 2px; line-height: 1.5; }
.rdrop { font-size: 11.5px; color: #9aa3b5; margin-top: 2px; }

/* 武器フィルタ */
#wfilter { background: #232a35; color: #e8ecf1; border: 1px solid #3a4353; border-radius: 6px; padding: 5px 8px; font-size: 14px; max-width: 60%; }
.node.wdim { opacity: .22; filter: grayscale(.8); }

/* スキル名検索 */
.searchbar { position: relative; padding: 8px 12px 0; }
#skillSearch { width: 100%; box-sizing: border-box; background: #232a35; color: #e8ecf1; border: 1px solid #3a4353; border-radius: 8px; padding: 9px 12px; font-size: 15px; }
.sresults { position: absolute; left: 12px; right: 12px; top: 100%; z-index: 40; background: #1d222b; border: 1px solid #3a4353; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-height: 46dvh; overflow-y: auto; }
.sitem { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #2b303c; color: #e8ecf1; padding: 10px 12px; font-size: 14.5px; cursor: pointer; }
.sitem:last-child { border-bottom: none; }
.sitem .stree { font-size: 11.5px; color: #9aa3b5; white-space: nowrap; }
.snone { padding: 10px 12px; color: #9aa3b5; font-size: 13.5px; }

/* PC向けリッチ表示（ノード情報・盤面背景・ロゴ拡大）。スマホ表示は従来どおり */
.nmeta { display: none; }
.nweap { position: absolute; left: 5px; bottom: 4px; display: flex; flex-wrap: nowrap; gap: 2px; align-items: center; max-width: 60%; overflow: hidden; }
.nweap svg { width: 12px; height: 12px; flex: none; }
.wmore { display: none; font-size: 9px; font-weight: 700; color: #9aa3b5; }
@media (max-width: 1099px) {
  .nweap .wmore { display: inline; }
  .nweap.many svg:nth-of-type(n+3) { display: none; }
}
@media (min-width: 1100px) {
  h1.titleImg img { width: min(470px, 60vw); }
  .canvas { background-image: radial-gradient(1100px 480px at 50% -60px, rgba(84,140,220,.16), rgba(84,140,220,0) 60%), radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.4px); background-size: auto, 22px 22px; }
  .node { display: flex; flex-direction: column; }
  .nmeta { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
  .ntier { font-size: 10px; font-weight: 700; color: #141a24; background: #ffd977; border-radius: 3px; padding: 0 5px; line-height: 1.55; }
  .nmp { font-size: 11px; color: #9fd0ff; font-weight: 600; }
  .nweap { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; padding-bottom: 15px; }
  .nweap svg { width: 17px; height: 17px; }
}

/* PC：文字サイズ拡大（1100px以上のみ。スマホは変更なし） */
@media (min-width: 1100px) {
  .floatbar { font-size: 15px; padding: 10px 18px; }
  .floatbar b { font-size: 21px; }
  .lead { font-size: 14.5px; }
  .accHead { font-size: 17px; }
  .accSummary { font-size: 15px; }
  .accSummary b { font-size: 19px; }
  .tab { font-size: 14px; padding: 10px 2px; }
  .hint { font-size: 13.5px; }
  #skillSearch { font-size: 16px; }
  .sitem { font-size: 15.5px; }
  .node { padding: 5px 6px; }
  .node .nname { font-size: 14.5px; }
  .node .nname.nl1 { font-size: 12.5px; }
  .node .nname.nl2 { font-size: 11px; }
  .node .nname.nl3 { font-size: 10px; }
  .nmeta { flex-wrap: nowrap; overflow: hidden; }
  .ntier { font-size: 11.5px; white-space: nowrap; flex: none; }
  .nmp { white-space: nowrap; }
  .nmp { font-size: 13px; }
  .badge { font-size: 12px; }
  .nweap { position: absolute; left: 6px; bottom: 5px; margin-top: 0; padding-bottom: 0; max-width: none; overflow: visible; }
  .nweap svg { width: 19px; height: 19px; }
  .dname { font-size: 19px; }
  .drow { font-size: 14.5px; }
  .drow.sub { font-size: 13px; }
  .langbar { font-size: 14px; }
  .controls label, .controls input, .controls select, .controls button { font-size: 15px; }
  footer { font-size: 13px; }
}

/* 勲章ポイント入力 */
.embBox { margin: 10px 0 2px; border-top: 1px solid #2b303c; padding-top: 8px; }
.embHead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.embHead b { color: #fff; }
.embGrid { display: grid; grid-template-columns: 1fr; gap: 6px 14px; }
@media (min-width: 700px) { .embGrid { grid-template-columns: 1fr 1fr; } }
.embRow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #c9d1dd; }
.embRow select { background: #232a35; color: #e8ecf1; border: 1px solid #3a4353; border-radius: 6px; padding: 4px 6px; font-size: 13px; max-width: 48%; }
.embNote { margin-top: 6px; }

/* 勲章チェックボックス（折りたたみ） */
/* 勲章チェックボックス（折りたたみカードボタン） */
.embToggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #232730;
  border: 1px solid #3d4554;
  border-radius: 8px;
  color: #e8ecf1;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  box-sizing: border-box;
  margin: 4px 0 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.embToggle:hover {
  background: #2a303c;
  border-color: #5ea0e6;
}
.embToggle:active {
  background: #1f232b;
}
.embToggle b { color: #fff; }
.setbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.setbadge .setmark { font-size: 16px; line-height: 1; }
.setbadge.def { color: #9aa3ad; border: 1px solid #4a5560; background: rgba(255,255,255,.04); }
.setbadge .setbox { color: #ff5a5a; }
.setbadge.chg { color: #7bc67a; border: 1px solid #3f6b3a; background: rgba(87,181,46,.10); }
.embCat { font-size: 12.5px; font-weight: 700; color: #9fb4d8; margin: 10px 0 4px; }
.embSeries { font-size: 12.5px; font-weight: 700; color: #9fb4d8; margin: 8px 0 2px; }
.embList { display: grid; grid-template-columns: 1fr; gap: 2px 14px; }
@media (min-width: 700px) { .embList { grid-template-columns: 1fr 1fr; } }
.embItem { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #c9d1dd; padding: 3px 0; cursor: pointer; }
.embItem input { width: 17px; height: 17px; accent-color: #f7c948; flex: none; margin: 0; }
.embItem .cond { color: #8b94a5; font-size: 11.5px; }

/* らんなびアカウント認証ステータスバー */
.auth-bar-panel {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px auto 4px;
  max-width: 650px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  text-align: left;
}
.auth-bar-panel.auth-logged-in {
  border-left: 4px solid #22c55e;
  background: rgba(20, 83, 45, 0.25);
}
.auth-bar-panel.auth-guest {
  border-left: 4px solid #38bdf8;
  background: rgba(15, 23, 42, 0.5);
}
.auth-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.user-name-text {
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
}
.auth-note {
  color: #94a3b8;
  font-size: 11.5px;
}
.auth-login-link {
  color: #f7c948;
  text-decoration: underline;
  font-weight: 600;
  margin-left: 4px;
}

/* マイビルド保存・管理UI */
.builds-always-controls {
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid #2e3440;
}
.current-build-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 116, 144, 0.25);
  border: 1px solid #0891b2;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.current-build-banner.local {
  background: rgba(40, 48, 60, 0.5);
  border: 1px solid #4a5568;
}
.current-build-banner.local .banner-label {
  color: #7dd3fc;
  font-weight: 600;
}
.build-save-guide {
  font-size: 12.5px;
  color: #c0c8d4;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.guide-badge {
  background: #3b82f6;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.banner-label {
  color: #38bdf8;
  font-weight: 700;
}
.banner-name {
  color: #fef08a;
  flex: 1;
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-clear-loaded {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  cursor: pointer;
}
.btn-clear-loaded:hover {
  background: #475569;
  color: #fff;
}
.builds-controls {
  margin-top: 8px;
}
.build-save-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.build-save-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  background: #2b2f36;
  border: 1px solid #4a5058;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}
.build-save-form input[type="text"]:focus {
  outline: none;
  border-color: #5ea0e6;
  box-shadow: 0 0 5px rgba(94, 160, 230, 0.4);
}
.btn-primary {
  padding: 8px 16px;
  background: linear-gradient(180deg, #3574b8, #2f6db3);
  border: 1px solid #5ea0e6;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #255a96;
}
.builds-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #333a44;
}
.builds-count-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffd98a;
}
.builds-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 2px;
}
.build-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #23272f;
  border: 1px solid #3a414d;
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.15s ease;
}
.build-item:hover {
  border-color: #5ea0e6;
}
.build-item-info {
  flex: 1;
  min-width: 0;
}
.build-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #e8eaed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.build-item-meta {
  font-size: 11.5px;
  color: #8f959e;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.build-item-meta .sp {
  color: #38bdf8;
  font-weight: 600;
}
.build-item-meta .gem {
  color: #f7c948;
}
.build-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-build-load {
  background: #2f6db3;
  color: #fff;
  border: 1px solid #5ea0e6;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn-build-load:hover {
  background: #255a96;
}
.btn-build-del {
  background: #472023;
  color: #fca5a5;
  border: 1px solid #7f1d1d;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.btn-build-del:hover {
  background: #991b1b;
  color: #fff;
}
.builds-empty {
  text-align: center;
  padding: 20px 10px;
  color: #8f959e;
  font-size: 13px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}
.auth-guest-notice {
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed #475569;
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
}

@media (max-width: 480px) {
  /* スマホ・320px幅対応：カードヘッダーとトグルボタンの最適化 */
  .accHead {
    padding: 7px 10px;
    font-size: 13.5px;
    gap: 6px;
  }
  .accMark {
    padding: 3px 8px;
    font-size: 11px;
  }
  .accSummary {
    font-size: 12px;
  }
  .accSummary b {
    font-size: 14.5px;
  }
  .embToggle {
    padding: 7px 10px;
    font-size: 13px;
  }
  .build-save-guide {
    font-size: 11.5px;
  }
  .dempty-sp {
    gap: 4px;
  }
  .dempty-sp-lbl {
    font-size: 13.5px;
  }
  .dempty-sp-val {
    font-size: 20px;
  }
  .dempty-sp-sub {
    width: 100%;
    margin-left: 0;
    font-size: 11.5px;
  }
  .dctl {
    flex-wrap: wrap;
    gap: 4px;
  }
  .dlabel {
    width: 100%;
    flex: 1 1 100%;
    margin-bottom: 2px;
  }
  .build-save-form {
    flex-direction: column;
    align-items: stretch;
  }
  .build-save-form input[type="text"],
  .btn-primary {
    width: 100%;
    min-width: 0;
  }
  .build-item {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .build-item-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   PCレイアウト最適化（992px以上：スカスカ感を解消し情報密度と操作性を向上）
   ※スマホ（320px〜）は上記の通り従来通りの縦並びを完全維持
   ========================================================================== */
@media (min-width: 992px) {
  /* 全体コンテンツ幅の引き締め */
  .controls-wrapper,
  .treeselect,
  .searchbar,
  #treeinfo,
  .hint,
  .canvas,
  .detail,
  footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  /* コントロール群のラッパー */
  .controls-wrapper {
    padding: 12px 16px 6px;
  }

  /* 使い方セクション */
  .controls-help {
    background: #181b21;
    border: 1px solid #2d333e;
    border-radius: 8px;
    padding: 6px 14px;
    margin-bottom: 12px;
  }

  /* 基本設定とマイビルド管理を横並び2カラムのカードグリッドに */
  .controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  .controls-settings,
  .controls-builds {
    background: #1c2027;
    border: 1px solid #323844;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  /* ツリー選択タブ：PCでは巨大な3分割ではなく、押しやすい適正サイズのグリッドに最適化 */
  .tabs {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 8px 0;
  }
  .tab {
    padding: 10px 4px;
    font-size: 13.5px;
  }

  /* マイビルド管理内のフォームと一覧 */
  .build-save-form {
    display: flex;
    gap: 8px;
  }
  .build-save-form input[type="text"] {
    flex: 1;
  }
  .builds-list {
    max-height: 420px;
  }
}


/* 大画面PC（1700px以上）：全体をさらに大きく */
@media (min-width: 1700px) {
  .controls, .treeselect, #treeinfo, .hint, .detail, footer { max-width: 1760px; }
  .canvas { max-width: 1760px; }
  .node .nname { font-size: 16.5px; }
  .node .nname.nl1 { font-size: 14px; }
  .node .nname.nl2 { font-size: 12.5px; }
  .node .nname.nl3 { font-size: 11px; }
  .ntier { font-size: 13px; }
  .nmp { font-size: 14.5px; }
  .badge { font-size: 13.5px; }
  .nweap svg { width: 22px; height: 22px; }
  .floatbar { font-size: 16.5px; }
  .floatbar b { font-size: 23px; }
}

/* ==========================================================================
   マイビルド保存方法選択モーダル（上書き／新規保存）
   ========================================================================== */
.build-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.18s ease-out;
}
.build-modal-overlay[hidden] {
  display: none;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.build-modal-card {
  background: #1e222a;
  border: 1px solid #4a5568;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.build-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: #161920;
  border-bottom: 1px solid #2d3748;
}
.build-modal-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: #f7c948;
}
.build-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.build-modal-close:hover {
  color: #fff;
}
.build-modal-body {
  padding: 16px;
}
.build-modal-desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #e2e8f0;
}
.build-modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-modal-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}
.btn-modal-action .btn-action-title {
  font-size: 14.5px;
  font-weight: 700;
}
.btn-modal-action .btn-action-sub {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.4;
  word-break: break-all;
}
.btn-overwrite {
  background: rgba(2, 132, 199, 0.18);
  border: 1px solid #0284c7;
  color: #e0f2fe;
}
.btn-overwrite:hover, .btn-overwrite:focus-visible {
  background: rgba(2, 132, 199, 0.35);
  border-color: #38bdf8;
}
.btn-newsave {
  background: rgba(22, 101, 52, 0.25);
  border: 1px solid #16a34a;
  color: #dcfce7;
}
.btn-newsave:hover, .btn-newsave:focus-visible {
  background: rgba(22, 101, 52, 0.42);
  border-color: #4ade80;
}
.build-modal-footer {
  padding: 10px 16px 14px;
  display: flex;
  justify-content: center;
  background: #161920;
  border-top: 1px solid #2d3748;
}
.btn-modal-cancel {
  background: #2d3748;
  color: #cbd5e1;
  border: 1px solid #4a5568;
  border-radius: 6px;
  padding: 8px 24px;
  font-size: 13px;
  cursor: pointer;
}
.btn-modal-cancel:hover {
  background: #4a5568;
  color: #fff;
}

/* ========================================
   ステータスバー（歯車ボタン + Lv・残りpt表示）
   ======================================== */
.settings-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.settings-bar-summary {
  flex: 1;
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 600;
  min-width: 0;
}
.settings-bar .msg {
  flex: 1 1 100%;
  font-size: 12px;
  color: #fbbf24;
  min-height: 0;
}
.settings-bar .msg:empty { display: none; }

/* 歯車ボタン */
.gear-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 20px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.3s;
  line-height: 1;
}
.gear-btn:hover, .gear-btn:focus-visible {
  background: rgba(255,255,255,0.15);
  outline: none;
}
.gear-btn--open {
  transform: rotate(60deg);
  background: rgba(99,179,237,0.2);
  border-color: #63b3ed;
}

/* 歯車パネル */
.gear-panel {
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: gearSlideIn 0.18s ease;
}
@keyframes gearSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gear-panel-inner > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.gear-panel-inner > label > span:first-child {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.gear-panel-inner > label input[type="number"] {
  width: 100%;
  max-width: 160px;
}

/* ========================================
   チュートリアルモーダル
   ======================================== */
/* hidden属性を尊重しつつ表示時はflex */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.tutorial-overlay.is-open {
  display: flex;
}
.tutorial-card {
  background: linear-gradient(145deg, #1a1f2e, #0f1319);
  border: 1px solid rgba(99,179,237,0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(99,179,237,0.1);
}
.tut-header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tut-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: rgba(99,179,237,0.2);
  color: #63b3ed;
  border: 1px solid rgba(99,179,237,0.4);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.tut-title {
  font-size: 17px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
}
.tut-body {
  padding: 14px 20px;
}
.tut-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.tut-label-text {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}
.tut-hint {
  font-size: 11px;
  color: #94a3b8;
}
.tut-input {
  width: 100%;
  max-width: 180px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid rgba(99,179,237,0.5);
  background: rgba(255,255,255,0.07);
  color: #e2e8f0;
  box-sizing: border-box;
  margin-top: 4px;
}
.tut-input:focus {
  outline: none;
  border-color: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99,179,237,0.2);
}
.tut-emb-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.tut-emblem-box {
  /* 勲章エリアは折りたたみなしで展開表示 */
}
.tut-howto-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tut-howto-list li {
  font-size: 13px;
  color: #cbd5e1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.5;
}
.tut-howto-list li strong {
  color: #93c5fd;
}
.tut-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  gap: 10px;
}
.tut-skip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #94a3b8;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.tut-skip:hover {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.tut-next {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
}

/* ========================================
   マイビルド保存エリア（刷新後）
   ======================================== */
.build-save-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.build-save-form input[type="text"] {
  flex: 1;
  min-width: 140px;
}
.build-save-form .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

/* モバイル320px対応 */
@media (max-width: 360px) {
  .tut-title { font-size: 15px; }
  .tut-input { font-size: 18px; }
  .tut-footer { flex-direction: column; }
  .tut-next { width: 100%; }
  .tut-skip { width: 100%; text-align: center; }
  .gear-btn { width: 34px; height: 34px; font-size: 18px; }
}
