* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}


/* Setup Screen */

.setup-screen {
    background-color: #090909;
    position: relative;
}

.setup-screen .background-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.background-preview.cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-preview.tiled {
    background-size: auto;
    background-position: top left;
    background-repeat: repeat;
}

.background-preview.centered {
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
}

.setup-container {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    padding: 24px 48px 48px;
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.setup-container .logo-header {
    display: block;
    margin: 0 auto 8px;
}

.setup-container h2 {
    font-size: 18px;
    font-weight: 100;
    margin-bottom: 18px;
    text-align: center;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1px;
    color: #ffffff;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgb(26, 58, 204);
    background: rgba(255, 255, 255, 0.08);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='white' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group select option {
    background-color: #000000;
    color: #ffffff;
    padding: 12px;
}

.form-group select option:checked {
    background: #1a3acc;
    background-color: #1a3acc;
}


/* Choices.js custom styling */

.choices {
    margin-bottom: 0;
}

.choices__inner {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 1px !important;
    padding: 14px 16px !important;
    min-height: auto !important;
    font-size: 15px !important;
    color: #ffffff !important;
    z-index: 3;
}

.choices__inner:focus,
.choices.is-focused .choices__inner {
    border-color: rgb(26, 58, 204) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.choices__list--single {
    padding: 0 !important;
}

.choices__item {
    color: #ffffff !important;
}

.choices__list--dropdown {
    background: #000000 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 1px !important;
    margin-top: 2px;
    z-index: 100;
}

.choices__list--dropdown .choices__item {
    color: #ffffff !important;
    padding: 12px 16px !important;
    background: #000000 !important;
}

.choices__list--dropdown .choices__item--selectable {
    background: #000000 !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #1a3acc !important;
    background: #1a3acc !important;
}

.choices[data-type*=select-one] .choices__inner {
    padding-bottom: 14px !important;
}

.choices[data-type*=select-one]:after {
    border-color: #ffffff transparent transparent !important;
    right: 16px;
    margin-top: -2px;
}

.form-group .background-url-hint {
    font-size: .85em;
    display: block;
    margin: 4px 0 8px 0;
    background: #00000000;
    padding: 4px 0 4px 10px;
    opacity: .25;
    transition: all .25s;
    height: 18px;
    overflow: hidden;
    scrollbar-color: #000E4E black;
    scrollbar-width: thin;
    width: 100%;
    position: absolute;
    z-index: 2;
    cursor: pointer;
}

.form-group .background-url-hint pre {
    display: block;
    cursor: pointer;
    padding: 2px 0;
}

.form-group .background-url-hint pre:hover {
    color: #1a3acc;
}

.form-group .background-url-hint:hover {
    background: #000;
    opacity: 1;
    max-height: auto;
    height: 100px;
    overflow-y: scroll;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.start-btn {
    font-family: Arial, sans-serif;
    width: 100%;
    padding: 16px;
    background-color: #000;
    border: none;
    border-radius: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 100;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.start-btn:hover {
    background-color: #1939cc;
    transform: translateY(-2px);
}


/* Timer Screen */

.timer-screen {
    background-color: #000;
    flex-direction: column;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 32px;
    opacity: 0.9;
}

.stream-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 48px;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
}

.timer-display {
    font-size: 120px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
    margin-bottom: 24px;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

.milliseconds {
    font-size: 60px;
    opacity: 0.7;
    margin-left: 8px;
}

.timer-label {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 3px;
}


/* Launch Screen */

.launch-screen {
    background: #000000;
}

.launch-screen .background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.background-container.cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-container.tiled {
    background-size: auto;
    background-position: top left;
    background-repeat: repeat;
}

.background-container.centered {
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
}

.launch-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    width: 100%;
    height: 100%;
    /* backdrop-filter: blur(2px); */
}

.launch-message {
    font-size: 48px;
    font-weight: 700;
    margin-top: 24px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    max-width: 80%;
    line-height: 1.3;
}


/* Back Button */

.back-btn {
    position: absolute;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 10;
}

.back-btn:hover {
    opacity: 1 !important;
    background: rgba(30, 30, 30, 0.95);
    transform: scale(1.1);
}

.timer-screen:hover .back-btn,
.launch-screen:hover .back-btn {
    opacity: 1;
}

.back-btn svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}


/* Keyboard shortcuts help button */

.shortcuts-btn {
    position: absolute;
    bottom: 32px;
    left: 32px;
    width: 32px;
    height: 32px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.timer-screen:hover .shortcuts-btn,
.launch-screen:hover .shortcuts-btn {
    opacity: 1;
}

.shortcuts-btn:hover {
    background: rgba(30, 30, 30, 0.9);
    color: rgba(255, 255, 255, 0.9);
    opacity: 1 !important;
}

.shortcuts-tooltip {
    position: absolute;
    bottom: 70px;
    left: 32px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    min-width: 220px;
}

.shortcuts-btn:hover .shortcuts-tooltip {
    opacity: 1;
}

.shortcuts-tooltip p {
    margin: 8px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.shortcuts-tooltip p:first-child {
    margin-top: 0;
}

.shortcuts-tooltip p:last-child {
    margin-bottom: 0;
}

.shortcuts-tooltip kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 3px 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-right: 12px;
    min-width: 60px;
    text-align: center;
    color: #ffffff;
}

@media (max-width: 768px) {
    .setup-container {
        padding: 32px 24px;
        width: 95%;
    }
    .timer-display {
        font-size: 72px;
        letter-spacing: 2px;
    }
    .milliseconds {
        font-size: 36px;
    }
    .stream-title {
        font-size: 24px;
    }
    .launch-message {
        font-size: 32px;
    }
    .logo {
        width: 80px;
    }
}

.omega {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #949494;
    line-height: 1.78571;
    display: block;
    position: absolute;
    bottom: 0;
    margin: 0 auto;
    width: 100%;
    opacity: 0.5;
    text-align: center;
    border-top: 1px solid #111111;
    transition: background 1.3s ease;
    z-index: 9999;
}

.omega:hover {
    background: #000000;
    transition: background 0.93s ease;
}

.omega a {
    text-decoration: none;
    color: #ccc;
}