:root {
  --primary-color: #00f2ea;
  --secondary-color: #d400ff;
  --background-dark: #0d0d1a;
  --text-color: #f0f0f0;
  --text-dark: #a0a0b0;
  --card-bg: rgba(26, 26, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --success-color: #00ff88;
  --danger-color: #ff4d4d;
  --warning-color: #ffc107;
}

#root *, #root *::before, #root *::after {
  box-sizing: border-box;
}
#root h1, #root h2, #root h3, #root h4, #root h5, #root h6, #root p, #root ul, #root li, #root form, #root label, #root button, #root a {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  color: inherit;
  vertical-align: baseline;
  background: transparent;
  text-decoration: none;
}
#root ul {
  list-style: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Container Fix for WordPress Integration --- */
#root {
  position: relative; 
  width: 100%;
  max-width: 1600px; 
  margin: 0 auto; 
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background-color: var(--background-dark);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  min-height: 80vh; 
}

#root > * {
  position: relative;
  z-index: 1;
}

.main-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  width: 100%;
  height: auto;
}

#root .app-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#root .card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  width: 100%;
  max-width: 450px;
}

#root h1, #root h2, #root h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-shadow: 0 3px 8px rgba(0,0,0,0.8);
  color: var(--text-color);
}

#root .logo {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 1.5rem auto;
}

#root .form-group {
  margin-bottom: 1.5rem;
}

#root .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

#root input[type="text"], #root input[type="password"], #root textarea, #root select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

#root input[type="text"]:focus, #root input[type="password"]:focus, #root textarea:focus, #root select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px 0 var(--primary-color);
}

#root select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f0f0f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

#root select option {
  background: var(--background-dark);
  color: var(--text-color);
}

#root textarea {
  resize: vertical;
  min-height: 100px;
}

#root .btn {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: white;
  text-decoration: none;
  text-align: center;
}

#root .btn:hover:not(:disabled), #root .btn:focus:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 15px 0 var(--primary-color), 0 0 25px 0 var(--secondary-color);
}

#root .btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--text-dark);
}

#root .btn-secondary {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

#root .btn-secondary:hover {
  background: var(--primary-color);
  color: var(--background-dark);
}

#root .confirmation-message {
  text-align: center;
  color: var(--success-color);
  font-weight: 600;
  margin-top: 1rem;
}

#root .confirmation-message.error-message {
    color: var(--danger-color);
}

#root .guest-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

#root .guest-footer a {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

#root .guest-footer a:hover {
    color: var(--primary-color);
}

#root .warning-box {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-left: 4px solid var(--warning-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

#root .warning-box strong {
    color: var(--warning-color);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* DJ VIEW */
#root .dj-view-container {
  max-width: 1600px;
  width: 100%;
  min-height: 75vh;
  height: auto;
  padding: 1rem;
  gap: 1.5rem;
  flex-direction: row;
  align-items: flex-start;
}

#root .dj-panel {
  flex: 1 1 55%; 
  min-width: 0;
  height: 100%;
  min-height: 70vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

#root .dj-panel h2, #root .dj-panel h3 {
    text-align: left;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
#root .dj-panel h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

#root .message-list {
  list-style: none;
  overflow-y: auto;
  padding-right: 10px;
}
#root .pending-list {
    flex-grow: 1;
    min-height: 0;
}

#root .approved-list-container {
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 1rem;
}

#root .approved-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
#root .approved-list-header h3 {
    margin-bottom: 0;
}

#root .btn-delete-all {
    width: auto;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}
#root .btn-delete-all:hover:not(:disabled) {
    background-color: var(--danger-color);
    color: var(--background-dark);
    box-shadow: 0 0 15px 0 var(--danger-color);
}

#root .approved-list {
    flex-grow: 1;
}

#root .message-item {
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: opacity 0.4s ease;
}

#root .message-item.is-local {
  opacity: 0.5;
  border-left-color: var(--text-dark);
}

#root .message-actions button:disabled {
  cursor: wait;
  opacity: 0.4;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
}

#root .message-content {
  flex-grow: 1;
  word-break: break-word;
}

#root .message-content strong {
  color: var(--primary-color);
}

#root .message-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

#root .message-actions .btn {
  width: auto;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  background: transparent;
}

#root .btn-show {
  border: 1px solid var(--success-color);
  color: var(--success-color);
}
#root .btn-show:hover:not(:disabled) {
    background-color: var(--success-color);
    color: var(--background-dark);
    box-shadow: 0 0 15px 0 var(--success-color);
}

#root .btn-delete {
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}
#root .btn-delete:hover:not(:disabled) {
    background-color: var(--danger-color);
    color: var(--background-dark);
    box-shadow: 0 0 15px 0 var(--danger-color);
}

#root .btn-warning {
  border: 1px solid var(--warning-color);
  color: var(--warning-color);
}
#root .btn-warning:hover:not(:disabled) {
    background-color: var(--warning-color);
    color: var(--background-dark);
    box-shadow: 0 0 15px 0 var(--warning-color);
}

#root .approved-item {
    border-left-color: var(--text-dark);
    padding: 0.5rem 1rem;
    opacity: 0.7;
}
#root .approved-item:hover {
    opacity: 1;
}

#root .approved-item p {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
}
#root .approved-item p span {
    font-weight: bold;
    color: var(--text-dark);
}

/* DJ CONTROLS REDESIGN */
#root .dj-controls {
  flex: 1 1 45%;
  height: 100%;
  min-height: 70vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#root .dj-controls-logo {
  max-width: 120px;
  margin-bottom: 0;
  align-self: center;
  flex-shrink: 0;
}

#root .dj-controls-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
}
#root .dj-controls-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}


#root .dj-controls .manual-add-form {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

#root .dj-controls .manual-add-form .form-group {
    margin-bottom: 0.75rem;
}

#root .dj-controls .manual-add-form .form-group:last-of-type {
    margin-bottom: 1rem;
}

#root .dj-controls .manual-add-form textarea {
    min-height: 60px;
}

#root .controls-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#root .control-group {
  margin-bottom: 0;
}

#root .control-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
}
#root .control-group-row > .control-group {
    flex: 1;
}


#root .control-group > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    flex-wrap: wrap;
    font-size: 0.9rem;
}

#root .input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
#root .input-with-button input {
    flex-grow: 1;
}
#root .input-with-button .btn {
    width: auto;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

#root .dj-qr-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    text-align: center;
}
#root .dj-qr-preview p {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}
#root .dj-qr-preview .qr-code {
    margin: 0 auto;
    display: inline-block;
}

#root .toggle-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    height: 100%;
    justify-content: center;
}
#root .toggle-group-vertical > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    font-size: 0.9rem;
    flex-grow: 0;
    gap: 1rem;
}


#root input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity .2s;
  padding: 0;
}
#root input[type="range"]:hover {
    opacity: 1;
}

#root input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 5px var(--primary-color);
}

#root input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
}

#root .toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

#root .toggle-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

#root .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    transition: .4s;
    border-radius: 24px;
}

#root .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

#root input:checked + .slider {
    background-color: var(--primary-color);
}

#root input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

#root input:checked + .slider:before {
    transform: translateX(20px);
}

#root .sub-control-group {
    margin-top: 0.75rem;
}

#root input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
#root input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
#root input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 7px;
}


/* SCREEN VIEW */
#root .screen-view-container {
    height: auto;
    width: 100%;
    max-width: none;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
}
#root .screen-view-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: none;
}
#root .screen-view-container .screen-overlay {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    background: rgba(0,0,0,0.2); /* Soft overlay to improve text readability */
}

/* Background Styles */
@keyframes screen-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0.8; }
}

#root .screen-view-container.background-default::before {
    background-image: radial-gradient(circle at 1% 1%, var(--primary-color), transparent 25%), radial-gradient(circle at 99% 99%, var(--secondary-color), transparent 25%);
    animation: screen-pulse 15s infinite alternate;
    opacity: 0.6;
}
#root .screen-view-container.background-formal {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}
#root .screen-view-container.background-fun {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-fun 15s ease infinite;
}
@keyframes gradient-fun {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
#root .screen-view-container.background-black {
    background: #000;
}
#root .screen-view-container.background-black .screen-overlay,
#root .screen-view-container.background-formal .screen-overlay,
#root .screen-view-container.background-color .screen-overlay,
#root .screen-view-container.background-image .screen-overlay {
    background: rgba(0,0,0,0.3); /* Slightly darker overlay for these */
}

#root .message-display, #root .idle-screen-container {
    width: 100%;
    text-align: center;
    padding: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    position: relative;
    z-index: 2;
}
#root .message-display.is-fading-out {
    opacity: 0;
    animation: none;
    transition-duration: 0.5s;
}

/* Message Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-display.animation-fadeIn { animation: fadeIn 0.5s ease-in-out; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}
.message-display.animation-slideInLeft { animation: slideInLeft 0.5s ease-out; }

@keyframes slideInTop {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-display.animation-slideInTop { animation: slideInTop 0.5s ease-out; }

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.message-display.animation-zoomIn { animation: zoomIn 0.5s ease-out; }

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    80% { opacity: 1; transform: scale(1.05); }
    100% { transform: scale(1); }
}
.message-display.animation-popIn { animation: popIn 0.5s ease-out; }


#root .message-container-on-screen, #root .qr-promo-container {
    max-width: 90%;
    width: auto;
    display: inline-block;
    text-align: center;
}

#root .message-text {
    font-size: 8vmin;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0,0,0,0.9), 0 0 8px var(--primary-color), 0 0 20px var(--secondary-color);
    word-break: break-word;
    margin-bottom: 2vmin;
}

#root .message-author {
    font-family: 'Caveat', cursive;
    font-size: 6vmin;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(0,0,0,0.7), 0 0 5px var(--primary-color);
    text-align: right;
    margin-top: 1vmin;
}


#root .screen-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
}

#root .screen-footer {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
}

#root .screen-branding {
    text-align: left;
}
#root .screen-branding h1 {
    font-size: 3vmin;
    text-align: left;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 5px var(--primary-color);
}

#root .screen-branding .logo {
    max-width: 120px;
    margin: 0 0 1rem 0;
    opacity: 0.8;
}

#root .qr-container {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
}

#root .qr-container p {
    font-size: 2.5vmin;
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0,0,0,0.7);
}

#root .qr-code {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#root .qr-code canvas {
    display: block;
}

/* IDLE SCREEN & QR PROMO */
#root .idle-screen-container, #root .qr-promo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}
#root .idle-screen-container h2, #root .qr-promo-container h2 {
    font-size: 6vmin;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7), 0 0 10px var(--primary-color);
    margin: 0;
}
#root .idle-screen-container p, #root .qr-promo-container p {
    font-size: 4vmin;
    font-weight: 500;
    color: var(--text-dark);
    max-width: 80%;
    line-height: 1.5;
}
#root .idle-screen-container .qr-code, #root .qr-promo-container .qr-code {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.7);
}
#root .idle-logo {
    max-width: 250px;
    opacity: 0.9;
    margin: 0;
}

#root .fullscreen-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.3s;
    z-index: 10;
}

#root .fullscreen-btn:hover {
    opacity: 1;
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* APP FOOTER NAVIGATION */
#root .app-nav {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: auto;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#root .app-nav a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#root .app-nav a:hover {
  background: var(--primary-color);
  color: var(--background-dark);
  transform: scale(1.1);
  border-color: var(--primary-color);
}
#root .app-nav a.active {
  background: var(--primary-color);
  color: var(--background-dark);
  border-color: var(--primary-color);
}


/* RESPONSIVENESS */
@media (max-width: 900px) {
  #root .dj-view-container {
    flex-direction: column;
    height: auto;
    padding: 0;
    width: 100%;
    gap: 0;
  }
  #root .dj-panel, #root .dj-controls {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: unset;
    border-radius: 0;
    min-height: unset;
  }
  #root .dj-panel {
    max-height: 50vh;
  }
  #root .dj-controls {
     max-height: none;
     overflow-y: visible; /* Let it grow naturally */
  }
  #root .dj-controls-content {
      overflow-y: visible;
  }

  #root .card {
    padding: 1.5rem;
    border-radius: 0;
    max-width: 100%;
  }
  #root h1 {
    font-size: 1.5rem;
  }

  #root .screen-header {
      top: 10px;
      right: 10px;
  }
  #root .screen-footer {
      bottom: 10px;
      left: 10px;
  }
  #root .fullscreen-btn, #root .app-nav a {
      width: 40px;
      height: 40px;
  }
  #root .fullscreen-btn {
      top: 10px;
      left: 10px;
  }
  #root .app-nav {
      bottom: 10px;
      left: 10px;
      right: auto;
  }
  
  #root .qr-container p { font-size: 3vmin; }
  #root .screen-branding .logo { max-width: 80px; }
  #root .message-text { font-size: 10vmin; }
  #root .message-author { font-size: 8vmin; }
}

/* --- NEW STYLES FOR API DIAGNOSTICS --- */
#root .dj-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

#root .dj-controls-header h2 {
  margin-bottom: 0;
  text-align: left;
  flex-grow: 1;
}

#root .connection-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
#root .btn-connect {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    width: auto;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--text-dark);
    color: var(--text-dark);
}
#root .btn-connect:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    box-shadow: none;
}


#root .polling-indicator {
  width: 10px;
  height: 10px;
  background-color: var(--danger-color);
  border-radius: 50%;
  transition: background-color 0.5s ease;
  box-shadow: 0 0 8px 2px #ff4d4d44;
  flex-shrink: 0;
}
#root .polling-indicator.connected {
    background-color: var(--success-color);
    box-shadow: 0 0 8px 2px #00ff8844;
}

#root .polling-indicator.active {
  animation: pulse-sync 1.5s infinite;
}

@keyframes pulse-sync {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

#root .error-box {
    background-color: rgba(255, 77, 77, 0.15);
    border: 1px solid rgba(255, 77, 77, 0.5);
    border-left: 4px solid var(--danger-color);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: left;
    flex-shrink: 0;
}

#root .error-box strong {
    color: var(--danger-color);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

#root .error-box p {
    line-height: 1.6;
    word-break: break-word;
}

#root .screen-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding: 2rem;
    color: var(--text-color);
    text-align: center;
    backdrop-filter: blur(5px);
}

#root .screen-error-overlay .error-box {
    max-width: 700px;
    background-color: var(--card-bg);
    margin: 0;
}

#root .error-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-dark);
    opacity: 0.7;
}