/* 플레이 후기 1차: 게임 조작을 방해하지 않는 정보와 슬롯. */
.readout[data-tone="gold"] > .value {
  min-width: 4ch;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.readout[data-tone="gold"] .hud-gold-coin {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: none;
  opacity: 1;
}
#game-app,
#menu-dialog,
#result-dialog {
  user-select: none;
  -webkit-user-select: none;
}
:is(#game-app, #menu-dialog, #result-dialog)
  :is(input, textarea, [contenteditable="true"]) {
  user-select: text;
  -webkit-user-select: text;
}
:is(#game-app, #menu-dialog, #result-dialog) :is(img, a) {
  -webkit-user-drag: none;
}
#dock .bench-unit[data-rarity] {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--rarity-color) 30%, var(--surface-2)),
    var(--surface-2)
  );
  border-color: color-mix(in srgb, var(--rarity-color) 65%, var(--edge));
  border-bottom: 4px solid var(--rarity-color);
}
#dock .bench-unit[data-rarity]:hover,
#dock .bench-unit[data-rarity]:focus-visible {
  box-shadow:
    0 0 0 2px var(--rarity-color),
    0 5px 18px #0005;
}
#dock .bench-unit[data-rarity][data-selected="true"] {
  outline: 2px solid #fff2a8;
  outline-offset: 2px;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--rarity-color) 48%, var(--surface-2)),
    var(--surface-2)
  );
}
#dock .bench-name {
  text-shadow: 0 1px 3px #000;
}
#inventory-window .inventory-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: 30px;
  gap: 6px;
  height: 104px;
  min-height: 104px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #8993ad #151c2c;
  overscroll-behavior: contain;
  padding: 1px 3px 1px 1px;
}
#inventory-window .inventory-item {
  height: 30px;
}
#inventory-window .owned-item-button {
  height: 30px;
  min-height: 30px;
  padding: 2px;
}
#inventory-window .inventory-empty-slot {
  height: 30px;
  border: 1px dashed #ffffff20;
  border-radius: 8px;
  background: #0b111b66;
  box-shadow: inset 0 2px 6px #0002;
}
#inventory-window .owned-item-button {
  position: relative;
}
.item-combine-preview {
  position: absolute;
  right: -2px;
  bottom: -2px;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: #202a30;
  border: 1px solid #ffe59b;
  border-radius: 5px;
  box-shadow: 0 0 10px #ffd67c66;
}
@media (prefers-reduced-motion: reduce) {
  #dock .bench-unit {
    transition: none;
    animation: none;
  }
}

.boss-intro {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  background: #090b19;
  animation: boss-intro-reveal 2.6s steps(6, end) both;
}
.boss-intro[hidden] {
  display: none;
}
.boss-intro-pixels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.boss-intro-content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 18px;
}
.boss-intro-kicker {
  color: #f2ca84;
  font: 800 12px var(--font-ui);
  letter-spacing: 0.2em;
}
.boss-intro-portrait {
  filter: drop-shadow(4px 4px 0 #4c1638);
  animation: boss-portrait-arrive 0.65s steps(5, end) both;
}
.boss-intro-portrait .portrait {
  border-radius: 0;
  border: 3px solid #f0cd8b;
  background: #141225;
  overflow: hidden;
  box-shadow: 0 0 0 4px #743b54;
  clip-path: polygon(
    8% 0,
    92% 0,
    92% 8%,
    100% 8%,
    100% 92%,
    92% 92%,
    92% 100%,
    8% 100%,
    8% 92%,
    0 92%,
    0 8%,
    8% 8%
  );
}
.boss-intro-warning {
  color: #fff2d6;
  font-size: clamp(18px, 2.5vw, 34px);
  line-height: 1.3;
  text-shadow: 2px 2px 0 #54213f;
}
.boss-intro-name {
  color: #f8cf83;
  font-size: clamp(16px, 2vw, 25px);
}
.boss-intro-content small {
  color: #d5b9ce;
  font-size: 12px;
}
.boss-intro[data-paused="true"],
.boss-intro[data-paused="true"] * {
  animation-play-state: paused;
}
.boss-intro[data-paused="true"],
.boss-intro[data-paused="true"] .boss-intro-portrait {
  opacity: 1 !important;
}
.boss-intro[data-paused="true"] .boss-intro-portrait {
  transform: none !important;
  filter: drop-shadow(4px 4px 0 #4c1638) !important;
}
.boss-intro[data-reduced="true"] {
  animation: none;
}
.boss-intro[data-reduced="true"] * {
  animation: none;
}
@keyframes boss-intro-reveal {
  0% {
    opacity: 0;
  }
  12%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes boss-portrait-arrive {
  from {
    transform: scale(1.65);
    opacity: 0;
    filter: brightness(3);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .boss-intro,
  .boss-intro * {
    animation: none !important;
  }
}

/* Three ticket draws share the recruitment row. */
.recruit-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.recruit-controls > .recruit-button[data-ticket] {
  min-width: 0;
  min-height: 42px !important;
  padding: 5px 6px;
  gap: 4px;
  flex-wrap: wrap;
}
.recruit-controls > .recruit-button[data-ticket] > b {
  font-size: 11px !important;
  text-align: center;
  flex: 1 1 auto;
}
.recruit-controls > .recruit-button[data-ticket] > .ico {
  width: 16px;
  height: 16px;
}
.recruit-controls > .recruit-button[data-ticket] > span {
  font-size: 11px;
}
.recruit-controls > .recruit-secondary,
.recruit-controls > small {
  grid-column: 1 / -1;
}

/* Keep ticket artwork and quantities inside the short dock. */
.dock {
  min-height: 0;
  overflow-y: auto;
}
.recruit-controls {
  min-width: 0;
  min-height: 0;
  align-content: center;
  gap: 5px !important;
}
.recruit-controls > .recruit-button[data-ticket] {
  position: relative;
  height: 44px;
  min-height: 44px !important;
  padding: 2px 15px 2px 2px !important;
  flex-wrap: nowrap;
  justify-content: center;
  overflow: visible;
}
.ticket-image {
  display: block;
  width: min(100%, 58px);
  height: 36px;
  object-fit: contain;
  flex: 0 1 auto;
  image-rendering: pixelated;
}
.recruit-controls .ticket-count {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  background: #101a2e;
  color: #fff;
  font-size: 11px !important;
  line-height: 1.2;
  white-space: nowrap;
}
.recruit-controls > .recruit-secondary .btn.icon-only {
  height: 30px;
  min-height: 30px;
}
.recruit-controls > small {
  display: none;
}
.ticket-shop-image {
  display: block;
  max-width: 100%;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}
.recruit-button[data-ticket]::before {
  content: attr(data-shortcut);
  position: absolute;
  left: 3px;
  top: 2px;
  font: 700 10px / 1.2 monospace;
  color: #fff;
  background: #101a2ecc;
  border-radius: 2px;
  padding: 1px 3px;
  pointer-events: none;
}
/* The ::before here is the shortcut badge; keep the primary-button shine sweep (which parks outside the button) off it. */
.recruit-controls > .recruit-button[data-ticket]:not(:disabled)::before {
  content: attr(data-shortcut);
  inset: auto;
  left: 3px;
  top: 2px;
  width: auto;
  z-index: 1;
  transform: none;
  animation: none;
  background: #101a2ecc;
}

/* Button hints use the shared viewport tooltip, outside clipped UI panels. */
.btn.icon-only[aria-label]:hover::after,
.btn.icon-only[aria-label]:focus-visible::after {
  content: none !important;
  display: none !important;
}
.item-tooltip {
  z-index: 9000;
}
dialog[open] .item-tooltip {
  z-index: 10000;
}
.synergy-hover-card {
  z-index: 9000;
}
dialog[open] .synergy-hover-card {
  z-index: 10000;
}
.toast[data-tone="sale"] {
  transition-duration: 100ms;
}
.ticket-reward-flight {
  position: fixed;
  z-index: 160;
  display: grid;
  justify-items: center;
  gap: 3px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: #c9f9d9;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 5px #000;
  white-space: nowrap;
}
.ticket-reward-flight img {
  width: 96px;
  height: 59px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px #0009);
}
.ticket-reward-flight[data-ticket="RARE"] {
  color: #9bd4ff;
}
.ticket-reward-flight[data-ticket="UNIQUE"] {
  color: #dfb8ff;
}
.ticket-reward-plus {
  position: fixed;
  z-index: 160;
  color: #e7fff4;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 4px #000;
  pointer-events: none;
}

/* The bench mirrors the field: 20 slim tiles in one row, reorderable by drag (display order only). */
#dock .bench-grid {
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 3px;
}
#dock .bench-grid .bench-name {
  display: none;
}
#dock .bench-unit[draggable="true"] {
  cursor: grab;
}
#dock .bench-unit[data-insert="before"] {
  box-shadow: -4px 0 0 #ffe38d !important;
}
#dock .bench-unit[data-insert="after"] {
  box-shadow: 4px 0 0 #ffe38d !important;
}
#dock .bench-group[data-off-field="true"] .bench-unit {
  opacity: 0.6;
  border-style: dashed;
}
#dock .bench-empty-slot {
  opacity: 0.4;
}
@media (max-width: 1100px) {
  #dock .bench-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}
/* Bench tile: portrait on top, three tiny equipment slots below. */
#dock .bench-group .bench-unit {
  justify-content: flex-start;
  gap: 3px;
  padding: 6px 2px 4px;
}
#dock .bench-items {
  display: flex;
  gap: 2px;
  justify-content: center;
}
#dock .bench-items > * {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #0b0f18aa;
  box-shadow: inset 0 0 0 1px #ffffff22;
}
#dock .bench-items .item-icon img {
  width: 12px;
  height: 12px;
  image-rendering: pixelated;
}
#dock .bench-section[data-sale-mode="multi"] .bench-unit[data-unit-uid] {
  border-color: #d97c60;
  cursor: pointer;
}
/* 4·5·6 shortcut badges on the dock's sort / evolve / quick-sell buttons. */
#dock [data-shortcut] {
  position: relative;
  overflow: visible;
}
#dock .key-badge {
  position: absolute;
  left: 2px;
  top: 1px;
  padding: 0 3px;
  border-radius: 2px;
  background: #101a2ecc;
  color: #fff;
  font: 700 9px / 1.3 monospace;
  pointer-events: none;
}
/* Dock tool column: 4 sort · 5 evolve · 6 quick sell · multi sell in a 2×2 grid. */
#dock .bench-section {
  grid-template-columns: 74px minmax(0, 1fr) !important;
}
#dock .bench-label {
  display: grid !important;
  grid-template-columns: repeat(2, 34px);
  gap: 4px !important;
  align-content: center;
  justify-content: center;
}
#dock .bench-label > h2,
#dock .bench-label > .bench-capacity {
  display: none;
}
#dock .bench-label > .btn.icon-only {
  width: 34px !important;
  min-width: 34px;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
}
#dock .bench-sale-toggle[aria-pressed="true"] {
  background: #b8402e !important;
  border-color: #ffb09a !important;
  box-shadow:
    0 0 0 2px #ff7a5c88,
    inset 0 -3px 0 #6f2216 !important;
}
/* Selling: red banner above the dock and red-tinted tiles. */
.bench-sale-banner {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--dock-h) + 12px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  border: 2px solid #ffb09a;
  border-radius: 10px;
  background: #6f2216ee;
  color: #fff;
  box-shadow: 0 6px 20px #0008;
}
.bench-sale-banner b {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.bench-sale-banner .btn {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
}
#dock .bench-section[data-sale-mode] .bench-unit[data-unit-uid] {
  border-color: #ff8a6c !important;
  box-shadow:
    inset 0 0 0 2px #ff5a3c66,
    0 0 10px #ff5a3c55 !important;
  cursor: pointer;
}
#dock .bench-section[data-sale-mode] .bench-unit[data-sale-selected="true"] {
  background: #8a2d1f !important;
  box-shadow:
    inset 0 0 0 3px #ffd0c2,
    0 0 12px #ff5a3caa !important;
}
/* Item choice (intermission / boss reward): one clickable icon per item, details in the hover tooltip. */
.intermission-choices:has(> .intermission-item) {
  grid-template-columns: repeat(auto-fit, 96px);
  justify-content: center;
  gap: 12px;
}
.intermission-card.intermission-item {
  width: 96px;
  height: 96px;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid var(--edge, #0a0d15);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 40%, #ffe38d30, transparent 65%),
    var(--card-face, #2a3442);
  box-shadow:
    inset -4px -4px 0 var(--card-shade, #0003),
    inset 3px 3px 0 #ffffff20,
    3px 3px 0 var(--drop, #0008);
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}
.intermission-card.intermission-item:hover,
.intermission-card.intermission-item:focus-visible {
  transform: translateY(-3px);
  border-color: #ffe38d;
}
.intermission-card.intermission-item .item-icon img {
  image-rendering: pixelated;
}
/* Highlighted synergy row in the left rail: glowing border that pulses, a light sweep and twinkling sparkles. */
.rail .synergy-row[aria-pressed="true"] {
  position: relative;
  overflow: hidden;
  outline: none !important;
  isolation: isolate;
  box-shadow:
    inset 0 0 0 2px var(--type),
    0 0 12px color-mix(in srgb, var(--type) 70%, transparent) !important;
  animation: synergy-pick-pulse 1.4s ease-in-out infinite;
}
.rail .synergy-row[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 35%,
    #ffffff66 48%,
    transparent 60%
  );
  background-size: 260% 100%;
  animation: synergy-pick-sweep 1.8s linear infinite;
}
.rail .synergy-row[aria-pressed="true"]::before {
  content: "✦";
  position: absolute;
  z-index: 3;
  top: 3px;
  right: 6px;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 6px var(--type),
    -14px 14px 0 color-mix(in srgb, var(--type) 60%, #fff);
  pointer-events: none;
  animation: synergy-pick-twinkle 1.1s ease-in-out infinite;
}
@keyframes synergy-pick-pulse {
  50% {
    box-shadow:
      inset 0 0 0 2px #fff,
      0 0 20px var(--type) !important;
  }
}
@keyframes synergy-pick-sweep {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -130% 0;
  }
}
@keyframes synergy-pick-twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.7) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(45deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rail .synergy-row[aria-pressed="true"],
  .rail .synergy-row[aria-pressed="true"]::after,
  .rail .synergy-row[aria-pressed="true"]::before {
    animation: none;
  }
}
/* 6 quick sell: always red so it stands out from the other dock tools. */
#dock .bench-sale-toggle[data-action="quick-sale"] {
  --bf: #d9473a;
  --bs: #8f2219;
  --bh: #ef6a5c;
  color: #fff;
}
#dock .bench-sale-toggle[data-action="quick-sale"] .ico {
  background-color: #fff;
}
/* Summon detail: teal frame + "소환체" badge, one-line reason, time-left bar. */
#detail[data-card-summon="true"] {
  --card-accent: #2bc4c4;
  --card-deep: #137a7a;
  --card-wash: #123437;
  --card-glow: #2bc4c455;
}
.summon-detail .detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.summon-detail .summon-reason {
  margin: 3px 0 0;
  font-size: 12px;
  color: #9fe9e6;
}
.summon-detail .summon-life {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.summon-detail .summon-life-bar {
  flex: 1;
  height: 7px;
  border: 2px solid #0a0d15;
  border-radius: 4px;
  background: #08202a;
  overflow: hidden;
}
.summon-detail .summon-life-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2bc4c4, #9ff5f0);
}
.summon-detail .summon-life small {
  font-variant-numeric: tabular-nums;
  color: #cfeeee;
}
.summon-detail .summon-locked {
  margin-top: 10px;
  font-size: 11px;
  color: #ff9b7a;
}
.summon-detail.panel {
  padding: 12px 14px 14px;
}
.summon-detail .stat-grid {
  margin-top: 8px;
}
