/* 4ALL SITE-TOOLS1: the upgrade simulator (/upgrade-simulator) and the game tooltip of the item encyclopedia (/items).
   Uses the tokens of site.css only. The tooltip box is drawn like the game's (dark box, thin light frame, the game's
   font Arial); everything else keeps the site's look. */

/* ------------------------------------------------------------ simulator */
.sim-form { margin-bottom: 0; }
.sim-form .field { flex: 1 1 11rem; }
.sim-check { align-self: center; min-width: 12rem; }
.sim-cols { display: grid; gap: clamp(16px, 2vw, 22px); grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.sim-cols > * { min-width: 0; margin: 0; }
@media (max-width: 900px) { .sim-cols { grid-template-columns: minmax(0, 1fr); } }

.sim-item { display: flex; gap: 18px; align-items: center; min-height: 118px; }
.sim-slot { position: relative; flex: none; width: 104px; height: 104px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--gold-line); background: radial-gradient(circle at 50% 40%, rgb(var(--gold-rgb) / .10), rgba(0, 0, 0, .55) 70%); }
.item-ico.xl { width: 64px; height: 64px; border-radius: 8px; image-rendering: auto; }
.sim-lv { position: absolute; right: 6px; bottom: 4px; font: 700 1.15rem/1 var(--display); color: var(--text); text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.sim-lv.hi1 { color: var(--gold); }
.sim-lv.hi2 { color: var(--gold-hi); text-shadow: 0 0 8px rgb(var(--gold-rgb) / .65), 0 1px 3px #000; }
.sim-lv.hi3 { color: #fff4d6; text-shadow: 0 0 10px rgba(240, 180, 76, .9), 0 1px 3px #000; }
.sim-slot.is-gone .item-ico { filter: grayscale(1) brightness(.45); }
.sim-x { position: absolute; inset: auto 0 6px; text-align: center; font: 700 .8rem/1 var(--sans); color: var(--bad); text-transform: uppercase; letter-spacing: .08em; }
.sim-info { min-width: 0; }
.sim-info p { margin: 0 0 4px; }
.sim-name { font: 1.15rem/1.3 var(--display); color: var(--gold); }
.sim-chance { font: 1.2rem/1 var(--display); color: var(--gold-hi); }
.sim-reached { color: var(--ok); font-weight: 700; }
.sim-btns { margin-top: 16px; }
.sim-btns .btn { flex: 1 1 8rem; }
.sim-auto { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin-top: 14px; }
.sim-auto .field { min-width: 9rem; }
.fx-ok { animation: sim-ok .5s ease-out; }
.fx-fail { animation: sim-fail .45s ease-out; }
.fx-gone { animation: sim-gone .6s ease-out; }
@keyframes sim-ok { 0% { box-shadow: 0 0 0 0 rgba(95, 211, 138, .9); } 100% { box-shadow: 0 0 0 18px rgba(95, 211, 138, 0); } }
@keyframes sim-fail { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes sim-gone { 0% { box-shadow: 0 0 0 0 rgba(239, 107, 91, .9); transform: scale(1.04); } 100% { box-shadow: 0 0 0 20px rgba(239, 107, 91, 0); transform: none; } }
@media (prefers-reduced-motion: reduce) { .fx-ok, .fx-fail, .fx-gone { animation: none; } }

.sim-session h2 { margin-bottom: 0; }
.sim-session h3 { margin: 18px 0 0; font-size: 1rem; }
.sim-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); }
.sim-tiles .stat-tile dd { font-size: 1.15rem; }
.stat-tile.is-bad dd { color: var(--bad); }
.sim-clear { margin-top: 12px; }
.sim-log { list-style: none; margin: 8px 0 0; padding: 0; max-height: 16rem; overflow: auto; border: 1px solid var(--gold-line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.sim-log li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 3rem; gap: 8px; padding: 5px 10px; font-size: .85rem; border-bottom: 1px solid rgb(var(--gold-rgb) / .06); }
.sim-log li:nth-child(even) { background: var(--glass-row); }
.sim-log li:last-child { border-bottom: 0; }
.sim-log li > :last-child { text-align: right; }
.sim-log .r-ok .sim-res { color: var(--ok); }
.sim-log .r-keep .sim-res, .sim-log .r-down .sim-res { color: var(--warn); }
.sim-log .r-gone .sim-res { color: var(--bad); font-weight: 700; }
.sim-many .lead-sm { color: var(--text-2); }
.sim-table th[scope="row"] { font-weight: 600; color: var(--text); }
.sim-many .btn-row { margin-top: 10px; }
.sim-many .btn-row p { margin: 0; }

/* ------------------------------------------------------------ the game tooltip (/items) */
.game-tip { font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.38; color: #e8e8e8; background: rgba(8, 10, 14, .94);
  border: 1px solid #6f6a5c; border-radius: 3px; box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, .6); padding: 8px 11px 9px; min-width: 14rem; max-width: 22rem; }
.game-tip .gt-head { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; }
.game-tip .gt-head .item-ico { width: 34px; height: 34px; border-radius: 3px; border-color: #5c5747; }
.game-tip .gt-title { font-weight: 700; font-size: 14px; color: #fff; }
.game-tip .gt-line { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.game-tip .gt-gap { height: .7em; }
.game-tip .gt-price { color: #f1d27a; }
.game-tip .gt-note { margin: 6px 0 0; font-size: 11px; color: #9a968c; }
.game-tip-float { position: fixed; z-index: 60; pointer-events: none; }
.game-tip-float[hidden] { display: none; }
.item-sheet .game-tip { max-width: none; margin: 0 0 14px; }
.filters .field-check { flex: 0 1 auto; min-width: 0; align-self: end; padding-bottom: 8px; }
@media (max-width: 600px) {
  table.data.sim-table th, table.data.sim-table td { padding: 8px 6px; font-size: .82rem; }
  table.data.sim-table thead th { white-space: normal; letter-spacing: .03em; font-size: .62rem; }
  .sim-item { gap: 12px; }
  .sim-slot { width: 84px; height: 84px; }
  .item-ico.xl { width: 52px; height: 52px; }
}
