:root {
  --boss-hue: 0;

  /* スキンが上書きする土台(js/skins.js の SKIN_PROPS と対応) */
  --bg0: #070912;
  --bg1: #0f1330;
  --ink: #eef1ff;
  --muted: #8b93b8;
  --surface: rgba(255,255,255,.05);
  --surface-2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.13);
  --tint-alpha: 0.13;
  --panel-bg: rgba(14,16,26,.94);
  --panel-ink: #eef1ff;
  --pop-me: #ffffff;

  /* スキンが --skin-accent を指定すればそれ、無ければボスの色に追従 */
  --accent: var(--skin-accent, hsl(var(--boss-hue) 90% 62%));
  --accent-dim: var(--skin-accent-dim, hsl(var(--boss-hue) 70% 44%));
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg0); }
html, body {
  height: 100%;
  color: var(--ink);
  font-family: var(--skin-font, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif);
  overflow: hidden;
  user-select: none;
}
body {
  background:
    radial-gradient(1200px 700px at 50% -12%, hsl(var(--boss-hue) 85% 55% / var(--tint-alpha)), transparent 62%),
    linear-gradient(162deg, var(--bg0), var(--bg1));
  transition: background .6s ease, color .4s ease;
}
#fxCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

#app {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  max-width: 620px; margin: 0 auto; padding: 10px 14px env(safe-area-inset-bottom);
}

#topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 8px; }
.logo { font-size: 20px; letter-spacing: .04em; text-shadow: 0 0 16px var(--accent); white-space: nowrap; }
.topbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ghost {
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: border-color .15s;
}
.ghost:hover { border-color: var(--accent); }

#presenceRow {
  text-align: center; font-size: 12.5px; color: var(--muted);
  padding: 6px 0 4px;
}
#presenceRow b { color: var(--ink); }
.pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #35e07f; margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(53,224,127,.7); animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(53,224,127,0); } 100% { box-shadow: 0 0 0 0 rgba(53,224,127,0); } }

.setup {
  display: none; margin: 8px 0; padding: 10px 12px; font-size: 12px; line-height: 1.7;
  background: rgba(255,196,0,.14); border: 1px solid rgba(255,196,0,.4); border-radius: 12px; color: #a9760a;
}
.setup.show { display: block; }
.setup code { background: rgba(0,0,0,.18); padding: 1px 5px; border-radius: 5px; }

#stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
#shakeWrap { width: 100%; text-align: center; will-change: transform; }

.boss-no { font-size: 12px; letter-spacing: .25em; color: var(--accent); font-weight: 700; }
.boss-name {
  font-size: clamp(18px, 5vw, 26px); font-weight: 800; margin: 2px 0 6px;
  text-shadow: 0 0 20px hsl(var(--boss-hue) 90% 55% / .55);
}

#clickArea {
  position: relative; cursor: pointer;
  height: min(42vh, 300px);
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.boss-emoji {
  font-size: min(38vw, 220px); line-height: 1;
  filter: drop-shadow(0 12px 30px hsl(var(--boss-hue) 90% 45% / .5));
  transition: transform .09s ease;
  will-change: transform;
}
.boss-shadow {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  width: 46%; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.5), transparent 70%);
  filter: blur(2px);
}

#hpWrap { margin-top: 12px; }
.hp-readout {
  font-size: clamp(28px, 8.5vw, 46px); font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  color: var(--ink);
  text-shadow: 0 0 20px hsl(var(--boss-hue) 90% 55% / .35);
}
#hpApprox {
  font-size: 13px; color: var(--muted); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
#hpBar {
  position: relative; height: 30px; border-radius: 999px; overflow: hidden;
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35);
}
#hpFill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 16px var(--accent);
  transition: width .12s linear;
}
#hpPct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 3px rgba(0,0,0,.8);
  letter-spacing: .02em;
}
#hpWrap.crit .hp-readout { color: #ff5a5a; animation: critpulse 1s ease-in-out infinite; }
#hpWrap.crit #hpApprox { color: #ff8a8a; }
@keyframes critpulse { 50% { opacity: .55; } }
.hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); }

#contrib { display: flex; gap: 10px; padding: 10px 0 8px; }
.more-games {
  display: block; margin: 0 0 12px; padding: 9px 12px;
  text-align: center; text-decoration: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s;
}
.more-games:hover { border-color: var(--accent); }
.card {
  flex: 1; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; text-align: center;
}
.card-label { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.card-value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.card-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.card-sub span { color: var(--accent); font-weight: 700; }

/* ダメージポップ */
#popLayer { position: fixed; inset: 0; pointer-events: none; z-index: 45; }
.dmg {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 900; font-variant-numeric: tabular-nums;
  animation: rise .9s ease-out forwards;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.dmg-me { color: var(--pop-me); font-size: 22px; }
.dmg-others { color: hsl(var(--boss-hue) 90% 72%); font-size: 15px; opacity: .82; }
.dmg-weak { color: #ffe14d; font-size: 26px; text-shadow: 0 0 10px #ff8a00, 0 2px 8px rgba(0,0,0,.5); }
@keyframes rise {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
  15% { opacity: 1; transform: translate(-50%,-70%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%,-160%) scale(1); }
}
/* ダメージ数字スタイル(設定) */
.dmgst-simple { font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.dmgst-mini { font-size: 14px !important; font-weight: 700; opacity: .85; }
.dmgst-gothic { font-family: Georgia, "Times New Roman", serif; font-style: italic; letter-spacing: .02em; }

/* バナー & オーバーレイ */
#banner {
  position: fixed; left: 50%; top: 16%; transform: translate(-50%, -20px);
  z-index: 50; width: min(92vw, 440px);
  background: var(--panel-bg); color: var(--panel-ink); backdrop-filter: blur(8px);
  border: 1px solid var(--accent); border-radius: 18px;
  box-shadow: 0 0 40px hsl(var(--boss-hue) 90% 50% / .4);
  padding: 18px 20px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
#banner.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.banner-title { font-size: 19px; font-weight: 900; text-shadow: 0 0 18px var(--accent); }
.banner-title small { font-size: 12px; color: var(--muted); }
.banner-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.info-sub { text-align: left; }
.ver { list-style: none; margin-top: 10px; max-height: 34vh; overflow-y: auto; }
.ver li { font-size: 11.5px; padding: 6px 0; border-top: 1px solid var(--border); }
.ver li span { color: var(--accent); }

/* モーダルパネル(共通) */
#skinPanel, #keybindPanel, #settingsPanel, #recordsPanel {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  padding: 16px;
}
#skinPanel.show, #keybindPanel.show, #settingsPanel.show, #recordsPanel.show { display: flex; }
.panel {
  width: min(96vw, 460px); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--panel-bg); color: var(--panel-ink);
  border: 1px solid var(--border); border-radius: 18px; padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head span { font-weight: 800; font-size: 15px; }
#skinGrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px; overflow-y: auto; padding: 2px;
}
.skin-swatch {
  cursor: pointer; border: 2px solid transparent; border-radius: 12px;
  padding: 4px; background: none; color: inherit; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.skin-swatch .chip {
  width: 100%; aspect-ratio: 16/10; border-radius: 9px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  position: relative; overflow: hidden;
}
.skin-swatch .chip::after {
  content: ''; position: absolute; right: 6px; bottom: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--sw-acc); box-shadow: 0 0 8px var(--sw-acc);
}
.skin-swatch .nm { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.25; }
.skin-swatch.sel { border-color: var(--accent); }
.skin-swatch.sel .nm { color: var(--ink); font-weight: 700; }

/* キー設定パネル */
#keybindList { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.kb-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.kb-label { font-size: 12.5px; font-weight: 700; }
.kb-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kb-keys kbd {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 7px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--panel-ink);
}
.kb-keys kbd:hover { border-color: #ff7043; }
.kb-x { opacity: .6; font-size: 10px; }
.kb-none { color: var(--muted); font-size: 11px; font-style: normal; }
.kb-add {
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  padding: 4px 10px; border-radius: 7px;
  background: none; color: var(--accent);
  border: 1px dashed var(--border);
}
.kb-add:hover { border-color: var(--accent); }
.kb-capturing { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.kb-capturing small { color: var(--muted); font-weight: 400; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.kb-tip { font-size: 9.5px; color: var(--muted); text-align: right; }

/* ペットウィジェット */
#petWidget {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 55; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px;
}
#petToggle {
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 26px; line-height: 1; cursor: pointer;
  background: var(--panel-bg); color: var(--panel-ink);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  animation: petbob 2.4s ease-in-out infinite;
}
@keyframes petbob { 50% { transform: translateY(-5px); } }
#petPanel {
  width: 214px; padding: 12px;
  background: var(--panel-bg); color: var(--panel-ink);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
#petWidget.collapsed #petPanel { display: none; }

.pet-adopt-h { font-size: 12.5px; font-weight: 700; text-align: center; margin-bottom: 8px; }
#petEggs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pet-egg {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: inherit; font: inherit;
}
.pet-egg span { font-size: 22px; }
.pet-egg small { font-size: 10px; color: var(--muted); }
.pet-egg:hover { border-color: var(--accent); }

.pet-badge { font-size: 10.5px; color: var(--muted); text-align: center; }
.pet-avatar-wrap { position: relative; width: 64px; margin: 4px auto 2px; }
#petAvatar {
  font-size: 56px; line-height: 1; text-align: center; cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.35));
}
.pet-acc {
  position: absolute; top: -6px; right: -2px; font-size: 22px;
  pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}
.pet-acc-row { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.pet-acc-btn {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  font-size: 13px; line-height: 1;
  background: var(--surface-2); color: inherit; border: 1px solid var(--border);
}
.pet-acc-btn.on { border-color: var(--accent); background: var(--surface); }
.pet-acc-btn.lock { opacity: .35; cursor: not-allowed; }
.pet-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; }
.pet-foot #petDex { font-size: 9px; color: var(--muted); }
#petAvatar.sad { filter: grayscale(.6) drop-shadow(0 6px 12px rgba(0,0,0,.35)); }
#petAvatar.hop { animation: pethop .5s ease; }
#petAvatar.wiggle { animation: petwig .4s ease; }
@keyframes pethop { 30% { transform: translateY(-16px) scale(1.08); } 60% { transform: translateY(0) scale(.96); } }
@keyframes petwig { 25% { transform: rotate(-11deg); } 75% { transform: rotate(11deg); } }

#petSpeech {
  min-height: 16px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--accent); opacity: 0; transition: opacity .2s;
}
#petSpeech.show { opacity: 1; }

.pet-name {
  display: block; margin: 2px auto 8px; padding: 3px 12px;
  font-size: 12px; font-weight: 800; cursor: pointer;
  background: var(--surface-2); color: inherit;
  border: 1px solid var(--border); border-radius: 999px;
}

.pet-stat { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pet-stat label { font-size: 9.5px; color: var(--muted); width: 42px; flex: none; }
.pet-bar {
  flex: 1; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.pet-bar > div { height: 100%; background: var(--accent); transition: width .3s; }
#petAffFill { background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
#petHunFill { background: #4bd07a; }
#petHunFill.warn { background: #ff7043; }

.pet-actions { display: flex; gap: 6px; margin-top: 10px; }
.pet-actions button {
  flex: 1; padding: 7px 4px; font-size: 11.5px; font-weight: 700; cursor: pointer;
  background: var(--surface-2); color: inherit;
  border: 1px solid var(--border); border-radius: 9px;
}
.pet-actions button:hover:not(:disabled) { border-color: var(--accent); }
.pet-actions button:disabled { opacity: .5; cursor: default; }
.pet-note { font-size: 8.5px; color: var(--muted); text-align: right; }

/* ===== ボスのダメージ表現 (#1) ===== */
#clickArea { overflow: visible; }
.boss-emoji {
  filter:
    drop-shadow(0 12px 30px hsl(var(--boss-hue) 90% 45% / .5))
    saturate(calc(1 - var(--hurt, 0) * .55))
    brightness(calc(1 - var(--hurt, 0) * .28));
}
.boss-emoji[data-hurt="2"] { transform: rotate(-2deg); }
.boss-emoji[data-hurt="3"] { transform: rotate(2deg); }
.boss-emoji.boss-dying { animation: bossTremble .12s linear infinite; }
@keyframes bossTremble {
  0% { transform: translate(-1px,1px) rotate(-1deg); }
  50% { transform: translate(2px,-1px) rotate(1.5deg); }
  100% { transform: translate(-1px,0) rotate(-1deg); }
}
.defeat-flash {
  position: absolute; inset: -20% -30%; z-index: 5; border-radius: 50%;
  background: radial-gradient(circle, #fff, transparent 60%);
  animation: dflash .5s ease-out forwards; pointer-events: none;
}
@keyframes dflash { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.4); } }
.boss-fly {
  position: absolute; left: 50%; top: 45%; font-size: min(30vw, 170px);
  z-index: 6; pointer-events: none;
  animation: bfly 1s cubic-bezier(.4,0,.9,.4) forwards;
}
@keyframes bfly {
  0% { transform: translate(-50%,-50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(120%,-320%) scale(.3) rotate(540deg); opacity: 0; }
}

/* ===== 弱点 (#5) ===== */
.weak-marker {
  position: absolute; width: 22%; aspect-ratio: 1; z-index: 4;
  transform: translate(-50%,-50%); pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle, rgba(255,80,80,.55), rgba(255,220,0,.25) 55%, transparent 72%);
  box-shadow: 0 0 24px rgba(255,90,90,.7);
}
.weak-marker.show { opacity: 1; animation: weakPulse .8s ease-in-out infinite; }
@keyframes weakPulse { 50% { transform: translate(-50%,-50%) scale(1.18); } }
.weak-kbd {
  position: absolute; left: 50%; top: -18px; transform: translateX(-50%);
  white-space: nowrap; font-size: 9px; font-weight: 800; color: #ffe14d;
  text-shadow: 0 1px 3px rgba(0,0,0,.9); display: none;
}
@media (hover: hover) and (pointer: fine) {
  .weak-marker.show .weak-kbd { display: block; }
}
.weak-burst {
  position: absolute; width: 26%; aspect-ratio: 1; z-index: 6;
  transform: translate(-50%,-50%); pointer-events: none;
  border: 3px solid #ffe14d; border-radius: 50%;
  animation: weakBurst .4s ease-out forwards;
}
@keyframes weakBurst { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.6); } }

/* ===== ボスのセリフ (#28) ===== */
.boss-speech {
  position: absolute; left: 50%; top: -6%; transform: translateX(-50%);
  z-index: 7; max-width: 80%; white-space: nowrap;
  background: var(--panel-bg); color: var(--panel-ink);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 5px 12px; font-size: 12px; font-weight: 700;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.boss-speech.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ===== 登場アニメ (#3) ===== */
#bossIntro {
  position: fixed; inset: 0; z-index: 58; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center;
}
#bossIntro.play { display: flex; animation: introFade 1.4s ease forwards; }
@keyframes introFade { 0%,70% { background: rgba(0,0,0,.35); } 100% { background: rgba(0,0,0,0); } }
#bossIntro .bi-no { font-size: 14px; letter-spacing: .3em; color: var(--accent); font-weight: 800; }
#bossIntro .bi-emoji { font-size: min(40vw, 220px); animation: introZoom 1.4s cubic-bezier(.2,1,.3,1) forwards; }
#bossIntro .bi-name { font-size: clamp(20px, 6vw, 34px); font-weight: 900; text-shadow: 0 0 24px var(--accent); animation: introSlide 1.4s ease forwards; }
@keyframes introZoom { 0% { transform: scale(3.4); opacity: 0; } 25% { opacity: 1; } 80% { transform: scale(1); } 100% { transform: scale(1); opacity: 0; } }
@keyframes introSlide { 0%,20% { transform: translateY(20px); opacity: 0; } 45% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ===== 攻撃エフェクト / 他プレイヤーのタップ ===== */
#hitfxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 44; }
.hitfx { position: absolute; transform: translate(-50%,-50%); pointer-events: none; }
.fx-slash .fx-slash-line {
  display: block; width: 120px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  transform: rotate(var(--r, 0deg));
  animation: fxSlash .34s ease-out forwards;
}
@keyframes fxSlash { 0% { opacity: 0; transform: rotate(var(--r)) scaleX(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--r)) scaleX(1.2); } }
.fx-fire { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle, #ffe08a, #ff5a1e 60%, transparent); animation: fxFire .5s ease-out forwards; }
@keyframes fxFire { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%,-180%) scale(1.4); } }
.fx-punch { font-size: 34px; animation: fxPunch .42s ease-out forwards; }
@keyframes fxPunch { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(-20deg); } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.2) rotate(0); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
.fx-laser .fx-laser-line {
  display: block; width: 4px; height: 200vh; margin-top: -100vh;
  background: linear-gradient(#fff, #6cf); box-shadow: 0 0 12px #6cf;
  animation: fxLaser .3s ease-out forwards;
}
@keyframes fxLaser { 0% { opacity: 0; transform: scaleY(0); } 20% { opacity: 1; } 100% { opacity: 0; } }
.fx-cat { font-size: 24px; animation: fxCat .5s ease-out forwards; }
@keyframes fxCat { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-90%) scale(1); } }
.remote-tap {
  position: absolute; width: 26px; height: 26px; transform: translate(-50%,-50%);
  border: 2px solid hsl(var(--boss-hue) 90% 70%); border-radius: 50%;
  animation: rtap .5s ease-out forwards; pointer-events: none;
}
@keyframes rtap { 0% { opacity: .9; transform: translate(-50%,-50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }

/* ===== 実績トースト ===== */
.ach-toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 20px); opacity: 0;
  z-index: 70; width: min(88vw, 340px);
  background: var(--panel-bg); color: var(--panel-ink);
  border: 1px solid var(--accent); border-radius: 14px;
  padding: 12px 16px; font-size: 12.5px; line-height: 1.6; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  transition: opacity .35s, transform .35s;
}
.ach-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ach-toast span { color: var(--muted); }

/* ===== 設定パネル ===== */
.set-body { display: flex; flex-direction: column; gap: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 700; }
.set-row select {
  font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px;
  background: var(--surface-2); color: var(--panel-ink); border: 1px solid var(--border);
}
.set-check { align-items: flex-start; }
.set-check span { display: flex; flex-direction: column; }
.set-check small { font-weight: 400; color: var(--muted); font-size: 10px; }
.set-check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.set-nick { border-top: 1px solid var(--border); padding-top: 12px; }
.set-nick-h { font-size: 12.5px; font-weight: 700; margin-bottom: 7px; }
.set-nick-h small { font-weight: 400; color: var(--muted); }
.set-nick-row { display: flex; gap: 6px; }
.set-nick-row input {
  flex: 1; font: inherit; font-size: 12px; padding: 6px 9px; border-radius: 8px;
  background: var(--surface-2); color: var(--panel-ink); border: 1px solid var(--border);
}

/* ===== きろくパネル ===== */
.rec-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.rec-tabs button {
  flex: 1; font: inherit; font-size: 11.5px; font-weight: 700; padding: 7px 2px; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 9px;
}
.rec-tabs button.on { color: var(--panel-ink); border-color: var(--accent); }
.rec-body { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rec-count { font-size: 12px; font-weight: 800; color: var(--accent); text-align: right; }
.rec-ach, .rec-title, .rec-codex, .rec-stat {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font-size: 12px;
}
.rec-ach { opacity: .5; }
.rec-ach.got { opacity: 1; }
.rec-ach .ra-i { font-size: 16px; flex: none; }
.rec-ach .ra-t { display: flex; flex-direction: column; }
.rec-ach .ra-t small { color: var(--muted); font-size: 10px; }
.rec-title { flex-direction: column; align-items: flex-start; gap: 2px; opacity: .45; }
.rec-title.got { opacity: 1; }
.rec-title.cur { border-color: var(--accent); }
.rec-title small { color: var(--muted); font-size: 10px; }
.rec-cur-title, .rec-next { text-align: center; font-size: 12px; }
.rec-cur-title b { font-size: 20px; }
.rec-next { color: var(--muted); margin-bottom: 4px; }
.rec-codex .rc-no { font-weight: 800; color: var(--accent); flex: none; width: 40px; }
.rec-codex .rc-mid { display: flex; flex-direction: column; flex: 1; }
.rec-codex .rc-mid small { color: var(--muted); font-size: 10px; }
.rec-codex .rc-dmg { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-codex .rc-dmg small { display: block; font-weight: 400; color: var(--muted); }
.rec-stat { justify-content: space-between; }
.rec-stat b { font-variant-numeric: tabular-nums; }
.rec-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0; }
.boss-nick {
  margin-left: 8px; font-size: .5em; font-weight: 700; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; vertical-align: middle;
}

/* 右書き(アラビア語) */
[dir="rtl"] #petWidget { left: auto; right: 12px; align-items: flex-end; }
[dir="rtl"] .kb-tip { text-align: left; }
[dir="rtl"] .set-nick-h small,
[dir="rtl"] .rec-ach .ra-t small { direction: rtl; }
[dir="rtl"] .hp-line, [dir="rtl"] .rec-stat { direction: rtl; }

@media (max-width: 440px) {
  .logo { font-size: 16px; }
  .ghost { padding: 5px 8px; font-size: 10.5px; }
  .topbtns { gap: 4px; }
  #presenceRow { font-size: 11px; }
}
@media (max-width: 380px) {
  .boss-emoji { font-size: 44vw; }
}
