/* Rivenhold Online — Overhaul UI layer.
 * Loaded after style.css / ui2.css / v10.css / mobile.css. Only the overhaul's own chrome lives here,
 * so nothing in the shipped sheets has to change. */

/* ───────────────────────── hub bar replaces the 15-icon menu ───────────────────────── */
.topmenu.ov-stowed { display: none !important; }

#ovHubBar.ov-hubbar {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  align-items: stretch;
  padding: 6px 8px;
  z-index: 12;
  background: linear-gradient(180deg, rgba(20, 28, 50, .94), rgba(10, 16, 32, .96));
  border: 1px solid rgba(140, 170, 240, .34);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 232, 170, .18), inset 0 0 0 1px rgba(255, 255, 255, .03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(var(--hud-w, 100vw) - 300px);
}

.ov-hubbar .ov-hub {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 52px;
  padding: 4px 0 3px;
  border: 1px solid rgba(150, 180, 245, .42);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(46, 62, 104, .96), rgba(22, 32, 60, .98));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
  color: #eef3ff;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s, border-color .14s, box-shadow .14s, filter .14s;
}
.ov-hubbar .ov-hub:hover {
  transform: translateY(-2px);
  border-color: #ffd860;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 216, 96, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
  filter: brightness(1.08);
}
.ov-hubbar .ov-hub:active { transform: translateY(0) scale(.95); }
.ov-hubbar .ov-hub.ov-open,
.ov-hubbar .ov-hub.on { border-color: #ffd860; box-shadow: 0 0 0 1px rgba(255, 216, 96, .45), inset 0 1px 0 rgba(255, 255, 255, .2); }
.ov-hubbar .ov-hub-ic { display: grid; place-items: center; width: 30px; height: 30px; line-height: 0; }
.ov-hubbar .ov-hub-ic svg { width: 30px; height: 30px; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.ov-hubbar .ov-hub small { font-size: 8px; line-height: 1.05; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.ov-hubbar .ov-hub-lock { position: absolute; top: -4px; right: -4px; padding: 1px 4px; border-radius: 8px; background: #e07a20; border: 1px solid #ffe0a8; font-style: normal; font-size: 8.5px; font-weight: 900; color: #fff; }
.ov-hubbar .ov-hub.ov-locked { opacity: .5; cursor: not-allowed; }
.ov-hubbar .ov-hub.ov-locked:hover { transform: none; border-color: rgba(150, 180, 245, .42); filter: none; box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14); }
.ov-hubbar .ov-hub-mini { width: 46px; }
.ov-hubbar .ov-hub-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: rgba(255, 255, 255, .1); }

@media (max-width: 900px) {
  .ov-hubbar { gap: 4px; padding: 4px 6px; }
  .ov-hubbar .ov-hub { width: 46px; padding: 3px 0 2px; border-radius: 11px; }
  .ov-hubbar .ov-hub-ic, .ov-hubbar .ov-hub-ic svg { width: 26px; height: 26px; }
  .ov-hubbar .ov-hub small { font-size: 8px; }
  .ov-hubbar .ov-hub-mini { width: 46px; }
}

/* ───────────────────────── tabbed hub windows ───────────────────────── */
.ov-hub { background: linear-gradient(180deg, #f5f8fd, #e4ebf6); }
.ov-hub .win-body { display: flex; flex-direction: column; gap: 0; padding-top: 0; }
.ov-hub-tabs { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0 6px; background: linear-gradient(180deg, #f5f8fd 70%, rgba(245, 248, 253, 0)); border-bottom: 1px solid #d6e0ee; margin-bottom: 4px; }
.ov-hub-tab { border: 1px solid #c8d8ee; background: #fff; color: #1c2a44; border-radius: 9px; padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.ov-hub-tab:hover { border-color: #7f9cd0; }
.ov-hub-tab.on { background: linear-gradient(180deg, #4a7ad0, #2f5cb0); color: #fff; border-color: #2a4a90; }
.ov-hub-host { position: relative; flex: 1 1 auto; min-height: 120px; }

/* a member window living inside a hub loses its own frame */
.win.ov-embedded {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  display: block !important;
}
.win.ov-embedded > .win-head { display: none !important; }
.win.ov-embedded > .win-body { padding: 0 !important; overflow: visible !important; }

/* ───────────────────────── left rail (quests / party / run) ───────────────────────── */
#ovRail.ov-rail {
  position: absolute;
  left: 10px;
  top: 300px;
  width: 302px;
  max-height: calc(var(--hud-h, 100vh) - 420px);
  display: flex;
  flex-direction: column;
  z-index: 4;
  pointer-events: auto;
}
.ov-rail-tabs { display: flex; gap: 3px; }
.ov-rail-tabs button {
  flex: 1;
  border: 1px solid var(--trim2, rgba(140, 170, 240, .35));
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(18, 30, 60, .88);
  color: #c8d6f4;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 2px;
  cursor: pointer;
}
.ov-rail-tabs button.on { background: linear-gradient(180deg, #34508e, #1f3366); color: #ffe890; }
.ov-rail-tabs button.ov-has::after { content: '●'; color: #7aff9a; font-size: 8px; margin-left: 3px; vertical-align: 2px; }
.ov-rail-pane { overflow-y: auto; overflow-x: hidden; border-radius: 0 0 12px 12px; }
.ov-rail-pane[hidden] { display: none !important; }

/* panels adopted into the rail become flow content */
.ov-railed {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 6px !important;
  box-sizing: border-box;
}
.ov-rail .party-panel, .ov-rail .quests, .ov-rail .nest-panel { border-radius: 10px; }

/* ───────────────────────── feed collapse ───────────────────────── */
.ov-feed-toggle {
  margin-left: 6px;
  width: 20px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  color: #e8eefc;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.ov-feed-toggle:hover { background: rgba(255, 255, 255, .22); }
.feed.ov-collapsed { max-height: 34px; overflow: hidden; }
.feed.ov-collapsed #feedList { display: none; }

/* ───────────────────────── shared bits for the new windows ───────────────────────── */
.ov-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.ov-dim { color: #7a8aa8; font-size: 11.5px; }
.ov-search { flex: 1; min-width: 120px; padding: 6px 9px; border: 1px solid #9ab4dc; border-radius: 8px; font: inherit; font-size: 13px; }
.ov-vlist { scrollbar-gutter: stable; }

/* anvil heat */
.ov-anvil { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid #c8d8ee; }
.ov-anvil h3 { margin: 0 0 4px; }
.ov-anvil-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; }
.ov-anvil-bar { height: 9px; border-radius: 5px; background: #dfe6f2; overflow: hidden; }
.ov-anvil-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb040, #ff5a2a); transition: width .3s; }

/* enchanting */
.ov-ench-list { display: grid; gap: 5px; margin: 8px 0; }
.ov-ench-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: #fff; border: 1px solid #c8d8ee; }
.ov-ench-main { display: grid; gap: 2px; min-width: 0; }
.ov-affixes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ov-affix { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; background: color-mix(in srgb, var(--ac, #8ac8ff) 16%, #fff); border: 1px solid var(--ac, #8ac8ff); color: #1c2a44; }
.ov-affix b { font-weight: 900; }
.ov-affix small { opacity: .8; font-size: 10px; }
.ov-affix .ov-x { all: unset; cursor: pointer; font-weight: 900; padding: 0 2px; color: #a03020; }

/* ───────────────────────── small screens ───────────────────────── */
@media (max-width: 900px) {
  #ovHubBar.ov-hubbar { left: 50%; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
  .ov-hubbar .ov-hub { min-width: 52px; padding: 2px 5px; }
  .ov-hubbar .ov-hub small { display: none; }
  #ovRail.ov-rail { width: 240px; top: 250px; max-height: 40vh; }
  .win.ov-embedded { min-width: 0 !important; }
}
html.ui-small #ovRail.ov-rail { display: none; }
html.ui-small #ovHubBar.ov-hubbar { max-width: calc(var(--hud-w) - 12px); }

/* ───────────────────────── support score on the world boss panel ───────────────────────── */
.ov-support { display: grid; gap: 1px; margin-top: 6px; padding: 5px 8px; border-radius: 9px; background: rgba(90, 220, 180, .12); border: 1px solid rgba(90, 220, 180, .4); }
.ov-support small { color: #7ae0c8; font-weight: 800; font-size: 10px; letter-spacing: .4px; }
.ov-support b { color: #d8fff4; font-size: 15px; }
.ov-support .ov-dim { color: #9fd8cc; font-size: 10.5px; }

/* ───────────────────────── compact (two-row) hotbar ───────────────────────── */
.ov-bar-toggle {
  width: 22px;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid #3c5a96;
  background: linear-gradient(180deg, #2f4a86, #1f3366);
  color: #cfe0ff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.ov-bar-toggle:hover { border-color: #8ab0ff; color: #fff; }

body.ov-compact-bar .hotbar-wrap { padding: 4px; }
body.ov-compact-bar .hotbar {
  display: grid;
  grid-template-columns: repeat(9, 40px);
  gap: 2px;
}
body.ov-compact-bar .hotbar .hk { width: 40px; height: 40px; }
body.ov-compact-bar .hotbar .hk canvas.icon { width: 30px !important; height: 30px !important; }
body.ov-compact-bar .hotbar .hk kbd { font-size: 8px; }
body.ov-compact-bar .hb-btn { width: 46px; font-size: 11px; }
body.ov-compact-bar .auto-btn { width: 50px; font-size: 11px; }
body.ov-compact-bar .ult-btn { width: 54px; }

/* keep the rail clear of the compact bar */
body.ov-compact-bar #ovRail.ov-rail { max-height: calc(var(--hud-h, 100vh) - 460px); }

@media (min-width: 1400px) {
  .ov-hubbar { gap: 6px; padding: 6px 9px; }
  .ov-hubbar .ov-hub { width: 56px; padding: 5px 0 4px; }
  .ov-hubbar .ov-hub-ic, .ov-hubbar .ov-hub-ic svg { width: 32px; height: 32px; }
  .ov-hubbar .ov-hub small { font-size: 9.5px; }
  .ov-hubbar .ov-hub-mini { width: 50px; }
}
