/* --- round --- */
.prompt { text-align: center; font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 0.01em; margin: 0 0 16px; }
.round-no {
  display: block;
  font-family: var(--body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}

.matchup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { min-width: 0; text-align: center; }

.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--panel-2);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.card:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), 0 16px 34px -12px rgba(0, 0, 0, 0.9); }
.card:disabled { cursor: default; }
/* lift the hovered card so its tooltips sit above the neighbouring square */
.card:hover, .card:has(.tip-host.show) { z-index: 3; }
.item-img { width: 100%; height: 100%; display: block; border-radius: 14px; object-fit: cover; user-select: none; }

/* translucent strip across the top: item name + cost */
.card { --top-h: clamp(40px, 11vw, 54px); }
.top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-radius: 14px 14px 0 0;
  background: rgba(7, 12, 19, 0.6);
  backdrop-filter: blur(2px);
  text-align: left;
}
/* thin slot-coloured rule under the top bar */
.top-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.top-bar.slot-weapon::after { background: #d9873a; }
.top-bar.slot-vitality::after { background: #6fb04f; }
.top-bar.slot-spirit::after { background: #a46ad8; }
.item-name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(16px, 4.4vw, 22px);
  letter-spacing: 0.01em;
  line-height: 1.1;
  min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cost {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: clamp(12px, 3.2vw, 15px);
  color: #9fe3e0;
  font-variant-numeric: tabular-nums;
}
.soul {
  width: 8px; height: 8px;
  transform: rotate(45deg);
  background: #5fd0cb;
  box-shadow: 0 0 6px #5fd0cb;
  border-radius: 1px;
}

/* translucent strip down the outer edge of each square, under the top bar */
.bar {
  position: absolute;
  top: var(--top-h); bottom: 0;
  width: 25%;
  min-width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  background: rgba(7, 12, 19, 0.55);
  backdrop-filter: blur(2px);
}
.pick-left .bar { left: 0; border-radius: 0 0 0 14px; }
.pick-right .bar { right: 0; border-radius: 0 0 14px 0; }

.bar .hero img { width: clamp(36px, 10vw, 58px); aspect-ratio: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.bar .clock { width: clamp(32px, 8.5vw, 48px); }


/* --- clock --- */
.clock .face { fill: #efe5cf; stroke: #2a241d; stroke-width: 1.6; }
.clock .bell { fill: #c9a14d; stroke: #2a241d; stroke-width: 1.2; }
.clock .leg { stroke: #2a241d; stroke-width: 1.8; stroke-linecap: round; }
.clock .ticks line { stroke: #2a241d; stroke-width: 1.3; stroke-linecap: round; }
.clock .hand { stroke: #1b1713; stroke-linecap: round; }
.clock .minute { stroke-width: 1.3; }
.clock .hour { stroke-width: 2.2; }
.clock .pin { fill: var(--blood); }
.clock .drop { fill: #7fc8f0; stroke: #2f6f97; stroke-width: 0.6; }
.clock.late { overflow: visible; }
.clock.late .clock-body { transform-origin: 16px 18px; animation: jitter 2.4s ease-in-out infinite; }
.clock.late .drop { animation: drip 2.4s ease-in-out infinite; }
.clock.late .drop:nth-of-type(2) { animation-delay: 0.3s; }
.clock.late .drop:nth-of-type(3) { animation-delay: 0.6s; }
@keyframes jitter {
  0%, 70%, 100% { transform: rotate(0); }
  74% { transform: rotate(-4deg); }
  78% { transform: rotate(3deg); }
  82% { transform: rotate(-2deg); }
}
@keyframes drip { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* --- reveal --- */
.result {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 10px 12px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88) 45%);
  display: flex; flex-direction: column; align-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.revealed .result { opacity: 1; transform: none; }
.result .pct { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 10vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; }
.result .n { font-size: 12px; color: var(--muted); margin-top: 4px; }
.revealed .higher .pct { color: #8fe09c; }

.revealed .card.higher { box-shadow: 0 0 0 3px var(--win), 0 10px 30px -12px rgba(0, 0, 0, 0.8); }
.revealed.missed .card.chosen { box-shadow: 0 0 0 3px var(--loss), 0 10px 30px -12px rgba(0, 0, 0, 0.8); }
.revealed .card:not(.chosen) { filter: saturate(0.75); }

.mark {
  position: absolute; top: -10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: none; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff;
  z-index: 2;
}
.pick-left .mark { left: -8px; }
.pick-right .mark { right: -8px; }
.revealed .chosen .mark { display: grid; animation: pop 0.35s ease-out; }
.revealed.got-it .chosen .mark { background: var(--win); }
.revealed.got-it .chosen .mark::before { content: "✓"; }
.revealed.missed .chosen .mark { background: var(--loss); }
.revealed.missed .chosen .mark::before { content: "✕"; }

.context { margin-top: 10px; font-size: 13px; color: var(--muted); visibility: hidden; }
.revealed .context { visibility: visible; }

.after { text-align: center; margin-top: 18px; }
.verdict { margin: 0 0 14px; color: var(--muted); }
.verdict strong { font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: 0.03em; margin-right: 4px; }
.good { color: var(--win); }
.bad { color: var(--loss); }

.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; opacity: 0.8; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: inherit; }
@media (pointer: coarse) { .hint { display: none; } }

/* --- results --- */
.board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.row-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; font-size: 14px; }
.row-head em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.row-dot { width: 12px; height: 12px; border-radius: 50%; }
.win .row-dot { background: var(--win); }
.loss .row-dot { background: var(--loss); }

.mini {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px 6px 6px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 2px solid transparent;
  text-align: left;
  min-width: 0;
}
.mini.higher { border-color: color-mix(in srgb, var(--win) 70%, transparent); }
.mini.chosen { box-shadow: inset 0 0 0 1px var(--text); }
.mini-item { width: 44px; height: 44px; border-radius: 6px; }
.mini-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mini-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-ctx { display: flex; align-items: center; gap: 4px; }
.mini-ctx img { width: 20px; height: 20px; }
.mini-ctx .clock { width: 18px; }
.mini-pct { font-family: var(--display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.mini.higher .mini-pct { color: #8fe09c; }

.lg.higher { border: 2px solid var(--win); }
.lg.chosen { box-shadow: inset 0 0 0 1px var(--text); }

@media (max-width: 520px) {
  .board li { grid-template-columns: 30px 1fr; }
  .row-head { grid-row: span 2; }
}

/* side bars hug the screen edges now, so open their tooltips inward */
.pick-left .bar .tip-host::after { left: 0; transform: translate(0, 4px); }
.pick-right .bar .tip-host::after { left: auto; right: 0; transform: translate(0, 4px); }
.pick-left .bar .tip-host:is(:hover, .show)::after,
.pick-right .bar .tip-host:is(:hover, .show)::after { transform: none; }

/* LAN-only reveal: show both win rates before picking and outline the higher one */
.dev-reveal .matchup:not(.revealed) .result { opacity: 0.9; transform: none; }
.dev-reveal .matchup:not(.revealed) .card.answer { outline: 2px dashed var(--win); outline-offset: 4px; }

/* --- fit to the window: the two cards take whatever height is left (cqh = % of the play area) --- */
body.fit .matchup { width: min(100%, calc(200cqh - 372px)); margin-inline: auto; }
body.fit .context { margin-top: 6px; }
body.fit .after { margin-top: clamp(6px, 1.4cqh, 18px); }
body.fit .verdict { margin-bottom: clamp(6px, 1.2cqh, 14px); }
body.fit .hint { margin-top: clamp(8px, 2cqh, 26px); }

/* --- item info: a small panel that slides up from the bottom of the card on hover --- */
.info-clip {
  position: absolute; inset: 0;
  overflow: hidden; border-radius: 14px;
  pointer-events: none;
  z-index: 1;
}
.info {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; flex-direction: column; gap: 4px;
  max-height: calc(100% - var(--top-h) - 16px); overflow: hidden;
  padding: 8px 10px 9px;
  border-radius: 10px;
  background: rgba(7, 12, 19, 0.92);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.8), inset 0 2px 0 var(--slot-c, var(--line));
  text-align: left;
  transform: translateY(calc(100% + 12px));
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}
.info.slot-weapon { --slot-c: #d9873a; }
.info.slot-vitality { --slot-c: #6fb04f; }
.info.slot-spirit { --slot-c: #a46ad8; }
.info-head { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slot-c, var(--muted)); }
.info-desc {
  font-size: 12.5px; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.info-stats { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; font-weight: 600; color: var(--steel); font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .card:hover .info { transform: none; opacity: 1; }
}
.card:focus-visible .info { transform: none; opacity: 1; }
/* the win-rate reveal sits on top of the panel once you've picked */
.revealed .info { display: none; }

