/* World Visualizer (templates/world_visualizer.html, static/visualizer.js) */
.wv-intro { max-width: 820px; }
.wv-controls { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; padding: .8rem 1rem; margin-bottom: .8rem; }
.wv-controls label { display: flex; gap: .5rem; align-items: center; font-weight: 600; font-size: .9rem; }
.wv-controls select { font: inherit; font-weight: 500; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); max-width: 78vw; }
.wv-size { display: flex; gap: .4rem; align-items: center; font-weight: 600; font-size: .9rem; flex-wrap: wrap; }
.wv-size button { font: inherit; font-size: .85rem; font-weight: 600; padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.wv-size button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.wv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .9rem; margin: 0 0 .6rem; }
.wv-bar { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; }
.wv-bar i { display: inline-block; width: 160px; height: 12px; border-radius: 6px; }
.wv-none { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.wv-none i { width: 12px; height: 12px; border-radius: 3px; background: #e6e8eb; display: inline-block; }

.wv-wrap { display: grid; grid-template-columns: 1fr 290px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .wv-wrap { grid-template-columns: 1fr; } }
.wv-map { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.wv-region { position: absolute; box-sizing: border-box; border: 2px solid #fff; background: #f1f3f5; }
.wv-region-name { position: absolute; left: 6px; top: 2px; right: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wv-cell { position: absolute; box-sizing: border-box; border: 1px solid rgba(255,255,255,.85); overflow: hidden; cursor: pointer;
  padding: 3px 5px; display: flex; flex-direction: column; color: #1f2328; line-height: 1.15; transition: filter .1s; }
.wv-cell:hover { filter: brightness(.92); outline: 2px solid #202124; outline-offset: -2px; z-index: 2; }
.wv-cell .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wv-cell .v { font-weight: 500; opacity: .85; white-space: nowrap; }

.wv-side { padding: 1rem; font-size: .9rem; }
.wv-side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .4rem; }
.wv-stat { display: flex; flex-direction: column; margin-bottom: .7rem; }
.wv-stat b { font-size: 1.6rem; line-height: 1.2; }
.wv-regions { list-style: none; padding: 0; margin: 0; }
.wv-regions li { display: grid; grid-template-columns: 1fr 70px auto; gap: .5rem; align-items: center; padding: .15rem 0; font-size: .82rem; }
.wv-regions i { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .75; }
.wv-regions b { min-width: 4.2rem; text-align: right; }
.wv-rank { padding-left: 1.3rem; margin: 0; }
.wv-rank li { padding: .12rem 0; }
.wv-rank li, .wv-detail li { display: list-item; }
.wv-rank li span { display: inline-block; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.wv-rank li b { float: right; }

.wv-tip { position: fixed; z-index: 50; pointer-events: none; background: #202124; color: #fff; padding: .5rem .7rem; border-radius: 8px;
  font-size: .85rem; line-height: 1.4; max-width: 260px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.wv-tip .muted { color: #c4c7cc; }
.wv-detail { position: fixed; z-index: 60; right: 1rem; bottom: 1rem; width: min(360px, calc(100vw - 2rem)); max-height: 75vh; overflow: auto;
  padding: 1rem 1.1rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.wv-detail h2 { margin: 0 2rem .2rem 0; font-size: 1.25rem; }
.wv-detail h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .9rem 0 .3rem; }
.wv-detail ul { list-style: none; padding: 0; margin: 0; }
.wv-detail li { display: flex; gap: .5rem; align-items: baseline; padding: .18rem .3rem; font-size: .88rem; border-radius: 6px; }
.wv-detail li span { flex: 1; }
.wv-detail li i { font-style: normal; color: var(--muted); font-size: .75rem; }
.wv-detail li.on { background: var(--accent-soft); }
.wv-close { position: absolute; right: .7rem; top: .6rem; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.wv-foot { margin-top: 1rem; line-height: 1.6; }
@media (max-width: 600px) {
  .wv-controls label { flex-direction: column; align-items: stretch; width: 100%; gap: .3rem; }
  .wv-controls select { max-width: none; width: 100%; }
}
.wv-side p.small { margin-top: .7rem; }
