/* Valheim page — builds on /style.css tokens */
:root { --vh-gold: #f5b942; --danger: #f87171; }

.vh-status { font-size: 0.85rem; color: var(--muted); margin-top: -6px; }
.vh-status.err { color: var(--danger); }

/* photos (same layout as the SMITE 2 page) */
.vh-heroes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 720px; margin: 14px auto 18px; }
.vh-heroes img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 10px 30px rgba(0,0,0,0.45); cursor: zoom-in; transition: transform .15s ease; }
.vh-heroes img:hover { transform: translateY(-3px); }
@media (max-width: 600px) { .vh-heroes { gap: 8px; margin: 12px 0 14px; } .vh-heroes img { border-radius: 10px; } }
.vh-lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible; }
.vh-lightbox::backdrop { background: rgba(0,0,0,0.85); }
.vh-lightbox img { display: block; max-width: 94vw; max-height: 90vh; width: auto; height: auto; border-radius: 14px; cursor: zoom-out; }
.vh-lightbox:focus, .vh-lightbox:focus-visible { outline: none; }

/* tabs */
.vh-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.vh-tabs button { flex: 1 1 0; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.vh-tabs button:hover { color: var(--text); }
.vh-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* controls */
.vh-panel input[type="search"], .vh-panel textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; font: inherit; font-size: 16px;
}
.vh-panel input:focus, .vh-panel textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2); }
.vh-panel textarea { resize: vertical; }
.vh-toolbar { margin-bottom: 12px; }
.vh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.vh-chip { background: var(--surface); border: 1px solid var(--border); color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.vh-chip:hover { color: var(--text); }
.vh-chip[aria-pressed="true"] { background: rgba(124, 92, 255, 0.18); border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 8px; }

/* crafting layout */
.vh-craft { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.vh-craft .card { padding: 14px; }
.vh-results-wrap { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.vh-count { font-size: 0.8rem; color: var(--muted); margin: 0 4px 8px; }
.vh-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vh-results button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 1px solid transparent;
  color: var(--text); font: inherit; padding: 6px 8px; border-radius: 10px; cursor: pointer;
}
.vh-results button:hover { background: var(--surface-2); }
.vh-results button[aria-current="true"] { background: rgba(124, 92, 255, 0.14); border-color: rgba(124, 92, 255, 0.5); }
.vh-rname { font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.vh-rsub { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.vh-more { margin: 8px 4px 2px; }

.vh-ico { width: 32px; height: 32px; flex: none; object-fit: contain; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); padding: 2px; }
.vh-ico-blank { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-family: "Rajdhani", sans-serif; font-weight: 700; }

/* detail */
.vh-detail { min-height: 220px; }
.vh-empty { color: var(--muted); margin: 8px 4px; }
.vh-dhead { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.vh-dhead .vh-ico { width: 60px; height: 60px; border-radius: 12px; padding: 4px; }
.vh-dhead h3 { margin: 0; font-size: 1.6rem; }
.vh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vh-tag { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.vh-desc { color: var(--muted); font-style: italic; margin: 0 0 12px; }
.vh-info { margin: 0 0 14px; font-size: 0.93rem; }
.vh-sec { margin: 18px 0 8px; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.vh-where { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.vh-where li { position: relative; padding-left: 18px; font-size: 0.93rem; }
.vh-where li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--vh-gold); }
.vh-food { display: flex; flex-wrap: wrap; gap: 8px; }
.vh-food span { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 0.88rem; }
.vh-food b { color: var(--vh-gold); }

.vh-quality { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; }
.vh-quality span { font-size: 0.85rem; color: var(--muted); margin-right: 4px; }
.vh-station { font-size: 0.9rem; margin: 0 0 10px; }
.vh-station b { color: var(--vh-gold); }

/* material tree */
.vh-tree, .vh-tree ul { list-style: none; margin: 0; padding: 0; }
.vh-tree ul { margin-left: 22px; padding-left: 12px; border-left: 1px dashed var(--border); }
.vh-node { margin: 6px 0; }
.vh-row { display: flex; align-items: flex-start; gap: 10px; }
.vh-row .vh-ico { width: 30px; height: 30px; }
.vh-qty { font-weight: 700; color: var(--vh-gold); min-width: 2.2em; text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.vh-nm { padding-top: 3px; min-width: 0; }
.vh-link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.25); text-underline-offset: 3px; }
.vh-link:hover { color: var(--accent-2); text-decoration-color: currentColor; }
.vh-sub { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.35; margin-top: 1px; }

.vh-totals { display: flex; flex-wrap: wrap; gap: 8px; }
.vh-total { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 5px 10px 5px 6px; font-size: 0.9rem; }
.vh-total .vh-ico { width: 24px; height: 24px; padding: 1px; border-radius: 6px; }
.vh-total b { color: var(--vh-gold); }
.vh-usedin { display: flex; flex-wrap: wrap; gap: 6px; }
.vh-usedin .vh-link { font-weight: 500; font-size: 0.88rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; text-decoration: none; }
.vh-wiki { display: inline-block; margin-top: 18px; font-size: 0.88rem; }

/* chat */
.vh-chat { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin: 0 auto; }
.vh-chat-log { display: flex; flex-direction: column; gap: 10px; }
.vh-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 0.95rem; line-height: 1.55; }
.vh-msg p { margin: 0 0 6px; } .vh-msg p:last-child { margin: 0; }
.vh-msg ul { margin: 4px 0 6px; padding-left: 20px; }
.vh-msg li { margin: 2px 0; }
.vh-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 4px; }
.vh-me { align-self: flex-end; background: rgba(124, 92, 255, 0.22); border: 1px solid rgba(124, 92, 255, 0.45); border-top-right-radius: 4px; white-space: pre-wrap; }
.vh-thinking { color: var(--muted); font-style: italic; }
.vh-err { color: var(--danger); }
.vh-srcs { margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.vh-srcs a { margin-right: 8px; }
.vh-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.vh-ask { display: flex; gap: 10px; align-items: flex-end; }
.vh-ask textarea { flex: 1; min-height: 52px; }
.vh-ask .btn { flex: none; height: 52px; padding: 0 22px; }
.vh-foot { font-size: 0.78rem; color: var(--muted); margin: 0; }

@media (max-width: 760px) {
  .vh-craft { grid-template-columns: minmax(0, 1fr); }
  .vh-results-wrap { position: static; max-height: 46vh; }
  .vh-dhead h3 { font-size: 1.35rem; }
  .vh-tree ul { margin-left: 12px; padding-left: 8px; }
  .vh-msg { max-width: 100%; }
}
