




/* Prevent template CSS (e.g. `* { display: flex }`) from making <head> elements visible */
head, title, base, meta, link, style, script { display: none !important; }

/* Normalize base layout to remove inline styles from template */
body {
    width: 100%;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Overlay base — shared by registration and deactivated overlays ── */
#registration-overlay,
#deactivated-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    /* Reset inherited properties so template CSS cannot bleed in */
    font-family: sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    font-weight: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#registration-overlay { z-index: 10000; }
#deactivated-overlay  { z-index: 99999; }

#registration-overlay.show,
#deactivated-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* ── Main content area — fills remaining space and centres its children ── */
#registration-overlay .overlay-main,
#deactivated-overlay .overlay-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 1.5rem;
}

/* ── Shared overlay text elements ── */
#registration-overlay .registration-text,
#deactivated-overlay .registration-text {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* Deactivated title is red to signal an error state */
#deactivated-overlay .registration-text {
    color: #ff4444;
}

#registration-overlay .registration-status,
#deactivated-overlay .registration-status {
    font-size: 1.2rem;
    opacity: 0.8;
    text-align: center;
}

#registration-overlay .registration-status {
    color: #0dcaf0;
}

/* ── Powered-by block — in normal flow, can never overlap the QR code ── */
#registration-overlay .powered-by,
#deactivated-overlay .powered-by {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    margin-bottom: 32px;
    background: white;
    border-radius: 12px;
}

#registration-overlay .powered-text,
#deactivated-overlay .powered-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
}

#registration-overlay .powered-logo,
#deactivated-overlay .powered-logo {
    height: 48px;
    width: auto;
}

/* ── QR code — 15 px white border around the code ── */
#qr-code-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#qr-code {
    margin: 0;
    display: block;
}

/* ── Adoption token row — masked token text plus reveal/copy icon buttons ── */
#token-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.token-masked {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #333;
    letter-spacing: 1px;
}

.token-masked.revealed {
    color: #000;
    letter-spacing: normal;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
}

.icon-btn:hover {
    color: #000;
}

.icon-btn:disabled {
    cursor: default;
    color: #aaa;
}

.icon-btn.copied {
    color: #0a0;
}

#manual-adopt-link {
    display: inline-block;
    margin-top: 10px;
    color: #0d6efd;
    font-size: 14px;
    text-decoration: underline;
}

#manual-adopt-link:hover {
    color: #0a58ca;
}



#main-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Design background fills #main-container; scene containers are absolutely
   positioned overlay divs (vh/vw, set inline by container-manager.ts) on
   top of it, in their own layer so re-rendering scenes never touches the
   Design markup. */
#design-effect-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

#design-effect-background canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#design-background {
    position: absolute;
    inset: 0;
}

#scene-containers {
    position: absolute;
    inset: 0;
}

/* Progress indicator along the bottom of the stage. Height/colour/direction are
   set inline by indicator.ts; the bar fills via the keyframes below. */
#scene-indicator {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

#scene-indicator[hidden] {
    display: none;
}

#scene-indicator-bar {
    width: 100%;
    height: 100%;
    transform: scaleX(0);
}

@keyframes dh-indicator-fill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* No mouse pointer on an unattended screen (cursor-hider.ts adds the class after a few idle seconds). */
html.cursor-hidden,
html.cursor-hidden * {
    cursor: none !important;
}

/* Status indicator (status-indicator.ts): codes of what is wrong, top-left; hidden when all is well. */
#status-indicator {
    position: absolute;
    top: 0.8vmin;
    left: 0.8vmin;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 0.6vmin;
    padding: 0.3vmin 0.9vmin;
    border-radius: 2vmin;
    background: rgba(0, 0, 0, 0.6);
    font: 600 1.6vmin/1 monospace;
    color: #fff;
    pointer-events: none;
}

#status-indicator[hidden] {
    display: none;
}

#status-indicator::before {
    content: "";
    width: 1.4vmin;
    height: 1.4vmin;
    border-radius: 50%;
    background: #f5c518;
}

#status-indicator[data-level="red"]::before {
    background: #e5392b;
}

/* Icon style: a pictogram per problem, no coloured dot and no codes. */
#status-indicator[data-style="icons"]::before {
    display: none;
}

#status-indicator[data-style="icons"] {
    gap: 0.9vmin;
    padding: 0.5vmin 1vmin;
}

#status-indicator .status-icon {
    width: 2.6vmin;
    height: 2.6vmin;
    display: block;
}

/* ── Persistent powered-by badge — bottom-right corner during normal playback.
   Only rendered when the "hide powered by" setting is off (see index.html). ── */
#powered-by-badge {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.604);
    border-radius: 8px;
    pointer-events: none;
    /* Reset inherited properties so template CSS cannot bleed in */
    font-family: sans-serif;
    letter-spacing: normal;
    text-transform: none;
    font-weight: normal;
}

#powered-by-badge .powered-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #2f2f2f;
}

#powered-by-badge .powered-domain {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color:  #2f2f2f;
}


#debug-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    display: none;
    flex-direction: column;
    border-left: 2px solid #444;
    z-index: 9999;
}

/* Collapsed: shrink the whole bar down to just the handle poking out on its
   left edge — everything else that used to fill the 300px width is hidden
   rather than left to wrap/overflow inside a 40px strip. */
#debug-panel.collapsed {
    width: 0;
    border-left: none;
}

#debug-panel.collapsed #debug-toggle,
#debug-panel.collapsed .debug-content,
#debug-panel.collapsed #debug-powered-by,
#debug-panel.collapsed #debug-commit {
    display: none;
}

/* Handle: a small tab hanging off the panel's left edge — `#debug-panel` is
   `position: fixed`, so it's already this handle's containing block, and
   being a child of it means it's hidden right along with the whole panel
   whenever debug mode itself is off (see applyDebugState() in
   socket-handlers.ts, which toggles #debug-panel's own display). */
#debug-collapse-handle {
    position: absolute;
    top: 50%;
    left: -22px;
    transform: translateY(-50%);
    width: 22px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #444;
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

#debug-collapse-handle:hover {
    background: #333;
}

#debug-toggle {
    background: #333;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    border-bottom: 1px solid #444;
    user-select: none;
}

#debug-toggle:hover {
    background: #444;
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#debug-powered-by {
    padding: 8px 12px;
    font-size: 11px;
    font-family: sans-serif;
    color: #fff;
    border-top: 1px solid #444;
    text-align: center;
}

#debug-powered-by a {
    color: #fff;
    text-decoration: none;
}

#debug-commit {
    padding: 4px 12px 8px;
    font-size: 10px;
    font-family: sans-serif;
    color: #888;
    text-align: center;
}

.debug-section {
    margin-bottom: 15px;
}

.debug-label {
    color: #aaa;
}

.debug-value {
    color: #0f0;
    font-weight: bold;
}

.debug-playlist-count {
    color: #666;
    font-weight: normal;
    font-size: 11px;
}

.debug-playlist-controls {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.debug-btn {
    background: #222;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.debug-btn:hover {
    background: #333;
}

.debug-btn-start {
    border-color: #0a0;
    color: #0f0;
}

.debug-btn-start:hover {
    background: #0a0;
    color: #fff;
}

.debug-btn-stop {
    border-color: #a00;
    color: #f44;
}

.debug-btn-stop:hover {
    background: #a00;
    color: #fff;
}

.debug-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

@keyframes playlist-progress {
    from { background-size: 0% 100%; }
    to   { background-size: 100% 100%; }
}

.debug-playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    border-radius: 3px;
    border-left: 2px solid transparent;
    position: relative;
}

.debug-playlist-item--active {
    border-left-color: #0f0;
    background-image: linear-gradient(rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.2));
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left center;
    animation-name: playlist-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    /* animation-duration and animation-delay are set inline per item */
}

.debug-playlist-title {
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    position: relative;
}

.debug-playlist-item--active .debug-playlist-title {
    color: #0f0;
    font-weight: bold;
}

.debug-playlist-duration {
    color: #666;
    margin-left: 8px;
    flex-shrink: 0;
    font-size: 11px;
    position: relative;
}

/* Pretalx table color cells — color value is passed via --pt-color, styling is overridable */
.pt-color {
    background-color: var(--pt-color, transparent);
    width: 20px;
}

.pt-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--pt-color, transparent);
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}
