/* ==========================================
   GLOBAL APP CONTAINER
   ========================================== */

#remote-app,
.remote-container,
.main-container {
  height: auto;
  max-height: 520px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5vw;
  padding: 1.2vh;
  box-sizing: border-box;
}

/* ==========================================
   SCORE COLUMNS (LEFT & RIGHT)
   ========================================== */

.score-box-large {
  background: #1e1e1e;
  padding: 0.8vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 14vh;
  margin-bottom: 0.8vh;
  min-height: 0;
}

.score-box-large .label {
  color: #888;
  text-transform: uppercase;
  font-size: 1vh;
  font-weight: 800;
  letter-spacing: 1px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-num {
  font-size: 5.5vh;
  font-weight: 800;
  line-height: 1;
}

.score-button-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.score-btn {
  font-size: 2.5vh;
  font-weight: 900;
  flex: 1; /* Maximizes +1 button height vertically */
  background: #ce1141; /* Crespi Red */
  border-bottom: 4px solid #8b0000;
  border-radius: 10px;
}

.minus-btn {
  flex: 0 0 2.2vh !important; /* Minimized -1 button height */
  min-height: 20px;
  font-size: 1vh;
  color: #888;
  background: #1a1a1a;
  border: 1px solid #333;
}

/* ==========================================
   CENTER COLUMN LAYOUT
   ========================================== */

.center-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8vh;
  height: 100%;
  min-height: 0;
}

/* --- Status & Period Card --- */
.situation-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  padding: 0.8vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 0 0 14vh; /* Matches score-box-large */
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#period-text {
  font-size: 4vh;
  font-weight: 900;
  margin: 0.1vh 0;
  flex: 0 0 auto;
  color: #00ff00;
}

#mode-text {
  color: #555;
  font-size: 0.9vh;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.label {
  color: #888;
  text-transform: uppercase;
  font-size: 0.9vh;
  letter-spacing: 1px;
}

#sync-dot {
  font-weight: bold;
  font-size: 0.9vh;
}

.reset-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.reset-util-btn {
  background: #151515;
  color: #888;
  border: 1px solid #333;
  border-radius: 6px;
  height: 2.6vh;
  font-size: 0.9vh;
  font-weight: bold;
  text-transform: uppercase;
}

/* ==========================================
   QUICK ACTION BUTTONS
   ========================================== */

.quick-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  height: 5vh;
  min-height: 38px;
  flex: 0 0 auto;
}

.prod-btn {
  width: 100%;
  height: 100%;
  font-size: 1.1vh;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  line-height: 1.1;
  text-align: center;
}

.btn-break {
  background: #2563eb;
  border-bottom: 3px solid #1d4ed8;
  color: #ffffff;
}

.btn-blue {
  background: #1e3a5f;
  border-bottom: 3px solid #0f1d30;
  color: #ffffff;
}

/* Active Red State for Break Button */
#btn-toggle-break.in-break {
  background-color: #dc2626 !important;
  border-bottom: 3px solid #991b1b !important;
  color: #ffffff !important;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

/* ==========================================
   STANDARD YOUTUBE CONTROLLER
   ========================================== */

.youtube-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  padding: 1vh;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  flex: 0 0 auto;
}

.yt-header {
  text-align: left;
}

.yt-picker-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.yt-picker-row select {
  flex: 1;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 1vh;
  outline: none;
  height: 3.2vh;
}

.refresh-btn {
  flex: 0 0 32px;
  height: 3.2vh;
  background: #262626;
  border: 1px solid #444;
  border-bottom: 2px solid #111;
  border-radius: 6px;
  font-size: 1.1vh;
}

.yt-start-btn {
  background: #1b4d2e;
  border: none;
  border-bottom: 3px solid #0d2617;
  border-radius: 8px;
  height: 4vh;
  min-height: 36px;
  font-size: 1.1vh;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

/* ==========================================
   GLOBAL UTILITIES
   ========================================== */

button:disabled {
  cursor: not-allowed !important;
  filter: grayscale(80%);
}

/* ==========================================
   BE RIGHT BACK (BRB) STATES
   ========================================== */

/* BRB Button Active State */
#btn-toggle-brb.in-brb {
  background-color: #d97706 !important; /* Amber / Orange warning */
  border-bottom: 3px solid #92400e !important;
  color: #ffffff !important;
  animation: pulse-amber 2s infinite;
}

@keyframes pulse-amber {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(217, 119, 6, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
  }
}

/* Optional BRB Screen Overlay */
#brb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  color: #fbbf24;
  font-family: sans-serif;
}

#brb-overlay h1 {
  font-size: 8vh;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Container for dynamic break buttons */
#break-buttons-container {
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

/* Flexibly resize buttons and text */
#break-buttons-container .prod-btn {
  flex: 1 1 0%;
  min-width: 0;
  padding: 8px 4px;

  /* Fluid font sizing: min 0.7rem, max 0.9rem */
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  font-weight: 700;
  line-height: 1.1;

  /* Allow 2-line wrap (e.g., "SHOW\nFINAL") to prevent horizontal overflow */
  white-space: normal;
  word-break: break-word;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Scale down font even further when 3 buttons are rendered */
#break-buttons-container:has(> :nth-child(3)) .prod-btn {
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  padding: 6px 2px;
}
