/* css/emerald-topbar.css — variant A «Светлый баланс»: ivory topbar + light news strip */

body:not(.crime-mode) #screen-game > .tb-header{
  background:linear-gradient(180deg,#fffdf5 0%,#faf0db 100%)!important;
  border:1px solid #b99a58!important;
  border-radius:12px;
  color:#172c23;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  padding:8px 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  flex-shrink:0;
  box-shadow:0 2px 8px rgba(146,120,58,.16);
}

/* icons */
body:not(.crime-mode) #screen-game > .tb-header .ico{
  width:18px;height:18px;flex-shrink:0;
  color:#9c7b34;
}
body:not(.crime-mode) #screen-game > .tb-header .ico *{fill:none;stroke:currentColor;}

/* ---- Row 1 ---- */
body:not(.crime-mode) #screen-game > .tb-header #top-row-1{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

body:not(.crime-mode) #screen-game > .tb-header .tb-identity{
  display:flex;
  flex-direction:row;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 12px;
  min-width:0;
  flex:1 1 430px;
}

/* company block: #empire-name-top then #game-day */
body:not(.crime-mode) #screen-game > .tb-header .tb-company{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  min-width:0;
  flex:0 1 auto;
  max-width:100%;
}

body:not(.crime-mode) #screen-game > .tb-header #empire-name-top{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  font-family:Georgia,"Times New Roman",serif;
  font-size:20px;
  font-weight:700;
  letter-spacing:.2px;
  color:#172c23;
  overflow-wrap:anywhere;
}
body:not(.crime-mode) #screen-game > .tb-header #empire-name-top-text{overflow-wrap:anywhere;min-width:0;color:#172c23;}
body:not(.crime-mode) #screen-game > .tb-header #empire-name-top .ico{flex:0 0 auto;color:#9c7b34;}
body:not(.crime-mode) #screen-game > .tb-header #empire-name-top-icon:empty{display:none;}

body:not(.crime-mode) #screen-game > .tb-header #game-day{
  color:#625138;
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:12px;
  min-width:0;
}

/* clock block: label + timer, gold left divider */
body:not(.crime-mode) #screen-game > .tb-header .tb-clock{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  min-width:0;
  padding-left:34px;
  position:relative;
  justify-content:center;
  min-height:44px;
  border-left:1px solid rgba(185,154,88,.55);
}
body:not(.crime-mode) #screen-game > .tb-header .tb-clock-label{
  font-size:11px;
  color:#625138;
  letter-spacing:.3px;
  white-space:nowrap;
}
body:not(.crime-mode) #screen-game > .tb-header #phase-timer{
  color:#172c23;
  font-weight:700;
  font-size:18px;
  line-height:1.1;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

/* speed button — EMERALD action, not gold */
body:not(.crime-mode) #screen-game > .tb-header #speed-day-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#17634e,#104f43);
  color:#ffffff;
  border:1px solid #b99a58;
  border-radius:7px;
  cursor:pointer;
  line-height:1;
  min-width:44px;
  min-height:44px;
  font:600 12px system-ui,sans-serif;
  gap:5px;
  padding:6px 10px;
}
body:not(.crime-mode) #screen-game > .tb-header #speed-day-btn:focus-visible{
  outline:3px solid #17634e;
  outline-offset:2px;
}

/* ---- Quick actions ---- */
body:not(.crime-mode) #screen-game > .tb-header .tb-quickactions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  flex-wrap:wrap;
  flex:0 1 auto;
  min-width:0;
}

body:not(.crime-mode) #screen-game > .tb-header .tb-qa{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  flex-direction:column;
  background:#fffdf5;
  border:1px solid rgba(185,154,88,.6);
  border-radius:8px;
  color:#2c2413;
  padding:4px 6px;
  min-height:44px;
  font-size:11px;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-qa .ico{color:#9c7b34;}
body:not(.crime-mode) #screen-game > .tb-header .tb-qa:hover{background:#faf0db;}
body:not(.crime-mode) #screen-game > .tb-header .tb-qa:focus-visible{
  outline:2px solid #946417;
  outline-offset:2px;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-qa-cap{white-space:nowrap;}

/* badges (status colors unchanged) */
body:not(.crime-mode) #screen-game > .tb-header .tb-badge{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:14px;
  height:14px;
  padding:0 3px;
  border-radius:999px;
  font-size:9px;
  font-weight:700;
  line-height:14px;
  text-align:center;
  color:#fff;
  background:#c0392b;
}
body:not(.crime-mode) #screen-game > .tb-header #ach-mini-badge{background:#d9a12f;}
body:not(.crime-mode) #screen-game > .tb-header #daily-mini-badge{background:#e07a1a;}

/* ---- Row 2 metrics ---- */
body:not(.crime-mode) #screen-game > .tb-header #top-row-2{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  border:0;
  border-top:1px solid #c5a45d;
  border-radius:0;
  overflow:hidden;
  background:transparent;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric{
  min-width:0;
  padding:5px 8px;
  text-align:center;
  border-left:1px solid rgba(185,154,88,.4);
}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric:first-child{border-left:none;}

body:not(.crime-mode) #screen-game > .tb-header .tb-metric-label{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:11px;
  text-transform:none;
  letter-spacing:0;
  color:#625138;
  white-space:normal;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric-label .ico{color:#9c7b34;}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric-value{
  font-family:Georgia,"Times New Roman",serif;
  font-size:20px!important;
  font-weight:700;
  color:#172c23;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric-sub{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  font-size:10px;
  color:#625138;
  margin-top:1px;
  overflow-wrap:anywhere;
}
body:not(.crime-mode) #screen-game > .tb-header .tb-metric:nth-child(2) .ico{color:#0d885e;}

/* ---- News strip ---- */
body:not(.crime-mode) #screen-game > #news-ticker{
  display:flex;
  align-items:center;
  gap:0!important;
  margin-top:4px;
  padding:0!important;
  flex-shrink:0;
  background:#fffdf5;
  border:1px solid #b99a58;
  border-radius:10px;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:hidden;
}

/* FIXED LEFT label — never inherits marquee, never animated */
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label{
  flex:0 0 auto;align-self:stretch;display:inline-flex;align-items:center;gap:8px;
  padding:6px 24px 6px 10px;margin:0;
  background:#b99a58;color:#ffffff;
  font:700 15px/1.25 Georgia,"Times New Roman",serif;white-space:nowrap;
  position:relative;isolation:isolate;z-index:1;
  clip-path:polygon(0 0,calc(100% - 15px) 0,100% 50%,calc(100% - 15px) 100%,0 100%);
  animation:none!important;
}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label::before{
  content:"";position:absolute;inset:2px 3px 2px 0;z-index:-1;
  background:linear-gradient(135deg,#17634e,#104f43);
  clip-path:polygon(0 0,calc(100% - 14px) 0,100% 50%,calc(100% - 14px) 100%,0 100%);
}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label .ico{
  width:20px;height:20px;flex-shrink:0;color:#e7d9a8;
}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label .ico *{stroke:currentColor;fill:none;}

body:not(.crime-mode) #screen-game > #news-ticker .tb-news-viewport{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  position:relative;
  padding:6px 10px 6px 14px;
}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-viewport:focus-visible{
  outline:2px solid #946417;
  outline-offset:-2px;
}

body:not(.crime-mode) #screen-game > #news-ticker #news-text{
  display:inline-flex;
  width:max-content;
  min-width:200%;
  white-space:nowrap;
  animation:tb-news-scroll var(--tb-news-duration,40s) linear infinite;
  will-change:transform;
}
body:not(.crime-mode) #screen-game > #news-ticker #news-text.tb-news-static{animation:none;min-width:0;width:auto;}

body:not(.crime-mode) #screen-game > #news-ticker .tb-news-item{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  padding-right:0;
  color:#2a2317;
  font-size:13px;
}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-sep{color:#9b762d;margin:0 22px;}
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-copy{display:inline-flex;align-items:center;flex:1 0 auto;padding-right:26px;}
body:not(.crime-mode) #screen-game > #news-ticker #news-text span{animation:none;}

body:not(.crime-mode) #screen-game > #news-ticker .tb-news-viewport:hover #news-text,
body:not(.crime-mode) #screen-game > #news-ticker .tb-news-viewport:focus-within #news-text{animation-play-state:paused;}

@keyframes tb-news-scroll{
  from{transform:translateX(0);}
  to{transform:translateX(-50%);}
}

@media (prefers-reduced-motion: reduce){
  body:not(.crime-mode) #screen-game > .tb-header *{animation:none!important;transition:none!important}
  body:not(.crime-mode) #screen-game > #news-ticker #news-text{animation:none!important;min-width:0;width:auto;}
  body:not(.crime-mode) #screen-game > #news-ticker .tb-news-copy[aria-hidden="true"]{display:none;}
  body:not(.crime-mode) #screen-game > #news-ticker .tb-news-viewport{overflow-x:auto;}
}

@media (max-width:1000px) and (min-width:651px){
  body:not(.crime-mode) #screen-game > .tb-header .tb-quickactions{flex-wrap:wrap;}
}

@media (max-width:1000px){
  body:not(.crime-mode) #screen-game > .tb-header .tb-quickactions{
    width:100%;
    display:grid;
    grid-template-columns:repeat(8,minmax(0,1fr));
    gap:5px;
  }
  body:not(.crime-mode) #screen-game > .tb-header .tb-qa{
    min-width:0;
    padding:5px 2px;
    font-size:11px;
  }
  body:not(.crime-mode) #screen-game > .tb-header .tb-qa-cap{white-space:normal;overflow-wrap:anywhere;}
}

@media (max-width:650px){
  body:not(.crime-mode) #screen-game > .tb-header .tb-quickactions{
    display:grid;
    grid-template-columns:repeat(8,minmax(0,1fr));
    gap:4px;
    width:100%;
  }
  body:not(.crime-mode) #screen-game > .tb-header .tb-qa{
    min-height:44px;
    min-width:0;
    padding:4px;
  }
  body:not(.crime-mode) #screen-game > .tb-header .tb-qa-cap{
    position:absolute;
    width:1px;height:1px;
    overflow:hidden;clip:rect(0 0 0 0);
    white-space:nowrap;border:0;
  }
}

@media (max-width:480px){
  body:not(.crime-mode) #screen-game > .tb-header{padding:6px 8px;}
  body:not(.crime-mode) #screen-game > .tb-header .tb-identity{flex-basis:100%;}
  body:not(.crime-mode) #screen-game > .tb-header #top-row-2{grid-template-columns:repeat(2,minmax(0,1fr));}
  body:not(.crime-mode) #screen-game > .tb-header .tb-metric{padding:5px;}
  body:not(.crime-mode) #screen-game > .tb-header .tb-metric:nth-child(odd){border-left:none;}
  body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label{font-size:12px;padding:6px 24px 6px 8px;gap:4px;}
  body:not(.crime-mode) #screen-game > #news-ticker .tb-news-label .ico{width:18px;height:18px;}
  body:not(.crime-mode) #screen-game > #news-ticker .tb-news-item{font-size:13px;}
}

@media (max-width:419px){
  body:not(.crime-mode) #screen-game > .tb-header .tb-quickactions{grid-template-columns:repeat(4,minmax(0,1fr));}
  body:not(.crime-mode) #screen-game > .tb-header .tb-qa-cap{
    position:static;width:auto;height:auto;overflow:visible;clip:auto;
    white-space:normal;font-size:10px;
  }
}

body:not(.crime-mode) #screen-game > .tb-header #speed-day-btn .ico{color:#fffdf0;}

body:not(.crime-mode) #screen-game > .tb-header .tb-clock-icon{position:absolute;left:8px;top:50%;transform:translateY(-50%);width:22px;height:22px;color:#a97922;}
