@import url('assets/demo-common.css');

/* World Cup 2026 backdrop behind the (transparent) avatar canvas */
body {
  background: #0b1e3f url('assets/worldcup-bg.svg') center center / cover no-repeat fixed !important;
  padding: 0 !important;
}
#renderCanvas { background: transparent !important; }
#mainScreen { background: transparent !important; }


/* ===== World Cup composer (text entry) ===== */
#uiPanel.panel {
  position: fixed;
  left: 50%;
  bottom: 4vh;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  max-width: 560px;
  z-index: 20;
}

#composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  background: rgba(22, 29, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

#speechText {
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 15, 20, 0.7);
  color: #fff;
  font-family: 'Amazon Ember', 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
#speechText::placeholder { color: rgba(255, 255, 255, 0.45); }
#speechText:focus {
  border-color: #FF9900;
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.28);
}

#composerActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#composerHint {
  flex: 1;
  margin: 0;
  font: 400 13px/1.35 'Amazon Ember','Roboto',sans-serif;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

#start-button.iconButton {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}
#start-button.iconButton:hover { background: rgba(255, 255, 255, 0.16); }
#start-button.iconButton:active { transform: scale(0.96); }

/* Connection state feedback */
#start-button.iconButton.connecting {
  background: rgba(255, 153, 0, 0.25);
  animation: pulse 1.2s ease-in-out infinite;
}
#start-button.iconButton.active {
  background: rgba(43, 181, 52, 0.35);
  box-shadow: 0 0 0 3px rgba(43, 181, 52, 0.4);
}
#start-button.iconButton.muted {
  background: rgba(219, 0, 0, 0.3);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
#start-button.iconButton.recording {
  background: #d4001a;
  border-color: #ff6b80;
  animation: 0.7s pulsingButton infinite alternate;
}

#speakButton.primaryButton {
  flex: 1 1 auto;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: #FF9900;
  color: #16191F;
  font-family: 'Amazon Ember', 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}
#speakButton.primaryButton:hover { background: #ffad33; }
#speakButton.primaryButton:active { transform: scale(0.99); }
#speakButton.primaryButton:disabled { background: #6b5a37; color: #ffffff88; cursor: default; }

#intro-transcription {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.form-control-input {
  background-color: #202020cc;
  width: 95%;
  border-radius: 4px;
  backdrop-filter: saturate(120%);
  transition: 0.22s;
  font-weight: bold;
  font-size: 85%;
  border: 1px solid transparent;
  box-shadow: 0 0 14px 0px #00000077;
  margin-bottom: 1em;
  color: white;
}

.modal.screen {
  position: absolute;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

/* #uiPanel sizing handled by #uiPanel.panel (composer) above */

#userMessageContainer {
  position: absolute;
  bottom: 24px;
  right: 24px;
  left: auto;
  transform: none;
  width: auto;
  max-width: min(420px, 60vw);
  max-height: 30vh;
  overflow-y: auto;
  display: none; /* Default to non-visible */
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#userMessageContainer.processing, #userMessageContainer.showingMessage {
  display: flex;
}

#userMessageContainer.processing .message {
  display: none;
}

#userMessageContainer.processing #processingMessage {
  display: block;
}

#userMessageContainer #processingMessage {
  display: none;
}

#userMessageContainer .label {
  margin-right: 0.5em;
}

#transcriptText {
  font-family: 'Amazon Ember','Roboto Serif', serif;
  font-style: normal;
  font-weight: 400;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #fff;
  background: rgba(11, 15, 20, 0.55);
  padding: 10px 16px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#talkButton:active {
  animation: 0.6s pulsingButton infinite alternate;
}

#processingMessage p {
  padding: 0;
  margin: 0;
  color: #ffffff88;
}

@keyframes pulsingButton {
  0% {
    background-color: rgb(182, 62, 82);
    border: 1px solid #ffffff44;
  }

  100% {
    background-color: rgb(212, 84, 105);
    border: 1px solid #ffffffcc;
  }
}

/* Reglas de consultas de medios */
@media (max-width: 768px) {
  /* Estilos para pantallas pequeñas */
  #uiPanel {
    max-width: 90vw;
    max-height: 90vh;
  }
  
  button {
    font-size: 4vw;
  }
  
  textarea {
    font-size: 3.5vw;
  }

  #userMessageContainer{
    display: none;
  }
}

@media (max-width: 480px) {
  /* Estilos para pantallas muy pequeñas */
  #uiPanel {
    max-width: 92vw;
  }
  
  button {
    font-size: 2vw;
  }
  
  textarea {
    font-size: 2vw;
  }

  #userMessageContainer{
    display: none;
  }
}

/* ===== Sky-style World Cup results overlay ===== */
.wc-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.wc-overlay.wc-hidden { display: none; }

.wc-ticker {
  position: fixed; top: 0; left: 0; right: 0; height: 40px;
  display: flex; align-items: center; overflow: hidden;
  background: rgba(11, 15, 20, 0.82); border-bottom: 2px solid #FF9900;
  backdrop-filter: blur(6px); pointer-events: auto;
}
.wc-ticker-flag {
  flex: 0 0 auto; height: 100%; display: flex; align-items: center; padding: 0 14px;
  background: #FF9900; color: #16191F;
  font: 700 13px/1 'Amazon Ember','Roboto',sans-serif; letter-spacing: 2px;
  position: relative; z-index: 2;
}
.wc-ticker-track {
  white-space: nowrap; will-change: transform; display: inline-block;
  animation: wc-scroll 40s linear infinite;
  color: #fff; font: 600 14px/40px 'Amazon Ember','Roboto',sans-serif;
}
.wc-tick { padding: 2px 6px; cursor: pointer; border-radius: 6px; transition: background 0.15s ease; pointer-events: auto; }
.wc-tick:hover { background: rgba(255, 153, 0, 0.22); }
.wc-tick-active { background: rgba(255, 153, 0, 0.5); }
/* Pause the scroll while hovering the ticker so a result is easy to click. */
.wc-ticker:hover .wc-ticker-track { animation-play-state: paused; }
.wc-tick b { color: #ffd27a; }
.wc-dot { color: #FF9900; padding: 0 10px; }
@keyframes wc-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.wc-stats {
  position: fixed; left: 2vw; top: 16vh; width: 300px; max-height: 52vh; overflow: hidden;
  background: rgba(22, 29, 38, 0.82); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px); padding: 12px 14px; color: #fff;
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s;
}
.wc-stats.wc-in { opacity: 1; transform: translateY(0); }
.wc-screen-title {
  font: 700 15px/1 'Amazon Ember','Roboto',sans-serif; letter-spacing: 1px;
  color: #FF9900; margin-bottom: 8px; text-transform: uppercase;
}
.wc-table { width: 100%; border-collapse: collapse; font: 500 13px/1 'Amazon Ember','Roboto',sans-serif; }
.wc-table th { color: rgba(255, 255, 255, 0.5); font-weight: 600; text-align: center; padding: 4px 3px; font-size: 11px; }
.wc-table td { text-align: center; padding: 5px 3px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.wc-table .wc-team { text-align: left; }
.wc-table .wc-pts { font-weight: 700; color: #fff; }
.wc-table tr.wc-qual .wc-team { color: #4ade80; }
.wc-sub { color: rgba(255, 255, 255, 0.45); font-size: 11px; }

.wc-toggle {
  position: fixed; top: 50px; right: 14px; z-index: 31; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer;
  background: rgba(22, 29, 38, 0.85); color: #fff; font-size: 16px;
}

/* Flags */
.wc-flag {
  display: inline-block; vertical-align: middle; border-radius: 2px;
  margin-right: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
  aspect-ratio: 4 / 3; object-fit: cover;
}
.wc-ticker .wc-flag { height: 14px; width: auto; }

/* Today's fixtures panel (right side, mirrors .wc-stats) */
.wc-fixtures {
  position: fixed; right: 2vw; top: 16vh; width: 300px; max-height: 64vh; overflow: hidden;
  background: rgba(22, 29, 38, 0.82); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px); padding: 12px 14px; color: #fff;
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s;
}
.wc-fixtures.wc-in { opacity: 1; transform: translateY(0); }
.wc-fixture-list { display: flex; flex-direction: column; gap: 9px; }
.wc-fixture {
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px; padding: 9px 12px;
  transition: background .2s ease, border-color .2s ease;
}
.wc-fixture:hover { background: rgba(255,255,255,0.085); border-color: rgba(255,153,0,0.35); }
.wc-fixture-teams {
  display: flex; align-items: center; justify-content: space-between;
  font: 700 14px/1 'Amazon Ember','Roboto',sans-serif;
}
.wc-fx-team { display: flex; align-items: center; gap: 2px; }
.wc-fx-v { color: rgba(255,255,255,0.4); font-weight: 500; font-size: 12px; padding: 0 6px; }
.wc-fixture-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.wc-fx-time { color: #4ade80; font: 600 12px/1 'Amazon Ember','Roboto',sans-serif; }
.wc-fx-grp {
  color: rgba(255,255,255,0.6); font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; background: rgba(255,255,255,0.08);
  padding: 2px 7px; border-radius: 999px;
}
.wc-fixture-venue { color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 4px; }

@media (max-width: 768px) { .wc-stats, .wc-fixtures { display: none; } }

/* ----- Ticker 'tap a score' affordance ----- */
.wc-ticker-tag {
  position: absolute; right: 0; top: 0; height: 100%; z-index: 2;
  display: flex; align-items: center; padding: 0 12px;
  background: rgba(11,15,20,0.92);
  color: #FF9900; font: 700 10px/1 'Amazon Ember','Roboto',sans-serif;
  letter-spacing: 1px; border-left: 1px solid rgba(255,255,255,0.12);
}

/* ----- Match details panel (replaces fixtures on ticker click) ----- */
.wc-md-score {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 2px;
}
.wc-md-team { display: flex; align-items: center; gap: 6px; font: 700 15px/1 'Amazon Ember','Roboto',sans-serif; }
.wc-md-nums { font: 800 22px/1 'Amazon Ember','Roboto',sans-serif; letter-spacing: 1px; }
.wc-md-dash { color: rgba(255,255,255,0.4); padding: 0 5px; }
.wc-md-ht { text-align: center; color: rgba(255,255,255,0.5); font-size: 11px; margin-bottom: 10px; }
.wc-md-goals { display: flex; gap: 10px; }
.wc-md-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wc-md-col-r { text-align: right; }
.wc-md-goal { font-size: 12px; line-height: 1.3; }
.wc-md-name { color: #fff; font-weight: 600; }
.wc-md-min { color: #4ade80; }
.wc-md-none { color: rgba(255,255,255,0.35); font-size: 12px; }
.wc-md-venue { margin-top: 10px; color: rgba(255,255,255,0.45); font-size: 11px; text-align: center; }

/* ===== Knockout Bracket (horizontal strip, Final in centre) ===== */
.wc-bracket-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 160px; /* above the composer panel + login box */
  height: auto;
  max-height: 75vh;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(22, 29, 38, 0.78);
  border-top: 2px solid rgba(255, 153, 0, 0.4);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  color: #fff;
  pointer-events: none;
  z-index: 10;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s, transform .35s;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,153,0,0.4) transparent;
}
.wc-bracket-panel.wc-in { opacity: 1; transform: translateY(0); }
.wc-bracket-panel::-webkit-scrollbar { height: 4px; }
.wc-bracket-panel::-webkit-scrollbar-thumb { background: rgba(255,153,0,0.4); border-radius: 3px; }

.wc-bracket {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  min-width: max-content;
  margin: 0 auto;
  pointer-events: auto;
}

.wc-bk-round {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.wc-bk-round-label {
  font: 700 9px/1 'Amazon Ember','Roboto',sans-serif;
  color: #FF9900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
  white-space: nowrap;
}

.wc-bk-3rd-label {
  margin-top: 4px;
  color: rgba(255,153,0,0.6);
}

.wc-bk-final {
  padding: 0 8px;
}
.wc-bk-final .wc-bk-round-label {
  font-size: 11px;
  color: #ffd27a;
}

.wc-bk-matches {
  display: flex;
  flex-direction: column;
  gap: var(--bk-gap);
  height: var(--bk-total);
  justify-content: space-between;
}

.wc-bk-match {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  transition: border-color 0.2s, background 0.2s;
}
.wc-bk-match.wc-bk-played {
  border-color: rgba(255,255,255,0.18);
}
.wc-bk-match:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,153,0,0.3);
}
.wc-bk-match.wc-bk-tbd {
  opacity: 0.35;
}

.wc-bk-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 500 10px/1.4 'Amazon Ember','Roboto',sans-serif;
  color: rgba(255,255,255,0.7);
  padding: 1px 0;
}
.wc-bk-team.wc-bk-winner {
  color: #4ade80;
  font-weight: 700;
}

.wc-bk-score {
  font-weight: 700;
  color: #fff;
  font-size: 10px;
  min-width: 12px;
  text-align: right;
}
.wc-bk-team.wc-bk-winner .wc-bk-score {
  color: #4ade80;
}

.wc-bk-placeholder {
  color: rgba(255,255,255,0.3);
  font-style: italic;
  font-size: 9px;
}

.wc-bk-empty {
  text-align: center;
  padding: 8px;
}

/* --- Round-specific sizing: boxes grow toward the Final --- */
/* Total bracket height is set by R32 (8 matches per half × 1 unit).
   Each subsequent round has half the matches at double the height = same total. */
.wc-bracket {
  --bk-unit: 52px;  /* base match-box height for R32 */
  --bk-gap: 2px;
  --bk-total: calc(8 * var(--bk-unit) + 7 * var(--bk-gap)); /* total column height per half */
}

.wc-bk-matches {
  height: var(--bk-total);
}

/* R32: 8 matches per half, 1× height */
.wc-bk-round[data-round="R32"] { min-width: 170px; }
.wc-bk-round[data-round="R32"] .wc-bk-match {
  height: var(--bk-unit);
  padding: 1px 8px;
  min-width: 160px;
}
.wc-bk-round[data-round="R32"] .wc-bk-team { font-size: 9px; }
.wc-bk-round[data-round="R32"] .wc-bk-score { font-size: 9px; }

/* R16: 4 matches per half, 2× height */
.wc-bk-round[data-round="R16"] { min-width: 120px; }
.wc-bk-round[data-round="R16"] .wc-bk-match {
  height: calc(2 * var(--bk-unit) + var(--bk-gap));
  padding: 3px 7px;
}
.wc-bk-round[data-round="R16"] .wc-bk-team { font-size: 10px; }
.wc-bk-round[data-round="R16"] .wc-bk-score { font-size: 10px; }

/* QF: 2 matches per half, 4× height */
.wc-bk-round[data-round="QF"] { min-width: 120px; }
.wc-bk-round[data-round="QF"] .wc-bk-match {
  height: calc(4 * var(--bk-unit) + 3 * var(--bk-gap));
  padding: 5px 8px;
}
.wc-bk-round[data-round="QF"] .wc-bk-team { font-size: 11px; }
.wc-bk-round[data-round="QF"] .wc-bk-score { font-size: 11px; }

/* SF: 1 match per half, 8× height = full column */
.wc-bk-round[data-round="SF"] { min-width: 130px; }
.wc-bk-round[data-round="SF"] .wc-bk-match {
  height: var(--bk-total);
  padding: 6px 9px;
}
.wc-bk-round[data-round="SF"] .wc-bk-team { font-size: 12px; font-weight: 600; }
.wc-bk-round[data-round="SF"] .wc-bk-score { font-size: 12px; }

/* Final: centre column (Final + 3rd place) */
.wc-bk-final .wc-bk-match {
  height: calc(var(--bk-total) / 2 - var(--bk-gap));
  min-width: 150px;
  padding: 8px 10px;
  border-color: rgba(255,153,0,0.5);
}
.wc-bk-final .wc-bk-team { font-size: 14px; font-weight: 700; }
.wc-bk-final .wc-bk-score { font-size: 14px; }

/* Responsive: hide bracket on small screens */
@media (max-width: 768px) {
  .wc-bracket-panel { display: none; }
}

/* Push the opportunity toast above the bracket */
#usage-tracker-toast, .usage-tracker-toast {
  bottom: auto !important;
  top: 80px !important;
}
