/* =========================
   SCOREBOARD — STRUCTURED CSS
   ========================= */

/* ---------- 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:           50px;
  --sb-bg:               rgba(6, 2, 69, 0.6);

  /* Grid */
  --grid-gap:            10px;
  --col-left-w:          500px;
  --col-right-w:         500px;
  --col-info-w:          300px;
  --row-content-h:       565px;
  --row-footer-h:        40px;
  --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:            4px;
  --font-family:         "neulis-sans", "es_buildmedium", 'Interstate', "arial", "myriad-pro", 'Gotham', 'Open Sans', sans-serif;
  --base-font-size:      14.5px;
  --letter-spacing:      0.03em;
  --text:                #D6EFFF;
  --country-name:        #D6EFFF;
  --country-name-locked: #D6EFFF;
  --country-points:      #D6EFFF;
  --country-points-locked: #D6EFFF;
  --country-points-bg: transparent;
  --country-points-bg-locked: transparent;

  /* Gradients / states */
  --row-grad:            linear-gradient(10deg, #16142a, #16142a, #73263a);
  --row-grad-locked:     linear-gradient(to left, #ae3a04 0%, #ae3a04 15%, #ae3a04 30%);
  --row-grad-highlight:  linear-gradient(10deg, #16142a, #16142a, #73263a);
  --row-grad-gold:       linear-gradient(10deg, #73263a, #73263a, #16142a);

  /* Placement badge */
  --place-bg:            transparent;
  --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, #16142a, #61927b, #16142a, #73263a, #16142a);
  --anim-gradient-2:     linear-gradient(to right, #16142a, #61927b, #f5dc15, #f5dc15, #61927b, #16142a, #16142a);

  /* Points cells */
  --points-right-pad:    15px;
  --current-points-right:70px;
  --current-points:     #D6EFFF;
  --current-points-w:    28px;
  --current-points-bg:   linear-gradient(to left, #61927b 0%, #61927b 50%, #61927b 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);
  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;
}
/*
.scoreboard, .column, .voting-status, .footer {
    background: #ffffff22;
} */

/* ---------- 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;
}

.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: 8px 10px; border-radius: 8px; 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: 700;
}
/* 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;
  padding-left: 10px;
}

.placements {
  height: var(--lane-badge);
  width:  var(--lane-badge);
  margin-right: 14px;
  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;
  font-size: 1.2em;
}

/* Keep country row shrinking next to placements */
.row-wrap .country-container { flex: 1 1 auto; }

.country-container {
    width: calc(100%-30px); /* Full width in each column */
    height: 28px;
    padding: 0px; /* Reduced padding for a tighter fit */
    border-radius: 14px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between; /* Align items horizontally */
    align-items: center;
    cursor: pointer;
    transition: background-color 1.5s ease; 
    position: relative;
    color: #ffffff; /* Dark text */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    margin-bottom: 4px;
    z-index: 2;
}

.country-container.standby,
.country-container.selected,
.country-container.highlight,
.country-container.gold,
.country-container.locked {
    transition: background-color 1.5s ease; /* Smooth background-color transition for all states */
}

.country-container.selected {
    background-color: rgba(45, 120, 176, 0.8); /* Slightly darker for selected */
}

.country-container.highlight {
  background: linear-gradient(to left, #b80076 0%, #f920ae 10%, #ffffff 22%);
}

.country-container.gold {
  background: linear-gradient(to left, #00b0cc 0%, #46eefa 10%, #ffffff 22%);
}

.country-container.locked {
    /* background-color: #001C3A; */
    cursor: not-allowed; /* Indicate that it's not clickable */
    opacity: 0.7;
}

.country-name {
    flex: 1;
    text-align: left; /* Align country names to the left */
    color: #010535; 
    padding-left: 7px; /* Padding to give space from the left edge */
    /* padding-top: 3px; */
    padding-bottom: 0px;
    z-index: 3;
    line-height: 28px;
    text-transform: uppercase;
    font-size: 1.2em;
    font-weight: 700;
}

.country-name.gold {
    /* background: linear-gradient(to left, #EBD317 0%, #DC40C4 15%); */
    color: #010535;
}

.country-code {
    flex: 1;
    text-align: left; /* Align country names to the left */
    color: #010535; /* Dark text */
    padding-left: 10px; /* Padding to give space from the left edge */
    /* padding-top: 3px; */
    padding-bottom: 0px;
    text-transform: uppercase;
    z-index: 3;
    line-height: 28px;
    font-size: 1.2em;
    font-weight: 700;
}

.country-code.gold {
    /* background: linear-gradient(to left, #EBD317 0%, #DC40C4 15%); */
    color: #010535;
}

.flag-wrap {
  position: relative;
  display: inline-block;
  height: 38px;
  width: 38px;
  margin-right: 0px;
  margin-left: -8px;
}

/* the ring */
.flag-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center/contain no-repeat url('../themes/svg/2026.svg');
  pointer-events: none;
}

.country-flag {
height: 40px;              /* as requested */
  aspect-ratio: 1;           /* heart looks best in a square box */
  object-fit: cover;
  margin-top: -1px;
  margin-left: -1px;
  top: 5px;

  /* heart mask */
  -webkit-clip-path: polygon(41.2% 33.3%, 41.3% 33.7%, 41.5% 34.0%, 41.7% 34.2%, 42.0% 34.4%, 42.3% 34.5%, 42.6% 34.5%, 42.9% 34.5%, 43.2% 34.4%, 43.5% 34.2%, 43.7% 34.0%, 43.9% 33.7%, 44.1% 33.3%, 46.3% 27.7%, 49.3% 23.1%, 52.9% 19.4%, 57.0% 16.6%, 61.4% 14.8%, 65.8% 14.0%, 70.1% 14.2%, 74.0% 15.4%, 77.4% 17.7%, 80.0% 21.0%, 81.8% 25.4%, 82.4% 31.0%, 81.7% 35.8%, 79.8% 40.7%, 76.8% 45.6%, 73.2% 50.5%, 69.0% 55.4%, 64.5% 60.4%, 59.9% 65.3%, 55.6% 70.1%, 51.6% 74.9%, 48.3% 79.7%, 45.9% 84.4%, 44.6% 89.0%, 42.6% 86.1%, 40.1% 83.3%, 37.2% 80.6%, 34.0% 77.9%, 30.7% 75.0%, 27.3% 72.0%, 24.1% 68.6%, 21.1% 64.9%, 18.6% 60.7%, 16.6% 55.9%, 15.3% 50.5%, 14.8% 44.4%, 15.3% 39.2%, 16.5% 34.8%, 18.4% 31.1%, 20.8% 28.2%, 23.5% 26.0%, 26.5% 24.7%, 29.5% 24.1%, 32.5% 24.3%, 35.3% 25.3%, 37.8% 27.2%, 39.8% 29.8%);
  clip-path: polygon(41.2% 33.3%, 41.3% 33.7%, 41.5% 34.0%, 41.7% 34.2%, 42.0% 34.4%, 42.3% 34.5%, 42.6% 34.5%, 42.9% 34.5%, 43.2% 34.4%, 43.5% 34.2%, 43.7% 34.0%, 43.9% 33.7%, 44.1% 33.3%, 46.3% 27.7%, 49.3% 23.1%, 52.9% 19.4%, 57.0% 16.6%, 61.4% 14.8%, 65.8% 14.0%, 70.1% 14.2%, 74.0% 15.4%, 77.4% 17.7%, 80.0% 21.0%, 81.8% 25.4%, 82.4% 31.0%, 81.7% 35.8%, 79.8% 40.7%, 76.8% 45.6%, 73.2% 50.5%, 69.0% 55.4%, 64.5% 60.4%, 59.9% 65.3%, 55.6% 70.1%, 51.6% 74.9%, 48.3% 79.7%, 45.9% 84.4%, 44.6% 89.0%, 42.6% 86.1%, 40.1% 83.3%, 37.2% 80.6%, 34.0% 77.9%, 30.7% 75.0%, 27.3% 72.0%, 24.1% 68.6%, 21.1% 64.9%, 18.6% 60.7%, 16.6% 55.9%, 15.3% 50.5%, 14.8% 44.4%, 15.3% 39.2%, 16.5% 34.8%, 18.4% 31.1%, 20.8% 28.2%, 23.5% 26.0%, 26.5% 24.7%, 29.5% 24.1%, 32.5% 24.3%, 35.3% 25.3%, 37.8% 27.2%, 39.8% 29.8%);
text-shadow: 0px 5px 6px rgba(0, 0, 0, 0.5),
    2px -3px 3px rgba(255, 255, 255, 0.8);
}

.country-points {
    text-align: right; /* Align overall points to the right */
    color: #010535; /* Dark text */
    padding-left: 10px; /* Padding to give space for current points box */
    white-space: nowrap; /* Prevent text from wrapping */
    position: absolute;
    right: 15px; /* 10px from the right edge */
    /* top: 8px; */
    z-index: 3;
    font-size: 1.2em;
    line-height: 28px;
    font-weight: 700;
}

.country-points.highlight {
  color: #ffffff;
}
.country-points.gold {
  color: #010535;
}

.current-points {
    position: absolute;
    height: 24px;
    width: 32px;
    display: flex;
    border-radius: 12px;
    justify-content: center;
    align-items: center;
    right: 65px;
    background-color: #010535; 
    /* background-color: rgba(6, 6, 6, 0.6); /* Darker background with 0.5 transparency */
    /* padding: 3px 3px 0px 3px; */
    font-size: 1em;
    color: #32eaf8; /* text */
    /* display: none; */
    z-index: 3;
    font-weight: 600;
    line-height: 28px;
}

.current-points.gold {
    background-color: #f920ae; 
    color: #010535;
        font-weight: 700;
}

/* ---------- 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%;  /* Start from the left */
    }
    100% {
        background-position: 0% 50%;  /* End on the right */
    }
}

.country-container.highlight.animated-gradient {
    background: linear-gradient(to right, #00b0cc, #ca0080, #04d0ea, #fd30b6, #ffffff);
    background-size: 500% 500%;  /* Ensure the gradient is wide enough to animate */
    animation: gradientShift 1.5s ease-in-out; /* Animate over 2 seconds */
} 

.country-container.animatedo-gradient {
    background: linear-gradient(to right, #00b0cc, #ca0080, #04d0ea, #fd30b6, #ffffff);
    background-size: 500% 500%;  /* Ensure the gradient is wide enough to animate */
    animation: gradientShift 2s ease-in-out; /* Animate over 2 seconds */
    z-index: 10;
}

.points-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #ffffff;
    z-index: 20; /* Ensure it is on top */
    pointer-events: none; /* Make sure the overlay doesn't interfere with clicks */

    /* Animation to make the text appear from the bottom */
    animation: slideUp 0.7s ease-in-out forwards; /* Run the slide up animation */
}

@keyframes slideUp {
    0% {
        transform: translate(-50%, 50%);
        opacity: 0;    /* Fully transparent at the beginning */
    }
    50% {
        opacity: 0.5;    /* Become fully visible halfway through the animation */
    }
    100% {
        transform: translate(-50%, -50%);
        opacity: 1;    /* Fully visible at the end */
    }
}


/* 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}
}


@media (max-width: 800px){
  .current-points {
    right: 45px;
  }
  :root{
    --grid-gap: 12px; 
  }
  .country-container.highlight {
    background: linear-gradient(to left, #b80076 0%, #f920ae 20%, #ffffff 32%);
  }
  .country-container.gold {
    background: linear-gradient(to left, #00b0cc 0%, #46eefa 20%, #ffffff 32%);
  }
}

