/*
 * STELLAR EMPIRE 0.5.7
 * Resource strip as a real image gallery: photo first, subdued live figures below.
 * The exact original resource-tile BUTTON and its data-action stay unchanged.
 * Only the permanently visible top strip is changed. Detailed popup layouts remain.
 */
@media (min-width:1361px){
  .game .resource-strip{
    --resource-strip-height:132px!important;
    height:132px!important;min-height:132px!important;
    max-height:132px!important;
  }
  .game .resource-rail{gap:7px!important;padding:3px 2px 4px!important}
}
@media (min-width:761px) and (max-width:1360px){
  .game .resource-strip{
    --resource-strip-height:178px!important;
    height:178px!important;min-height:178px!important;
    max-height:178px!important;
  }
  .game .resource-rail{gap:6px!important;padding:3px 2px 4px!important}
}
@media (min-width:761px){
  .game .resource-strip .resource-tile{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-end!important;
    gap:0!important;
    padding:0!important;
    min-height:0!important;
    overflow:hidden!important;
    text-align:center!important;
    background:linear-gradient(145deg,#0c1a30,#111e33)!important;
    border-color:color-mix(in srgb,var(--resource-color,#7adcec) 45%,#33435b)!important;
  }
}
/* The top portion shows the original supplied HD artwork, not text. */
.game .resource-strip .resource-tile>.resource-photo-background{
  display:block!important;
  position:absolute!important;
  top:0!important;right:0!important;
  bottom:auto!important;left:0!important;
  width:100%!important;
  height:calc(100% - 38px)!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
  background:radial-gradient(ellipse at center,#153454,#071429 90%);
  opacity:1!important;
  filter:brightness(1.07) saturate(1.07)!important;
  pointer-events:none!important;
  transition:filter .18s ease,transform .18s ease!important;
}
.game .resource-strip .resource-tile::after{
  content:none!important;
  display:none!important;
}
.game .resource-strip .resource-tile>.res-symbol{display:none!important}
.game .resource-strip .resource-tile>.res-data{
  box-sizing:border-box!important;
  z-index:2!important;
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  flex:0 0 38px!important;
  width:100%!important;
  min-height:38px!important;
  max-height:38px!important;
  margin-top:auto!important;
  padding:2px 3px 3px!important;
  background:linear-gradient(180deg,#0a1830f8,#091426fc)!important;
  border-top:1px solid color-mix(in srgb,var(--resource-color,#7adcec) 35%,transparent)!important;
  text-align:center!important;
  text-shadow:none!important;
  overflow:hidden!important;
}
.game .resource-strip .resource-tile .res-name{
  display:block!important;
  width:100%!important;
  font-size:9px!important;
  line-height:10px!important;
  font-weight:620!important;
  color:#adc1d8!important;
  letter-spacing:0!important;
  text-align:center!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.game .resource-strip .resource-tile .res-amount{
  display:block!important;
  width:100%!important;
  font-size:12px!important;
  font-weight:810!important;
  line-height:15px!important;
  color:#eef5ff!important;
  text-align:center!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}
.game .resource-strip .resource-tile .res-rate{
  display:block!important;
  width:100%!important;
  font-size:9px!important;
  font-weight:700!important;
  line-height:10px!important;
  text-align:center!important;
  white-space:nowrap!important;
  letter-spacing:0!important;
}
.game .resource-strip .resource-tile:hover,
.game .resource-strip .resource-tile:focus-visible{
  border-color:var(--resource-color,#85dffc)!important;
  box-shadow:0 0 19px color-mix(in srgb,var(--resource-color,#76ddec) 27%,transparent)!important;
}
.game .resource-strip .resource-tile:hover>.resource-photo-background,
.game .resource-strip .resource-tile:focus-visible>.resource-photo-background{
  filter:brightness(1.15) saturate(1.16)!important;
}
.game .resource-strip .resource-tile:hover{transform:translateY(-1px)!important}
/* Hover / keyboard-focus zoom is outside the resource strip, so it cannot be clipped. */
.resource-hover-showcase{
  --resource-accent:#8ee5f5;
  position:fixed;
  display:none;
  box-sizing:border-box;
  width:min(360px,calc(100vw - 20px));
  max-height:min(300px,calc(100dvh - 24px));
  overflow:hidden;
  z-index:12000;
  border:1px solid var(--resource-accent);
  border-radius:13px;
  background:#071526;
  box-shadow:0 12px 40px #000d,0 0 25px #265c8a69;
  pointer-events:none;
  color:#ecf5ff;
}
.resource-hover-showcase.is-visible{display:block}
.resource-hover-showcase img{
  display:block;
  width:100%;height:auto;
  aspect-ratio:1100/619;
  object-fit:contain;
  background:#081426;
}
.resource-hover-showcase .resource-hover-data{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding:9px 12px 10px;
  background:linear-gradient(100deg,#111e37,#091629);
}
.resource-hover-showcase .resource-hover-data>div{
  display:flex;flex-direction:column;gap:3px;
  min-width:0;
}
.resource-hover-showcase strong{font-size:13px;font-weight:850}
.resource-hover-showcase small{font-size:10px;color:#92b8d3}
.resource-hover-showcase .resource-hover-number{
  font-size:17px;font-weight:800;white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.resource-hover-showcase .resource-hover-rate{
  font-size:11px;color:#87fbb4;font-weight:750;white-space:nowrap;
}
.resource-hover-showcase .resource-hover-rate.is-negative{color:#ff9caa}
.resource-hover-showcase .resource-hover-rate.is-neutral{color:#abbcd4}
/* At phone sizes keep the existing accessible 5x2 arrangement; use a smaller
 * separate photo area + compact numbers, without drawing captions across art.
 */
@media (max-width:760px){
  .game .resource-strip{
    --resource-strip-height:157px!important;
    height:157px!important;
    min-height:157px!important;
    max-height:157px!important;
    flex-basis:157px!important;
  }
  .game .resource-strip .resource-tile{
    padding:0!important;
    justify-content:flex-end!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:0!important;
    background:#091629!important;
  }
  .game .resource-strip .resource-tile>.resource-photo-background{
    height:calc(100% - 29px)!important;
    object-fit:cover!important;
    object-position:center!important;
  }
  .game .resource-strip .resource-tile>.res-data{
    flex:0 0 29px!important;
    min-height:29px!important;
    max-height:29px!important;
    padding:1px 0 2px!important;
  }
  .game .resource-strip .resource-tile .res-name{
    font-size:clamp(7px,2.1vw,8px)!important;
    line-height:8px!important;
  }
  .game .resource-strip .resource-tile .res-amount{
    font-size:clamp(8px,2.45vw,10px)!important;
    line-height:11px!important;
  }
  .game .resource-strip .resource-tile .res-rate{
    font-size:clamp(7px,1.96vw,8px)!important;
    line-height:8px!important;
  }
  .resource-hover-showcase{display:none!important}
}
@media(max-width:760px) and (max-height:700px){
  .game .resource-strip{
    --resource-strip-height:137px!important;
    height:137px!important;
    min-height:137px!important;
    max-height:137px!important;
    flex-basis:137px!important;
  }
}
@media(max-width:760px) and (max-height:530px){
  .game .resource-strip{
    --resource-strip-height:116px!important;
    height:116px!important;
    min-height:116px!important;
    max-height:116px!important;
    flex-basis:116px!important;
  }
  .game .resource-strip .resource-tile>.res-data{
    flex-basis:25px!important;min-height:25px!important;max-height:25px!important;
  }
  .game .resource-strip .resource-tile>.resource-photo-background{
    height:calc(100% - 25px)!important;
  }
}
@media (hover:none), (pointer:coarse){
  .resource-hover-showcase{display:none!important}
}
