:root { --sprite-size: calc(min(86vw, 40dvh) * 0.88); }
.sub-meta, .monster-header, #monster-progress, .monster-progress, #status-badge, #btn-start, .damage-total, #total-damage { display: none !important; }
header {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  column-gap: 8px;
  justify-content: stretch;
}
.header-meta { margin-left: 0 !important; width: 100%; display: block !important; }
.brand-stack, .trikit-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: stretch;
}
.brand-btn,
.trikit-link-btn {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  white-space: nowrap;
}
.brand-btn {
  appearance: none;
  border: 1px solid rgba(251,191,36,.55);
  background: linear-gradient(180deg, #3a2e14, #1f1810);
  color: #fbbf24;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(251,191,36,.15), 0 4px 12px rgba(0,0,0,.35);
}
.brand-btn:active { transform: scale(.98); }
.trikit-link-btn {
  color: #7dd3fc !important;
  background: rgba(125,211,252,.1) !important;
  border: 1px solid rgba(125,211,252,.35) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.honor-chip,
.visit-count {
  box-sizing: border-box;
  height: 18px;
  line-height: 18px;
  display: flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.honor-chip { color: #fbbf24; justify-content: flex-start; }
.visit-count { color: var(--muted); font-weight: 700; justify-content: flex-end; }
body.in-fight .visit-count { visibility: hidden; }
.battle-arena, .video-wrap { flex: 1 1 0 !important; }
.battle-arena { overflow: visible !important; z-index: 20; }
.video-wrap { z-index: 10; }
.monster-stage { justify-content: flex-start !important; overflow: visible !important; }
.monster { transform: none; }
.monster.monster-drop .monster-sprite { animation: dungeon-drop .45s cubic-bezier(.2,1.4,.3,1) both; }
.monster.monster-crit .monster-sprite { animation: crit-push .28s ease-out; }
@keyframes dungeon-drop { from { transform: translateY(-70%) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes crit-push { 0% { transform: translateX(0); } 40% { transform: translateX(12%) scale(1.04); } 100% { transform: none; } }
.hp-panel { order: -1; position: relative !important; transform: none !important; padding: 10px 8px 4px !important; margin: 0 !important; width: 100%; z-index: 8; }
.hp-bar { width: 96% !important; margin: 0 auto !important; height: 24px !important; }
#hp-text, .hp-value { display: flex !important; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: .92rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; z-index: 2; }
.fight-dock { position: absolute; left: 0; right: 0; top: 100%; height: 0; transform: none; z-index: 40; pointer-events: none; }
.battle-arena.dungeon-run .nav-arrow,
.battle-arena.dungeon-run .fight-dock { display: none !important; }
.btn-accept-fight,
.btn-cancel-fight {
  position: absolute !important; left: 50% !important; top: 0 !important; bottom: auto !important; right: auto !important; margin: 0 !important;
  transform: translate(-50%, -50%) !important; width: 76% !important; max-width: 280px !important; padding: 12px 18px !important;
  font-size: 1rem !important; font-weight: 800 !important; white-space: nowrap !important; border-radius: 999px !important;
  display: flex !important; align-items: center; justify-content: center; pointer-events: auto; box-shadow: 0 3px 10px rgba(0,0,0,.35) !important;
}
.btn-accept-fight { background: var(--accent) !important; color: #052e16 !important; border: none !important; }
.btn-cancel-fight { background: #dc2626 !important; color: #fff !important; border: none !important; }
.btn-accept-fight.hidden, .btn-cancel-fight.hidden { display: none !important; }
.pose-hint { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 6; text-align: center; font-size: .78rem; font-weight: 700; color: #fde68a; text-shadow: 0 1px 6px #000; pointer-events: none; }
.pose-hint.hidden { display: none; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px !important; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; flex: none; }
.mode-card.mode-card-coop { grid-column: 1 / -1; border-color: #c9a227; background: linear-gradient(180deg, #2a2418, var(--surface)); }
.mode-card.mode-card-off,
.mode-card:disabled {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: none;
  background: #1a1c22;
  color: #9aa3b2;
}
.mode-emoji { font-size: 1.4rem; }
.mode-title { font-size: .95rem; font-weight: 800; }
.mode-hint { font-size: .7rem; color: var(--muted); }
.party-hud { display: flex; gap: 6px; padding: 0 8px 4px; }
.party-hud.hidden { display: none; }
.party-chip { position: relative; overflow: visible; flex: 1; min-width: 0; background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; }
.party-chip.me { border-color: #c9a227; }
.party-chip.dead { opacity: .45; }
.party-nick { display: block; font-size: .62rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-hp { position: relative; height: 5px; background: #3f1d1d; border-radius: 99px; margin-top: 3px; overflow: hidden; }
.party-hp .hp-red { display: block; height: 100%; background: #f87171; border-radius: 99px; }
.party-hp .hp-heal {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: #4ade80; border-radius: 99px; opacity: 0; pointer-events: none;
}
.party-chip.just-healed .hp-heal { animation: heal-bar .7s ease-out; }
.party-chip.just-healed .hp-red { animation: heal-red .7s ease-out; }
@keyframes heal-bar {
  0% { width: var(--hp-from, 0%); opacity: 1; }
  35% { width: var(--hp-to, 100%); opacity: 1; }
  100% { width: var(--hp-to, 100%); opacity: 0; }
}
@keyframes heal-red {
  0%, 45% { background: #4ade80; }
  100% { background: #f87171; }
}
.party-shield { font-size: .58rem; color: #93c5fd; }
.heal-pop {
  position: absolute; right: 4px; top: -2px; color: #4ade80;
  font-size: .78rem; font-weight: 800; text-shadow: 0 1px 4px #000;
  pointer-events: none; animation: heal-up .75s ease-out forwards;
}
.heal-pop.hidden { display: none; }
@keyframes heal-up {
  0% { opacity: 1; transform: translateY(4px) scale(.9); }
  100% { opacity: 0; transform: translateY(-14px) scale(1.1); }
}
.dungeon-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.dungeon-form input, .dungeon-form select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; }
.lobby-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.lobby-row { display: flex; justify-content: space-between; font-size: .85rem; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.lobby-row.ready { border-color: #4ade80; }
.room-code { font-family: ui-monospace, monospace; font-size: 1.6rem; letter-spacing: .22em; font-weight: 800; text-align: center; }
.leader-row { display: grid; grid-template-columns: 2rem 1fr auto; gap: 8px; width: 100%; font-size: .85rem; padding: 6px 0; border-bottom: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: .8rem; }
.frame-guide { position: absolute; inset: 8px; border: 4px dashed rgba(255,255,255,.28); border-radius: 10px; pointer-events: none; z-index: 5; box-shadow: none; }
.frame-guide.ok { border-color: rgba(74,222,128,.55); box-shadow: none; }
.frame-guide.hidden { display: none; }
.next-banner { position: absolute; left: 8px; right: 8px; top: 36%; z-index: 30; text-align: center; font-size: 1.05rem; font-weight: 800; color: #fde68a; text-shadow: 0 2px 10px #000; pointer-events: none; }
.next-banner.hidden { display: none; }
.lobby-tools { display: flex; gap: 8px; width: 100%; }
.lobby-tools button { flex: 1; }
.intro-wide { max-height: 92dvh; }
.intro-scroll { max-height: 52dvh; overflow: auto; text-align: left; font-size: .82rem; line-height: 1.4; color: var(--text); padding-right: 4px; }
.intro-scroll p { margin: 0 0 8px; }
.intro-h { font-weight: 800; margin: 0 0 6px !important; padding: 0 !important; }
.intro-list { margin: 0 0 8px; padding-left: 18px; }
.intro-list li { margin-bottom: 6px; }
.privacy-check { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: .8rem; margin: 10px 0 6px; }
.privacy-check input { margin-top: 3px; }
.btn-primary:disabled { opacity: .45; }
