/* =========================
   SCOREBOARD — STRUCTURED CSS
   ========================= */

/* ---------- 0) FONTS ---------- */
@font-face {
    font-family: 'es_buildregular';
    src: url('/assets/fonts/es_build-webfont.woff2') format('woff2'),
         url('/assets/fonts/es_build-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'es_buildmedium';
    src: url('/assets/fonts/es_build_medium-webfont.woff2') format('woff2'),
         url('/assets/fonts/es_build_medium-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}


body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "es_buildmedium", "es_buildregular", "itc-avant-garde-gothic-pro", 'Open Sans', sans-serif; /* Use Open Sans font */
    font-weight: 300;
    letter-spacing: 0.03em;
    font-size: 14.5px;
    font-style: normal;
}

.stripes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    z-index: 0;
}

.stripe {
    width: calc(100% / 14); /* Now divides the width into 14 equal parts */
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stripe:nth-child(1) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient1 10s linear infinite;
}

.stripe:nth-child(2) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient2 11s linear infinite;
}

.stripe:nth-child(3) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient3 12s linear infinite;
}

.stripe:nth-child(4) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient4 13s linear infinite;
}

.stripe:nth-child(5) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient5 14s linear infinite;
}

.stripe:nth-child(6) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient6 15s linear infinite;
}

.stripe:nth-child(7) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient7 16s linear infinite;
}

.stripe:nth-child(8) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient8 17s linear infinite;
}

.stripe:nth-child(9) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient9 18s linear infinite;
}

.stripe:nth-child(10) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient10 19s linear infinite;
}

.stripe:nth-child(11) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient11 20s linear infinite;
}

.stripe:nth-child(12) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient12 21s linear infinite;
}

.stripe:nth-child(13) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient13 22s linear infinite;
}

.stripe:nth-child(14) {
    background: linear-gradient(to bottom, #3F1C72, #1A0E35, #3F1C72);
    background-size: 100% 300%;
    animation: moveGradient14 23s linear infinite;
}

@keyframes moveGradient1 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient1 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient2 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient3 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient4 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient5 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient6 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient7 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient8 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient9 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient10 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient11 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient12 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient13 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

@keyframes moveGradient14 {
    0% {
        background-position: 0% -200%;
    }
    100% {
        background-position: 0% 100%;
    }
}

/* ---------- 1) ROOT VARIABLES ---------- */
:root {
  /* Canvas */
  --sb-width:            1360px;
  --sb-width-collapsed:  1050px;        /* 20 + 500 + 10 + 500 + 20 */
  --sb-height:           655px;
  --sb-padding:          20px;
  --sb-radius:           10px;
  --sb-bg:               transparent;

  /* Grid */
  --grid-gap:            10px;
  --col-left-w:          500px;
  --col-right-w:         500px;
  --col-info-w:          300px;
  --row-content-h:       515px;
  --row-footer-h:        90px;
  --row-footer-h-compact:40px;

  /* One-column presentation (unified) */
  --onecol-content-w:    1010px;  /* 500 + 10 + 500 */
  --onecol-stack-w:      500px;   /* visual rail width inside left */

  /* Status bar (when info collapsed) */
  --status-bar-h:        40px;
  --status-font-size:    30px;

  /* Row lane + typography */
  --row-h:               28px;
  --row-gap:             4px;
  --lane-badge:          28px;
  --lane-gap:            0px;
  --font-family:         "es_buildmedium","es_buildregular","itc-avant-garde-gothic-pro",'Open Sans',system-ui,sans-serif;
  --base-font-size:      14.5px;
  --letter-spacing:      0.03em;
  --text:                #ffffff;

  /* Gradients / states */
  --row-grad:            linear-gradient(to left, #C03BB4 0%, #4B1E84 15%);
  --row-grad-locked:     linear-gradient(to left, #771572 0%, #260D4F 15%);
  --row-grad-highlight:  linear-gradient(to left, #C03BB4 0%, #4B1E84 15%);
  --row-grad-gold:       linear-gradient(to left, #C03BB4 0%, #4B1E84 15%);

  /* Placement badge */
  --place-bg:            linear-gradient(to right, #C03BB4 30%, #4B1E84 100%);
  --place-fg:            #ffffff;

  /* Overlay / effects */
  --overlay-fg:          #ffffff;
  --overlay-shadow:      0 0 10px rgba(0,0,0,.5);
  --anim-gradient-1:     linear-gradient(to right, #f04be6, #01A6C4, #f04be6, #f04be6);
  --anim-gradient-2:     linear-gradient(to right, #f04be6, #f5dc15, #eb2550, #eb2550, #0dd6d3, #f04be6, #f04be6);

  /* Points cells */
  --points-right-pad:    15px;
  --current-points-right:55px;
  --current-points-w:    40px;
  --current-points-bg:   linear-gradient(to left, #4B1E84 0%, #20A1C2 50%, #4B1E84 100%);

  /* Panel (drag box) */
  --panel-bg:            rgba(0,0,0,.35);
  --panel-radius:        10px;

  /* Transitions */
  --t-fast:              .2s ease;
  --t-med:               .25s ease;
  --t-slow:              1.5s ease;

  /* Z index */
  --z-panel:             50;
  --z-row:               2;
  --z-overlay:           20;

}

/* ---------- 2) BASE / RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  font: 300 var(--base-font-size)/1.3 var(--font-family);
  letter-spacing: var(--letter-spacing);
  color: var(--text);
  background: transparent;
}

#backgroundVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; 
    min-height: 100%;
    object-fit: cover;
}

/* ---------- 3) SCOREBOARD WRAPPER ---------- */
.scoreboard{
  width: var(--sb-width);
  height: var(--sb-height);
  padding: var(--sb-padding);
  background: var(--sb-bg);
  border-radius: var(--sb-radius);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* columns vs footer */
  align-items: center;
  position: relative;
  z-index: 1;
  transition: width var(--t-med);
}

/* With info collapsed, the canvas becomes narrower */
.scoreboard.info-collapsed{
  width: var(--sb-width-collapsed) !important;
}

/* ---------- 4) GRID LAYOUT ---------- */
#grid{
  display: grid;
  gap: var(--grid-gap);
  width: 100%;
  height: 100%;
  grid-template-columns: var(--col-left-w) var(--col-right-w) var(--col-info-w);
  grid-template-rows: var(--row-content-h) var(--row-footer-h);
  grid-template-areas:
    "left  right info"
    "footer footer info";
}

/* one-col unified layout (keep info column visible on the right) */
#grid.onecol{
  grid-template-columns: var(--onecol-content-w) var(--col-info-w);
  grid-template-rows: var(--row-content-h) var(--row-footer-h);
  grid-template-areas:
    "left   info"
    "footer info";
}

/* info collapsed (2-col) — put status on top, footer compact */
#grid.info-collapsed{
  grid-template-columns: var(--col-left-w) var(--col-right-w);
  grid-template-rows: var(--status-bar-h) var(--row-content-h) var(--row-footer-h-compact);
  grid-template-areas:
    "status status"
    "left   right"
    "footer footer";
}

/* info collapsed + 1-col (unified) */
#grid.onecol.info-collapsed{
  grid-template-columns: var(--onecol-content-w);
  grid-template-rows: var(--status-bar-h) var(--row-content-h) var(--row-footer-h-compact);
  grid-template-areas:
    "status"
    "left"
    "footer";
}

/* Region mapping */
#col-left   { grid-area: left;   }
#col-right  { grid-area: right;  }
#col-info   { grid-area: info;   }
#col-footer { grid-area: footer; }

/* Collapsed info is removed from layout */
#col-info.is-collapsed { display: none; }

/* ---------- 5) PANELS / COLUMNS ---------- */
.column, .panel { width: 100%; height: 100%; }

#col-left, #col-right {
  display: flex; flex-direction: column; justify-content: flex-start;
}

.column{
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.column .stack{
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
  will-change: transform;
}

/* In 1-col mode, disable any translate centering done in JS for safety */
#grid.onecol .stack { transform: none !important; }

/* One-col: center the narrow rail inside the content area */
#grid.onecol #col-left{
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}
#grid.onecol #col-left .stack{ width: var(--onecol-stack-w); }

/* ---------- 6) CONTROL PANEL (DRAGGABLE) ---------- */
.sb-panel{
  position: absolute; right: 18px; top: 18px; z-index: var(--z-panel);
  display: flex; gap: 8px; padding: 8px 10px;
  background: var(--panel-bg); border-radius: var(--panel-radius);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  user-select: none; cursor: grab;
}
.sb-panel:active{ cursor: grabbing; }
.sb-panel button{
  border: 0; padding: 6px 8px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.sb-panel[data-visible="0"]{ display: none; }
/*.sb-panel .is-muted{ opacity: .6; }*/
.sb-panel .is-auto{ background: rgba(255,255,255,.15); }

/* pressed look – adapt to your theme */
.sb-panel [data-act][data-on="1"],
.sb-panel [data-act].is-on,
.sb-panel [data-act][aria-pressed="true"] {
  transform: translateY(1px);
  filter: brightness(0.6);
  /*outline: 2px solid var(--accent, #00b3ff);*/
}

/* ---------- 7) STATUS BAR / INFO ---------- */
.voting-status {
  font-size: var(--status-font-size);
  margin-bottom: 5px;
  color: var(--text);
  text-transform: uppercase;
  font-weight: 300;
}
/* When elevated into grid top row */
#grid > .voting-status.status-bar{
  grid-area: status;
  width: 100%;
  height: var(--status-bar-h);
  display: flex;
  align-items: center;
  padding-inline: 12px;
  box-sizing: border-box;
}

/* Info column contents (expanded) */
#col-info .spokesperson  { width: var(--col-info-w); height: 435px; background: rgba(255,255,255,.2); border-radius: 10px; }
#col-info .voting-status { width: var(--col-info-w); height: 170px; }

/* ---------- 8) ROWS / CELLS ---------- */
.row-wrap{
  display: flex;
  align-items: center;
}

.placements {
  height: var(--lane-badge);
  width:  var(--lane-badge);
  margin-right: var(--lane-gap);
  display: none; /* JS flips to flex when needed */
  align-items: center; justify-content: center;
  font-weight: 700;
  background: var(--place-bg);
  color: var(--place-fg);
  user-select: none;
}

/* Keep country row shrinking next to placements */
.row-wrap .country-container { flex: 1 1 auto; }

.country-container{
  width: 100%;
  height: var(--row-h);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--row-grad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--t-slow);
  position: relative;
  color: var(--text);
  z-index: var(--z-row);
  overflow: hidden;
}

.country-container.locked    { background: var(--row-grad-locked);   }
.country-container.highlight { background: var(--row-grad-highlight); }
.country-container.gold      { background: var(--row-grad-gold);      }

.country-name,
.country-code{
  flex: 1;
  text-align: left;
  color: var(--text);
  padding-left: 10px;
  /*padding-top: 3px;*/
  /*padding-bottom: 0;*/
  text-transform: uppercase;
  height: var(--row-h);
  line-height: var(--row-h);
  align-items: center;
  z-index: 3;
}
.country-code{ display:none; } /* JS toggles with name on small screens */

.country-flag{
  height: var(--row-h);
  width: auto;
  margin-right: 1px;
  z-index: 3;
}

.country-points{
  text-align: right;
  color: var(--text);
  padding-left: 10px;          /* spacing for current-points rail */
  white-space: nowrap;
  position: absolute;
  right: var(--points-right-pad);
  height: var(--row-h);
  line-height: var(--row-h);
  align-items: center;
  z-index: 3;
}

.current-points{
  position: absolute;
  height: var(--row-h);
  width: var(--current-points-w);
  display: flex; justify-content: center; align-items: center;
  right: var(--current-points-right);
  background: var(--current-points-bg);
  font-size: 1em; color: var(--text);
  line-height: var(--row-h);
  z-index: 3;
}

/* ---------- 9) FOOTER ---------- */
#col-footer      { height: var(--row-footer-h); display:flex; align-items:center; justify-content:center; }
#col-footer.compact { height: var(--row-footer-h-compact); }

.footer{
  font-size: 12px;
  text-align: center;
  color: var(--text);
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- 10) EFFECTS / ANIMATIONS ---------- */
@keyframes gradientShift {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.country-container.highlight.animated-gradient{
  background: var(--anim-gradient-1);
  background-size: 500% 500%;
  animation: gradientShift 1.5s ease-in-out;
}

.country-container.animatedo-gradient{
  background: var(--anim-gradient-2);
  background-size: 500% 500%;
  animation: gradientShift 2s ease-in-out;
  z-index: 10;
}

.points-overlay{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-weight: 600;
  color: var(--overlay-fg);
  text-shadow: var(--overlay-shadow);
  z-index: var(--z-overlay);
  pointer-events: none;
  animation: slideUp .7s ease-in-out forwards;
}
@keyframes slideUp{
  0%   { transform: translate(-50%,150%); opacity: 0; }
  50%  { opacity: .5; }
  100% { transform: translate(-50%,-50%); opacity: 1; }
}

/* dim-out for animation mode 3 */
.dimmed{ opacity:.25; filter: grayscale(.6); }

/* blink for animation mode 4 (two blinks) */
.blink-twice{ animation: sb-blink .22s ease-in-out 2; }
@keyframes sb-blink{
  0%{opacity:1} 50%{opacity:0} 100%{opacity:1}
}
