#language-selector {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1001;
    cursor: pointer;
}

#current-language img {
    width: 40px;
    height: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#language-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 5px;
    margin-top: 5px;
    color: #000;
}


.language-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-option:hover {
    background-color: #f0f0f0;
}

.language-option img {
    width: 24px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

#file-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

#file-manager-overlay.hidden {
    display: none;
}

#file-manager-box {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#file-manager-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

#file-manager-list .media-item {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

#file-manager-list .media-item:hover {
    border-color: #e94560;
}

#file-manager-list .media-preview {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.file-manager-buttons {
    display: flex;
    justify-content: flex-end;
}

/* --- Basic Setup --- */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #1a1a2e;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    user-select: none;
}

#app-container {
    background-color: transparent; /* Allows custom background to show */
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* --- Background Layer --- */
#background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
    overflow: hidden;
}

#bg-video, #bg-image, #bg-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#bg-mask {
    z-index: 1;
}

#youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
}

#youtube-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#bg-veil {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* --- Game Elements --- */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
	margin-top: 300px;
}

.wheel-container {
    position: relative;
    width: 950px;
    height: 950px;
    display: flex;
    justify-content: center;
    align-items: center;
	margin-bottom: 115px;
}

#logo-container {
    position: absolute;
    width: 200px; /* Default size */
    height: 200px; /* Default size */
    background-color: #ffffff; /* Default background color */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 5;
    cursor: pointer;
}

#logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Pulsating Lights --- */
.wheel-lights {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.light {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffc400;
    animation-name: var(--light-animation, pulse);
    animation-duration: var(--light-speed, 1.5s);
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes pulse {
    from { opacity: 0.2; transform: scale(0.8); }
    to { opacity: var(--light-intensity, 0.8); transform: scale(1.1); }
}

@keyframes flashing {
    0%, 100% { opacity: var(--light-intensity, 0.8); }
    50% { opacity: 0.1; }
}

@keyframes circle_fading {
    0% { transform: scale(1); opacity: var(--light-intensity, 0.8); }
    50% { transform: scale(1.2); opacity: 0.1; }
    100% { transform: scale(1); opacity: var(--light-intensity, 0.8); }
}

@keyframes breathing {
    0% { transform: scale(0.9); }
    25% { transform: scale(1.1); }
    60% { transform: scale(0.9); }
    100% { transform: scale(0.9); }
}

/* --- Needle --- */
#needle {
    position: absolute;
    top: 50.8%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 50px solid transparent;
    border-bottom: 50px solid transparent;
    border-right: 80px solid #e94560;
    z-index: 10;
}

#needle-image {
    display: none; /* Initially hidden */
    position: absolute;
    z-index: 10;
    transform-origin: center center;
}

/* --- Spin Button --- */
#spin-button {
    padding: 25px 80px;
    font-size: 48px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #e94560, #ff6347);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

#spin-button:active {
    transform: scale(0.95);
}

#spin-button:disabled {
    background: linear-gradient(45deg, #888, #666);
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- Admin Panel --- */
#toggle-admin-button, #fullscreen-button {
    position: absolute;
    right: 20px;
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    z-index: 100;
	opacity: 1%;
}

#toggle-admin-button {
	text-decoration: none;
    top: 20px;
}

#fullscreen-button {
    top: 75px;
	right: 25px;
}

#admin-panel {
    position: absolute;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background-color: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(5px);
    padding: 40px;
    box-sizing: border-box;
    z-index: 99;
    transition: left 0.5s ease-in-out;
    overflow-y: auto;
}

#admin-panel.show {
    left: 0;
}

#admin-panel.admin-page-panel {
    position: relative;
    left: auto;
    width: 100%;
    max-width: 1200px; /* Constrain width */
    margin: 0 auto; /* Center it */
    height: auto;
    min-height: 100%;
    transition: none;
}

#admin-panel h2 {
    text-align: center;
    margin-top: 0;
    font-size: 48px;
    color: #e94560;
}

#admin-panel fieldset {
    border: 2px solid #0f3460;
    border-radius: 10px;
    margin-bottom: 30px;
}

#admin-panel legend {
    font-size: 32px;
    font-weight: bold;
    padding: 0 10px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group label {
    flex-basis: 40%;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 10%;
    padding: 10px;
    font-size: 22px;
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 5px;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.color-picker-group input[type="color"] {
    min-width: 60px;
    height: 40px;
    padding: 0;
    border: none;
    cursor: pointer;
}

.color-picker-group input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 22px;
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 5px;
}

.image-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.image-preview {
    width: 100px;
    height: 56px; /* 16:9 aspect ratio */
    border: 2px solid #0f3460;
    border-radius: 5px;
    object-fit: cover;
    display: none; /* Hidden by default */
}

.image-preview.show {
    display: block;
}

#slices-list .slice-item,
#apng-layers-list .apng-layer-item,
#player-form-fields-list .player-form-field-item {
    padding: 20px;
    background-color: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.apng-layer-item {
    grid-template-columns: 1fr;
}

.apng-layer-item-header,
.slice-item-header,
.player-form-field-item-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
	margin-bottom: 0px;
    cursor: pointer;
}

.drag-handle {
    display: inline-block;
    width: 20px;
    height: 30px;
    cursor: grab;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 30" fill="%23ffffff"><circle cx="5" cy="5" r="2"/><circle cx="15" cy="5" r="2"/><circle cx="5" cy="15" r="2"/><circle cx="15" cy="15" r="2"/><circle cx="5" cy="25" r="2"/><circle cx="15" cy="25" r="2"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
}

.slice-item-buttons {
    display: flex;
    gap: 10px;
}

.duplicate-slice-button {
    background: #0f3460;
    color: white;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
}

.slice-item-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 20px;
}

.slice-image-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.slice-image-controls.hidden {
    display: none;
}

.slice-item.active > .slice-item-content {
    max-height: 1000vh; /* Large enough to not clip content */
    padding: 20px 0 0 0;
    transition: max-height 0.3s ease-in, padding 0.3s ease-in;
}

.slice-item-content .layout-control {
    grid-column: 1 / -1;
}

.player-form-field-item > div:not(.player-form-field-item-header) {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, margin 0.3s ease-out;
    padding: 0 20px;
    margin: 0;
}

.player-form-field-item.active > div:not(.player-form-field-item-header) {
    max-height: 1000vh; /* Large enough to not clip content */
    padding: 10px 0;
    margin-top: 15px;
    transition: max-height 0.3s ease-in, padding 0.3s ease-in, margin 0.3s ease-in;
}

#add-slice-button, #apply-changes-button, #add-player-form-field-button {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background-color: #e94560;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
}

.remove-slice-button, .remove-player-form-field-button {
    background: #5a202c;
    color: white;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}

/* --- Settings Management Buttons --- */
.settings-io {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.io-button {
    flex-grow: 1;
    padding: 15px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background-color: #0f3460;
    border: 1px solid #e94560;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.io-button:hover {
    background-color: #1a4a8a;
}

.io-button.danger {
    background-color: #a12c2c;
    border-color: #ff6347;
}

.io-button.danger:hover {
    background-color: #c73e3e;
}

/* --- Audio Control Styles --- */
.audio-control-group {
    /* display: flex; */
    display: grid;
    /* justify-content: space-between; */
    grid-template-columns: 29% 71%;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #1a1a2e;
    border-radius: 8px;
}

.audio-control-group label {
    font-size: 24px;
    font-weight: bold;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#theme-select + .io-button {
    margin-left: 10px;
}

.preview-button {
    padding: 5px 5px;
    font-size: 18px;
    min-width: 40px;
    text-align: center;
}

.audio-controls select {
    min-width: 300px;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

#lights-animation {
    min-width: 300px;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

.apng-layer-enabled {
	width: 25px;
    height: 25px;
}

#confetti-toggle {
	width: 25px;
    height: 25px;
}

#screen-glow-enabled {
	width: 25px;
    height: 25px;
}

#needle-glow-enabled {
	width: 25px;
    height: 25px;
}

#glow-enabled {
	width: 25px;
    height: 25px;
}

#logo-spins {
	width: 25px;
    height: 25px;
}

.slice-uppercase {
	width: 25px;
    height: 25px;
}

.slice-is-prize {
	width: 25px;
    height: 25px;
}

.remove-apng-layer-button {
	max-width: 125px;
}

.audio-controls input[type="checkbox"] {
    width: 25px;
    height: 25px;
}


/* --- Animated Win Popup --- */
#popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 11;
    backdrop-filter: blur(5px);
    display: none;
}

#popup-overlay.show {
    display: flex;
}

#popup-box {
    width: var(--popup-width, 80%);
    background: linear-gradient(145deg, #1e3c72, #2a5298);
    border: 3px solid #ffd700;
    padding: 50px 80px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    animation: spin-fade-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#popup-image {
    max-width: 80%;
    max-height: 300px;
    margin: 0 auto 20px auto;
    border-radius: 10px;
    display: none;
    object-fit: contain;
}

#popup-title {
    font-size: var(--popup-title-size, 64px);
    margin-top: 0;
    color: #ffd700;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
}

#popup-message {
    font-size: var(--popup-prize-size, 40px);
    margin: 20px 0 40px;
}

#popup-close-button {
    padding: 20px 60px;
    font-size: var(--popup-button-size, 32px);
    font-weight: bold;
    color: #1a1a2e;
    background: #ffd700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#popup-close-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

#popup-countdown {
    font-size: var(--popup-button-size, 32px);
    font-weight: bold;
    color: #ffd700;
    margin-top: 20px;
}

/* --- APNG Animation Layer --- */
#animation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    pointer-events: none;
    overflow: hidden;
}

.apng-animation {
    position: absolute;
    object-fit: contain;
    display: none;
    transform-origin: center center;
}

.apng-animation.show {
    display: block;
}

/* --- PIN Entry Popup --- */
#pin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 250;
    backdrop-filter: blur(8px);
    display: none;
}

#pin-overlay.show {
    display: flex;
}

#pin-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 600px; /* Increased max-width */
    animation: spin-fade-in 0.5s ease-out;
}

#pin-title {
    font-size: 52px; /* Increased font size */
    margin: 0 0 25px 0;
    color: #e94560;
}

#pin-error {
    color: #ff6347;
    font-size: 22px;
    margin: 0 0 15px 0;
}

#pin-error.hidden {
    display: none;
}

#pin-input {
    width: 100%;
    padding: 20px; /* Increased padding */
    font-size: 48px; /* Increased font size */
    text-align: center;
    letter-spacing: 15px;
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

#pin-submit-button {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background-color: #e94560;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* --- Playlist Name Popup --- */
#playlist-name-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 250;
    backdrop-filter: blur(8px);
    display: none;
}

#playlist-name-overlay.show {
    display: flex;
}

#playlist-name-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 600px;
    animation: spin-fade-in 0.5s ease-out;
}

#playlist-name-title {
    font-size: 52px;
    margin: 0 0 25px 0;
    color: #e94560;
}

#playlist-name-error {
    color: #ff6347;
    font-size: 22px;
    margin: 0 0 15px 0;
}

#playlist-name-error.hidden {
    display: none;
}

#playlist-name-input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    text-align: center;
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

#playlist-name-submit-button {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background-color: #e94560;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}


/* --- Toast Notification --- */
#toast-notification {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30, 60, 114, 0.9);
    color: white;
    padding: 25px 50px;
    border-radius: 50px;
    border: 2px solid #ffd700;
    font-size: 32px;
    font-weight: bold;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

#toast-notification.show {
    animation: fade-in-out 3s ease-in-out forwards;
}

@keyframes fade-in-out {
    0% {
        opacity: 0;
        top: 50px;
    }
    20% {
        opacity: 1;
        top: 100px;
    }
    80% {
        opacity: 1;
        top: 100px;
    }
    100% {
        opacity: 0;
        top: 50px;
    }
}


/* --- Generic Animations & Helpers --- */
.hidden {
    display: none;
}

@keyframes spin-fade-in {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* --- Translations Popup --- */

#translations-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 300;
    backdrop-filter: blur(8px);
}

#translations-overlay.hidden {
    display: none;
}

#translations-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    width: 80%;
    max-width: 900px;
    height: 80%;
    display: flex;
    flex-direction: column;
}

#translations-box h2 {
    text-align: center;
    margin-top: 0;
    font-size: 48px;
    color: #e94560;
}

#translations-form {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 20px; /* For scrollbar */
}

.translation-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.translation-form-group input.translation-input {
    width: 100%;
}

body.admin-page #app-container {
    width: 100%;
	height: 100vh;
    border: none;
}

.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.layout-control label {
    flex-basis: 40%; /* Adjust label width */
}

.layout-control input[type="range"] {
    width: 70%;
}

.slider-value {
    width: 10%;
    font-size: 22px;
    font-weight: bold;
    color: #e94560;
    text-align: right;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 5px;
    padding: 5px;
    box-sizing: border-box;
}

.slice-text {
	width: 45%!important;
}

.slice-popup-title {
	width: 45%!important;
}

.slice-popup-button {
	width: 45%!important;
}

.slice-probability {
	width: 45%!important;
}

.slice-stock {
	width: 45%!important;
}

.form-group.translation-form-group {
	width: 70%!important;
}

/* --- Collapsible Sections --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.collapsible-controls {
    display: flex;
    gap: 10px;
}

fieldset.collapsible > legend {
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

fieldset.collapsible > legend::after {
    content: '▼';
    margin-right: 20px;
    transition: transform 0.3s ease;
}

fieldset.collapsible.active > legend::after {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    padding: 0 20px;
}

fieldset.collapsible.active > .collapsible-content {
    max-height: 1000vh; /* Large enough to not clip content */
    padding: 20px 20px 0 20px;
    transition: max-height 0.3s ease-in, padding 0.3s ease-in;
}

#admin-panel .floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200;
}

/* --- Player Information Form --- */
#player-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 11;
    backdrop-filter: blur(5px);
    display: none;
}

#player-form-overlay.show {
    display: flex;
}

#player-form-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#player-form-background img,
#player-form-background video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


#player-form-bg-veil {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* Veil is black */
    opacity: 0.5; /* Default opacity */
}

#player-form-box {
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
    padding-right: 20px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    animation: spin-fade-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#player-form-logo {
    max-width: 200px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#player-form .form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}

#player-form label {
    margin-bottom: 5px;
    font-size: 18px;
}

#player-form input,
#player-form textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box; /* Add this */
}

#player-form .checkbox-group {
    display: block;
}

#player-form .checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px; /* Optional: for spacing between checkbox items */
}

#player-form .checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    margin-right: 10px;
}

#player-form .checkbox-item input[type="checkbox"]:checked {
    background-color: var(--checkbox-bg-color, #e94560);
    border-color: var(--checkbox-bg-color, #e94560);
}

#player-form .checkbox-item input[type="checkbox"]:checked::after {
    content: '✔';
    font-size: 20px;
    color: var(--checkbox-checkmark-color, white);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#player-form-submit {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: #e94560;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
}

.fade-in {
    animation: fade-in 0.5s ease-in-out forwards;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.player-form-field-type {
    min-width: 300px;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

input.player-form-field-label {
      flex-grow: 0;
      flex-shrink: 0;
      flex-basis: 20%;
}

textarea.player-form-field-options {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 12px;
  font-family: 'Arial', sans-serif; /* Or another modern font */
  font-size: 1rem; /* Use relative units */
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  outline: none; /* Remove default outline */
  resize: vertical; /* Allow only vertical resizing */
}

textarea.player-form-field-options:focus {
  border-color: #007bff; /* Highlight border on focus */
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); /* Subtle shadow change on focus */
}

.checkbox-item label {
      white-space: nowrap; /* Prevents text from wrapping */
}

.remove-player-form-field-button.io-button.danger {
    flex-grow: 0!important;
}

#lose-sound-volume-value, #popup-sound-volume-value, #win-sound-volume-value, #spin-sound-volume-value, #background-music-volume-value {
    width: 12.8%;
}

#win-sound-interruption-volume-value {
    width: 11%;
}

#background-music-volume, #spin-sound-volume, #win-sound-volume, #lose-sound-volume, #popup-sound-volume, #win-sound-interruption-volume {
    width: 35%;
}

#win-sound-interruption-volume {
    width: 84%;
}

/* --- Responsive Design for Admin Panel --- */
@media (max-width: 768px) {
    #admin-panel.admin-page-panel {
        padding: 15px;
        padding-bottom: 105px; /* Add space for the floating action bar */
    }

    .admin-header {
        margin-left: 50px;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .audio-control-group {
        display: grid;
        align-items: center;
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
        grid-template-columns: 80% 20%;
    }

    .form-group label {
        flex-basis: auto;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .color-picker-group,
    .image-controls,
    .audio-controls,
    .layout-control input[type="range"],
    .slider-value {
        width: 100%;
    }

    .audio-controls {
        display: contents;
    }

    #background-music-volume, #spin-sound-volume, #win-sound-volume, #lose-sound-volume, #popup-sound-volume, #win-sound-interruption-volume {
        width: auto;
        flex: 1 1 80px;
    }

    #lose-sound-volume-value, #popup-sound-volume-value, #win-sound-volume-value, #spin-sound-volume-value, #background-music-volume-value,
    #win-sound-interruption-volume-value {
        width: auto;
        min-width: 35px;
        text-align: right;
        margin-right: 10px;
    }

    .preview-button {
        margin-right: 10px;
    }

    .audio-controls input[type="checkbox"] {
    width: 25px;
    height: 25px;
    margin-right: auto;
    margin-left: auto;
    }

    .color-picker-group input[type="text"] {
        width: calc(100% - 70px);
    }

    .audio-controls select,
    #lights-animation {
        min-width: 0;
        width: auto;
        flex: 2 1 120px;
    }

    #admin-panel h2 {
        font-size: 22px;
    }

    #admin-panel legend {
        font-size: 18px;
    }

    .form-group,
    .audio-control-group label,
    .io-button,
    .form-group input[type="text"],
    .form-group input[type="number"],
    .color-picker-group input[type="text"],
    .audio-controls select,
    #lights-animation,
    .slider-value {
        font-size: 14px;
    }

    .slice-item-header {
        font-size: 16px;
    }

    .floating-actions {
        flex-direction: row;
        bottom: 0;
        left: auto;
        width: 300px;
        right: auto;
        padding: 10px;
        padding-top: 0px;
        background-color: rgba(22, 33, 62, 0.98);
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    }

    #add-slice-button,
    #apply-changes-button {
        font-size: 18px;
        padding: 12px;
    }

    #pin-box {
        padding: 20px;
        margin-bottom: 200px;
    }

    #pin-title {
        font-size: 22px;
    }

    #pin-input {
        font-size: 22px;
        padding: 15px;
    }

    #pin-submit-button {
        font-size: 22px;
    }

}

body.game-page #language-selector {
    display: none;
}

/* --- Multimedia Manager --- */
.media-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #0f3460;
}

.media-item.folder {
    cursor: pointer;
    font-weight: bold;
}

.media-item.folder:hover {
    background-color: #1a4a8a;
}

.media-item .media-preview {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: 5px;
}

.media-item .media-name {
    flex-grow: 1;
}

#sound-manager-breadcrumbs {
    padding: 10px;
    background-color: #1a1a2e;
    border-radius: 5px;
    margin-bottom: 10px;
}

#sound-manager-breadcrumbs .breadcrumb {
    cursor: pointer;
    color: #e94560;
}

#sound-manager-breadcrumbs .breadcrumb:hover {
    text-decoration: underline;
}

#sound-manager-list {
    border: 2px dashed #0f3460;
    padding: 20px;
    border-radius: 10px;
    min-height: 150px;
    transition: border-color 0.3s, background-color 0.3s;
}

#sound-manager-list.drag-over {
    border-color: #e94560;
    background-color: rgba(233, 69, 96, 0.1);
}

/* --- Image Lightbox --- */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#lightbox-overlay.hidden {
    display: none;
}

#lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#lightbox-close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: color 0.2s;
}

#lightbox-close-button:hover {
    color: #e94560;
}

/* --- Activation Form --- */
#activation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 250;
    backdrop-filter: blur(8px);
    display: none;
}

#activation-overlay.show {
    display: flex;
}

#activation-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 600px;
    animation: spin-fade-in 0.5s ease-out;
}

#activation-box h2 {
    font-size: 52px;
    margin: 0 0 15px 0;
    color: #e94560;
}

#activation-box p {
    font-size: 22px;
    margin: 0 0 25px 0;
}

#activation-form input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    text-align: center;
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

#activation-form button {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background-color: #e94560;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#activation-message {
    font-size: 22px;
    margin-top: 20px;
    min-height: 25px;
}

/* Choices.js Custom Styling */
#admin-panel .choices__inner {
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
    color: white;
    padding: 8px;
    font-size: 22px;
    border-radius: 5px;
    text-align: center;
}

#admin-panel .choices__list--dropdown {
    background-color: #1a1a2e;
    border: 1px solid #0f3460;
}

#admin-panel .choices__list--single .choices__item,
#admin-panel .choices__item--choice {
    color: white;
    text-align: center;
}

#admin-panel .choices__input {
    background-color: #1a1a2e;
    color: white;
    text-align: center;
}

#admin-panel .choices__item--choice.is-highlighted {
    background-color: #0f3460;
}

.choices[data-type*="select-one"] .choices__inner {
    padding-bottom: 8px;
}

.form-group .choices {
    flex-grow: 1;
    width: 100%;
}

#theme-name-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 250;
    backdrop-filter: blur(8px);
    display: none;
}

#theme-name-overlay.show {
    display: flex;
}

#theme-name-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 600px;
    animation: spin-fade-in 0.5s ease-out;
}

#theme-name-box h2 {
    font-size: 52px;
    margin: 0 0 25px 0;
    color: #e94560;
}

#theme-name-input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    text-align: center;
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: white;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.theme-name-buttons {
    display: flex;
    gap: 15px;
}

#needle-position {
    min-width: 300px;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

#head-content-fieldset .head-content-input {
    width: 80%;
}

#double-click-fullscreen-enabled {
    width: 25px;
    height: 25px;
}

.slice-glow-enabled {
    width: 25px;
    height: 25px;
}

/* --- Confirmation Popup --- */
#confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 400;
    backdrop-filter: blur(8px);
    display: none;
}

#confirmation-overlay.show {
    display: flex;
}

#confirmation-box {
    background: #1a1a2e;
    border: 2px solid #e94560;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 600px;
    animation: spin-fade-in 0.5s ease-out;
}

#confirmation-box h2 {
    font-size: 36px;
    margin: 0 0 15px 0;
    color: #e94560;
}

#confirmation-box p {
    font-size: 22px;
    margin: 0 0 25px 0;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* --- Spin Button Rainbow Effect --- */
@keyframes rainbow-outwards-from-center {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes rainbow-from-left-to-right {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes rainbow-from-right-to-left {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbow-outwards-in-a-circular-motion {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes rainbow-flashing-and-moving {
    0%, 100% { background-position: 0% 50%; opacity: 1; }
    50% { background-position: 100% 50%; opacity: 0.5; }
}

#spin-button:hover.rainbow-effect {
    background-size: var(--rainbow-size, 200%) var(--rainbow-size, 200%);
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-direction: alternate;
}

.rainbow-outwards-from-center {
    animation-name: rainbow-outwards-from-center;
}

#spin-button:hover.rainbow-outwards-from-center {
    background-image: radial-gradient(circle, var(--rainbow-colors));
}

.rainbow-from-left-to-right {
    animation-name: rainbow-from-left-to-right;
}

#spin-button:hover.rainbow-from-left-to-right {
    background-image: linear-gradient(to right, var(--rainbow-colors));
}

.rainbow-from-right-to-left {
    animation-name: rainbow-from-right-to-left;
}

#spin-button:hover.rainbow-from-right-to-left {
    background-image: linear-gradient(to left, var(--rainbow-colors));
}

.rainbow-outwards-in-a-circular-motion {
    animation-name: rainbow-outwards-in-a-circular-motion;
}

#spin-button:hover.rainbow-outwards-in-a-circular-motion {
    background-image: conic-gradient(var(--rainbow-colors));
}

.rainbow-flashing-and-moving {
    animation-name: rainbow-flashing-and-moving;
}

#spin-button:hover.rainbow-flashing-and-moving {
    background-image: linear-gradient(to right, var(--rainbow-colors));
}

.delete-media-button {
	width: 40px;
}

.analytics-header {
	margin-top: 50px;
}

#spin-button-rainbow-effect {
	width: 25px;
    height: 25px;
}

.form-group select, .io-select {
	min-width: 300px;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

/* Slice Text Customization */
.slice-text-underline {
    text-decoration: underline;
}

.slice-text-line-break {
    white-space: normal;
    word-wrap: break-word;
}

#head-content-fieldset input[type="text"] {
    width: 80%;
    padding: 10px;
    font-size: 20px;
    background-color: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 5px;
}

.prize-slice {
    color: yellow;
}
