/* FETİH v6 — left rail, resources, notifications, panels */
:root {
  --v6-rail: 52px;
  --v6-panel: 360px;
}
#screen-game.v6-on { --hud-left: calc(var(--v6-rail) + 8px); }

.v6-rail {
  position: absolute; left: 8px; top: 68px; bottom: 16px; width: var(--v6-rail);
  z-index: 40; display: flex; flex-direction: column; gap: 6px;
  padding: 8px 6px; border-radius: 14px;
  background: rgba(12,12,12,.78); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.v6-rail button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: #ddd; cursor: pointer; display: grid; place-items: center;
  transition: .15s ease;
}
.v6-rail button:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
.v6-rail button.active {
  background: #fff; color: #111; border-color: #fff;
  box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.35);
}
.v6-rail button .lucide { width: 18px; height: 18px; }
.v6-rail .rail-spacer { flex: 1; }
.v6-rail .rail-help { color: #aaa; }

.v6-panel {
  position: absolute; left: calc(var(--v6-rail) + 16px); top: 68px; bottom: 16px;
  width: min(var(--v6-panel), calc(100vw - 100px)); z-index: 39;
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: rgba(10,10,10,.88); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  transform: translateX(-12px); opacity: 0; pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
}
.v6-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.v6-panel .vp-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1); font-weight: 700; letter-spacing: .04em;
}
.v6-panel .vp-head .lucide { width: 18px; height: 18px; }
.v6-panel .vp-close {
  margin-left: auto; background: transparent; border: 0; color: #bbb; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px;
}
.v6-panel .vp-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.v6-panel .vp-body { flex: 1; overflow: auto; padding: 12px 14px; scrollbar-width: thin; }
.v6-panel .vp-section { margin-bottom: 14px; }
.v6-panel .vp-section h4 {
  margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #999;
}
.v6-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.v6-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v6-card .muted { color: #999; font-size: 12px; }
.v6-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.v6-stat {
  background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px;
  border: 1px solid rgba(255,255,255,.07);
}
.v6-stat small { display: block; color: #999; font-size: 10px; text-transform: uppercase; }
.v6-stat b { font-size: 18px; color: #fff; }
.v6-stat em { font-style: normal; font-size: 12px; color: #8f8; }
.v6-stat em.neg { color: #f88; }

.v6-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #eee; font-size: 12px; cursor: pointer;
}
.v6-btn:hover { background: rgba(255,255,255,.14); }
.v6-btn.primary { background: #fff; color: #111; border-color: #fff; font-weight: 600; }
.v6-btn.danger { background: #c0392b; border-color: #e74c3c; color: #fff; }
.v6-btn.ghost { background: transparent; }
.v6-btn:disabled { opacity: .4; cursor: not-allowed; }

.v6-slider { width: 100%; accent-color: #fff; }
.v6-bar {
  height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 4px;
}
.v6-bar > i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.v6-bar.food > i { background: #6dcf6d; }
.v6-bar.iron > i { background: #9aa; }
.v6-bar.stab > i { background: #5bc0de; }
.v6-bar.rep > i { background: #e6c35c; }
.v6-bar.warn > i { background: #e67e22; }
.v6-bar.danger > i { background: #e74c3c; }

.diplo-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.diplo-card.is-dead { opacity: .55; }
.diplo-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.diplo-who b {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px;
}
.diplo-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45);
}
.diplo-offer { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.diplo-kind, .diplo-field {
  flex: 1 1 auto; min-width: 0; width: auto;
  background: #141414; color: #eee;
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px;
  padding: 7px 8px; font: inherit; font-size: 12px;
}
.diplo-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.diplo-actions .v6-btn {
  justify-content: center; padding: 7px 2px; width: 100%;
  font-size: 11px; white-space: nowrap;
}
.diplo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.diplo-chip { border-radius: 99px; }
.rel-matrix { width: 100%; border-collapse: collapse; font-size: 11px; }
.rel-matrix th, .rel-matrix td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.rel-chip {
  display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,.1);
}
.rel-chip.war { background: #c0392b; color: #fff; }
.rel-chip.alliance { background: #27ae60; color: #fff; }
.rel-chip.ceasefire { background: #f39c12; color: #111; }
.rel-chip.trade { background: #2980b9; color: #fff; }
.rel-chip.nap { background: #8e44ad; color: #fff; }
.rel-chip.vassal { background: #7f8c8d; color: #fff; }
.rel-chip.peace { background: rgba(255,255,255,.15); }

/* Resource chips extras */
.res.food { --rc: #6dcf6d; }
.res.iron { --rc: #aab; }
.res.stab { --rc: #5bc0de; }
.res.rep { --rc: #e6c35c; }
.res.pop { --rc: #c39bd3; }

/* Notification bell */
.notif-wrap { position: relative; }
.notif-wrap .badge {
  position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 99px; background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 1px solid #111;
}
.notif-panel {
  position: absolute; right: 8px; top: 58px; width: min(360px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 80px)); z-index: 50;
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: rgba(12,12,12,.94); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px); box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.notif-panel.hidden { display: none; }
.notif-panel .np-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.1); font-weight: 700;
}
.notif-panel .np-tabs { display: flex; gap: 4px; padding: 8px 10px; flex-wrap: wrap; }
.notif-panel .np-tabs button {
  padding: 4px 8px; border-radius: 99px; border: 1px solid rgba(255,255,255,.12);
  background: transparent; color: #ccc; font-size: 11px; cursor: pointer;
}
.notif-panel .np-tabs button.active { background: #fff; color: #111; }
.notif-list { overflow: auto; flex: 1; padding: 8px 10px; }
.notif-item {
  padding: 10px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
}
.notif-item.unread { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.notif-item .ni-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.notif-item .ni-text { font-size: 12px; color: #bbb; margin-bottom: 8px; }
.notif-item .ni-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.notif-item .cat {
  display: inline-block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em;
  color: #888; margin-bottom: 4px;
}

/* How to play modal content */
.howto-body { font-size: 13px; line-height: 1.55; color: #ccc; max-height: 55vh; overflow: auto; text-align: left; }
.howto-body h4 { color: #fff; margin: 12px 0 4px; font-size: 13px; }
.howto-body ul { margin: 0; padding-left: 18px; }
.howto-body li { margin-bottom: 4px; }

/* End summary table */
.end-summary { margin-top: 12px; width: 100%; font-size: 12px; border-collapse: collapse; }
.end-summary th, .end-summary td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.1); text-align: left; }

/* CTA toast accent */
.toast.war { border-left: 3px solid #e74c3c; }

@media (max-width: 900px) {
  .v6-rail { top: auto; bottom: 72px; flex-direction: row; width: auto; left: 8px; right: 8px; height: 48px; }
  .v6-panel { left: 8px; right: 8px; width: auto; top: 58px; bottom: 130px; }
}
