.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background-color: rgba(18, 46, 49, 0.95); /* Dark background */
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transform: translateX(100%);
    color: var(--teal-light); /* Light text color */
}

.side-panel.open {
    transform: translateX(0);
}

#image-library {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    background-color: rgba(18, 46, 49, 0.95); /* Dark background */
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    transform: translateX(100%);
    color: var(--teal-light); /* Light text color */
}

#image-library.open {
    transform: translateX(0);
}

#image-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

#image-library .image-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 5px;
}

#image-library img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

#image-library img:hover {
    opacity: 0.8;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
}

#image-library .image-container:hover .remove-image {
    display: block;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.player-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.player-controls input[type="number"] {
    width: 60px;
    margin-right: 5px;
}

.player-controls label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.enemy-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.enemy-item {
    background-color: rgba(var(--teal-rgb), 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
}

.enemy-controls {
    display: none;
    padding: 8px;
    background-color: rgba(var(--teal-rgb), 0.2);
    border-radius: 4px;
}

.enemy-controls.active {
    display: block;
}

.enemy-name {
    font-weight: 500;
    color: var(--teal-light);
}

.enemy-controls input[type="number"] {
    background-color: rgba(var(--teal-rgb), 0.2);
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--teal-light);
    width: 80px;
}

.enemy-controls label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--teal-light);
}

.enemy-controls label span {
    min-width: 120px;
}

.enemy-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.enemy-actions button {
    flex: 1;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.enemy-actions button.save {
    background-color: #059669;
}

.enemy-actions button.save:hover {
    background-color: #047857;
}

.enemy-actions button.back {
    background-color: #6b7280;
}

.enemy-actions button.back:hover {
    background-color: #4b5563;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.sword-icon {
    fill: white;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== SOUND LIBRARY STYLES ===== */

#sound-library {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 450px;
    background: linear-gradient(135deg, rgba(18, 46, 49, 0.95) 0%, rgba(18, 46, 49, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(var(--teal-light-rgb), 0.3);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    transform: translateX(100%);
    color: var(--teal-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#sound-library.open {
    transform: translateX(0);
}

/* Header Styles */
.sound-library-header {
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid rgba(var(--teal-light-rgb), 0.3);
    background: rgba(18, 46, 49, 0.4);
}

.sound-library-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px var(--cyan-glow);
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(var(--teal-rgb), 0.2);
    border: none;
    border-radius: 8px;
    color: var(--teal-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(var(--teal-rgb), 0.2);
    color: #ffffff;
    transform: scale(1.05);
}

/* Upload Area Styles */
.sound-upload-area {
    margin-bottom: 20px;
}

.upload-dropzone {
    display: block;
    width: 100%;
    padding: 24px;
    background: rgba(18, 46, 49, 0.6);
    border: 2px dashed rgba(var(--teal-light-rgb), 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-dropzone:hover {
    border-color: var(--cyan);
    background: rgba(var(--cyan-rgb), 0.05);
    transform: translateY(-2px);
}

.upload-dropzone.drag-over {
    border-color: var(--cyan);
    background: rgba(var(--cyan-rgb), 0.1);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #6b7280;
    transition: color 0.3s ease;
}

.upload-dropzone:hover .upload-icon {
    color: var(--cyan);
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--teal-light);
}

.sub-text {
    font-size: 14px;
    color: var(--teal-medium);
}

/* Controls Styles */
.sound-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #6b7280;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(18, 46, 49, 0.8);
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    border-radius: 10px;
    color: var(--teal-light);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
}

.search-input::placeholder {
    color: #6b7280;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(18, 46, 49, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
}

.volume-icon {
    width: 18px;
    height: 18px;
    color: var(--teal-medium);
    flex-shrink: 0;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s ease;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--orange);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--orange-glow);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--orange-dark);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--orange);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.volume-label {
    font-size: 12px;
    color: var(--teal-medium);
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

/* Game Settings Panel Styles */
.settings-section {
    background: rgba(18, 46, 49, 0.6);
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    border-radius: 12px;
    padding: 20px;
}

.settings-item {
    margin-bottom: 16px;
}

.volume-control-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(18, 46, 49, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    transition: border-color 0.2s ease;
}

.volume-control-settings:hover {
    border-color: var(--cyan);
}

.volume-icon-settings {
    width: 18px;
    height: 18px;
    color: var(--teal-medium);
    flex-shrink: 0;
}

.volume-slider-settings {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 3px;
    outline: none;
    transition: background 0.2s ease;
}

.volume-slider-settings::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--orange);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--orange-glow);
}

.volume-slider-settings::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--orange-dark);
    box-shadow: 0 3px 8px var(--orange-glow);
}

.volume-slider-settings::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--orange);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.volume-label-settings {
    font-size: 13px;
    color: var(--teal-light);
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

/* Checkbox styling for dark theme */
#game-settings-panel input[type="checkbox"] {
    background-color: rgba(var(--teal-rgb), 0.2);
    border-color: rgba(var(--teal-light-rgb), 0.3);
}

#game-settings-panel input[type="checkbox"]:checked {
    background-color: var(--orange);
    border-color: var(--orange);
}

/* Content Styles */
.sound-library-content {
    flex: 1;
    padding: 20px 0px 24px 0px;
    overflow-y: auto;
    height: calc(100vh - 280px);
}

.sound-library-content::-webkit-scrollbar {
    width: 6px;
}

.sound-library-content::-webkit-scrollbar-track {
    background: rgba(18, 46, 49, 0.3);
    border-radius: 3px;
}

.sound-library-content::-webkit-scrollbar-thumb {
    background: rgba(var(--teal-rgb), 0.3);
    border-radius: 3px;
}

.sound-library-content::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--teal-rgb), 0.5);
}

/* Sound Grid */
.sound-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Sound Card Styles */
.sound-card {
    background: rgba(18, 46, 49, 0.8);
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sound-card:hover {
    background: rgba(18, 46, 49, 0.9);
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.sound-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sound-info {
    flex: 1;
    min-width: 0;
}

.sound-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sound-duration {
    font-size: 12px;
    color: var(--teal-medium);
}

.sound-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.play-btn, .soundboard-btn, .tags-btn, .delete-btn {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.play-btn {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 100%);
    color: white;
    box-shadow: 0 2px 8px var(--cyan-glow);
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--cyan-glow);
}

.play-btn.playing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 0;
    transition: all 0.2s ease;
}

.sound-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
	background: rgba(239, 68, 68, 0.2);
	transform: scale(1.1);
}

.soundboard-btn {
	background: rgba(147, 51, 234, 0.1);
	color: #a855f7;
}

.soundboard-btn:hover {
	background: rgba(147, 51, 234, 0.2);
	transform: scale(1.1);
}

.soundboard-btn.on-soundboard {
	background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
	color: white;
	box-shadow: 0 2px 8px var(--cyan-glow);
}

.soundboard-btn.on-soundboard:hover {
	background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
	box-shadow: 0 4px 12px var(--cyan-glow);
}

.tags-btn {
	background: rgba(var(--cyan-rgb), 0.1);
	color: var(--cyan);
}

.tags-btn:hover {
	background: rgba(var(--cyan-rgb), 0.2);
	transform: scale(1.1);
}

/* Sound Tags */
.sound-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0;
}

.sound-tag {
	background: rgba(var(--cyan-rgb), 0.2);
	color: var(--cyan);
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
}

/* Sound Board Indicator */
.soundboard-indicator {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	box-shadow: 0 2px 8px var(--cyan-glow);
	z-index: 10;
}

.sound-waveform {
    height: 40px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 6px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.waveform-progress {
    height: 100%;
    background: linear-gradient(90deg, rgba(var(--cyan-rgb), 0.3) 0%, rgba(var(--cyan-rgb), 0.6) 100%);
    border-radius: 6px;
    width: 0%;
    transition: width 0.1s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--teal-medium);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Tags Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	backdrop-filter: blur(4px);
}

.tags-modal {
	background: linear-gradient(135deg, rgba(18, 46, 49, 0.95) 0%, rgba(18, 46, 49, 0.95) 100%);
	border-radius: 16px;
	border: 1px solid rgba(var(--teal-light-rgb), 0.3);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	overflow: hidden;
}

.modal-header {
	padding: 20px 24px;
	border-bottom: 1px solid rgba(var(--teal-light-rgb), 0.3);
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(18, 46, 49, 0.4);
}

.modal-header h3 {
	margin: 0;
	color: var(--teal-light);
	font-size: 18px;
	font-weight: 600;
}

.close-modal-btn {
	background: rgba(var(--teal-rgb), 0.2);
	border: none;
	border-radius: 8px;
	color: #9ca3af;
	cursor: pointer;
	padding: 8px;
	transition: all 0.2s ease;
}

.close-modal-btn:hover {
	background: rgba(var(--teal-rgb), 0.2);
	color: #ffffff;
	transform: scale(1.05);
}

.modal-content {
	padding: 24px;
	overflow-y: auto;
}

.tags-input-container {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}

#sound-tag-input {
	flex: 1;
	padding: 10px 12px;
	background: rgba(18, 46, 49, 0.8);
	border: 1px solid rgba(var(--teal-light-rgb), 0.3);
	border-radius: 8px;
	color: var(--teal-light);
	font-size: 14px;
	transition: all 0.2s ease;
}

#sound-tag-input:focus {
	outline: none;
	border-color: var(--cyan);
	box-shadow: 0 0 0 3px var(--cyan-glow);
}

.add-tag-btn {
	padding: 10px 16px;
	background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
	border: none;
	border-radius: 8px;
	color: white;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.add-tag-btn:hover {
	background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 100%);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px var(--orange-glow);
}

.current-tags h4 {
	margin: 0 0 12px 0;
	color: #d1d5db;
	font-size: 14px;
	font-weight: 600;
}

.tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
	min-height: 40px;
	padding: 12px;
	background: rgba(18, 46, 49, 0.6);
	border-radius: 8px;
	border: 1px solid rgba(var(--teal-light-rgb), 0.3);
}

.tag-item {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(var(--cyan-rgb), 0.2);
	color: var(--cyan);
	padding: 6px 12px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 500;
	border: 1px solid rgba(var(--cyan-rgb), 0.3);
}

.remove-tag-btn {
	background: none;
	border: none;
	color: #ef4444;
	cursor: pointer;
	font-weight: bold;
	padding: 0;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.remove-tag-btn:hover {
	background: rgba(239, 68, 68, 0.2);
	transform: scale(1.1);
}

.modal-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

.save-tags-btn {
	padding: 10px 20px;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	border: none;
	border-radius: 8px;
	color: white;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.save-tags-btn:hover {
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px var(--cyan-glow);
}

.cancel-btn {
	padding: 10px 20px;
	background: rgba(var(--teal-rgb), 0.2);
	border: none;
	border-radius: 8px;
	color: #d1d5db;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: rgba(var(--teal-rgb), 0.4);
	transform: translateY(-1px);
}

/* Music Library - Updated to match Sound Library styling */
#music-library {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 450px;
    background: linear-gradient(135deg, rgba(18, 46, 49, 0.95) 0%, rgba(18, 46, 49, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(var(--teal-light-rgb), 0.3);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    transform: translateX(100%);
    color: var(--teal-light);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#music-library.open {
    transform: translateX(0);
}

/* Music Library Header Styles */
.music-library-header {
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid rgba(var(--teal-light-rgb), 0.3);
    background: rgba(18, 46, 49, 0.4);
}

.music-library-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Music Upload Area Styles */
.music-upload-area {
    margin-bottom: 20px;
}

/* Music Library Content Styles */
.music-library-content {
    flex: 1;
    padding: 20px 0x 24px 0px;
    overflow-y: auto;
    height: calc(100vh - 350px);
}

.music-library-content::-webkit-scrollbar {
    width: 6px;
}

.music-library-content::-webkit-scrollbar-track {
    background: rgba(18, 46, 49, 0.3);
    border-radius: 3px;
}

.music-library-content::-webkit-scrollbar-thumb {
    background: rgba(var(--teal-rgb), 0.3);
    border-radius: 3px;
}

.music-library-content::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--teal-rgb), 0.5);
}

/* Music Grid */
.music-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Music Card Styles */
.music-card {
    background: rgba(18, 46, 49, 0.8);
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.music-card:hover {
    background: rgba(18, 46, 49, 0.9);
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.music-card.background-music-playing {
    background: rgba(var(--cyan-rgb), 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.music-card.background-music-playing:hover {
    background: rgba(var(--cyan-rgb), 0.15);
    border-color: var(--cyan);
    box-shadow: 0 8px 25px var(--cyan-glow);
}

.background-music-indicator {
    margin-bottom: 8px;
}

.music-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.music-info {
    flex: 1;
    min-width: 0;
}

.music-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-duration {
    font-size: 12px;
    color: var(--teal-medium);
    font-weight: 500;
}

.music-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.music-play-btn {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-play-btn:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: scale(1.05);
}

.music-play-btn.playing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.music-play-btn.playing:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.music-background-btn {
    padding: 6px 12px;
    background: rgba(var(--cyan-rgb), 0.1);
    border: 1px solid rgba(var(--cyan-rgb), 0.3);
    border-radius: 6px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.music-background-btn:hover {
    background: rgba(var(--cyan-rgb), 0.2);
    border-color: var(--cyan);
}

.music-remove-btn {
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.05);
}

.music-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.music-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
    width: 0%;
    transition: width 0.1s ease;
}

.music-tags {
    font-size: 12px;
    color: var(--teal-medium);
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.music-tag {
    background: rgba(var(--teal-rgb), 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: var(--teal-light);
}

/* Volume Slider Styles for Music Library */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 3px;
    outline: none;
    transition: all 0.2s ease;
}

.volume-slider:hover {
    background: rgba(var(--teal-rgb), 0.3);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Empty State Styles for Music Library */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--teal-medium);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--teal-light);
}

.empty-state p {
    font-size: 14px;
    color: var(--teal-medium);
    margin: 0;
}

/* Fix iframe wobbling during panning */
#iframe-container {
    scroll-behavior: auto !important; /* Disable smooth scrolling */
    will-change: scroll-position; /* Optimize for frequent scroll changes */
}

#game-iframe {
    will-change: transform; /* Optimize iframe rendering during zoom */
    backface-visibility: hidden; /* Prevent rendering artifacts */
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d; /* Better rendering performance */
}



#sound-effects-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    background-color: rgba(18, 46, 49, 0.95); /* Dark background */
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transform: translateX(100%);
    color: var(--teal-light); /* Light text color */
}

#sound-effects-panel.open {
    transform: translateX(0);
}

#sound-effects-buttons button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 5px;
}

#game-list li.selected {
    background-color: #4a5568;
    font-weight: bold;
}

/* Legacy slider styles removed - using improved styles below */

/* Add these new styles for input elements and buttons in dark mode */
.side-panel input[type="text"],
.side-panel input[type="number"],
#image-library input[type="file"],
#music-library input[type="file"] {
    background-color: #4b5563;
    color: var(--teal-light);
    border: 1px solid #6b7280;
}

.side-panel button,
#image-library button,
#music-library button,
#sound-effects-panel button {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: #ffffff;
}

.side-panel button:hover,
#image-library button:hover,
#music-library button:hover,
#sound-effects-panel button:hover {
    background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 100%);
    box-shadow: 0 0 15px var(--orange-glow);
}

/* Style for close buttons */
.side-panel button[onclick*="close"],
#image-library button[onclick*="close"],
#music-library button[onclick*="close"],
#sound-effects-panel button[onclick*="close"] {
    background-color: transparent;
    color: var(--teal-medium);
}

.side-panel button[onclick*="close"]:hover,
#image-library button[onclick*="close"]:hover,
#music-library button[onclick*="close"]:hover,
#sound-effects-panel button[onclick*="close"]:hover {
    background-color: rgba(var(--teal-rgb), 0.2);
    color: #ffffff;
}

.tooltip {
    position: relative;
}

.tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.tooltip:hover:before {
    opacity: 1;
}

/* Asset Library Styles */
#asset-library {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    background-color: rgba(31, 41, 55, 0.95);
    padding: 0;
    box-sizing: border-box;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    transform: translateX(100%);
    color: var(--teal-light);
}

#asset-library.open {
    transform: translateX(0);
}

.asset-item {
    position: relative;
    background-color: rgba(var(--teal-rgb), 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 2px solid transparent;
}

.asset-item:hover {
    background-color: rgba(var(--teal-rgb), 0.4);
    border-color: var(--orange);
}

.asset-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 4px;
}

.asset-item .asset-name {
    font-size: 10px;
    color: var(--teal-light);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-item .asset-type {
    font-size: 8px;
    color: var(--teal-medium);
    text-align: center;
    text-transform: uppercase;
}

.asset-item .remove-asset {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.asset-item:hover .remove-asset {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Board Asset Styles */
.board-asset {
    position: absolute;
    cursor: move;
    user-select: none;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.board-asset:hover {
    border-color: var(--orange);
}

.board-asset.selected {
    border-color: var(--orange);
    box-shadow: 0 0 10px var(--orange-glow);
}

.board-asset img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Board Hierarchy Styles */
.hierarchy-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.hierarchy-item:hover {
    background-color: rgba(var(--teal-rgb), 0.2);
}

.hierarchy-item.selected {
    background-color: rgba(var(--cyan-rgb), 0.2);
    border-color: var(--cyan);
}

.hierarchy-item.locked {
    opacity: 0.7;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Door-specific hierarchy styles */
.hierarchy-item[data-type="door"] {
    border-left: 3px solid #8B5A00;
}

.hierarchy-item[data-type="door"]:hover {
    background-color: rgba(139, 90, 0, 0.1);
}

.hierarchy-item[data-type="door"].selected {
    background-color: rgba(139, 90, 0, 0.2);
    border-color: rgba(139, 90, 0, 0.5);
}

.hierarchy-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hierarchy-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.hierarchy-item-name {
    font-size: 14px;
    font-weight: 500;
    truncate: true;
    margin-left: 8px;
}

.hierarchy-item-type {
    font-size: 12px;
    color: #9CA3AF;
    margin-left: 4px;
}

.hierarchy-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.hierarchy-item:hover .hierarchy-item-actions {
    opacity: 1;
}

.hierarchy-action-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.hierarchy-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hierarchy-btn:hover {
    transform: scale(1.1);
}

.hierarchy-btn-up {
    background-color: var(--cyan);
}

.hierarchy-btn-up:hover {
    background-color: var(--teal);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.hierarchy-btn-down {
    background-color: var(--orange);
}

.hierarchy-btn-down:hover {
    background-color: var(--orange-dark);
    box-shadow: 0 0 10px var(--orange-glow);
}

.hierarchy-btn-unlock {
    background-color: var(--cyan);
}

.hierarchy-btn-unlock:hover {
    background-color: var(--teal);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.hierarchy-btn-delete {
    background-color: #EF4444;
    font-size: 14px;
}

.hierarchy-btn-delete:hover {
    background-color: #DC2626;
}

.hierarchy-child {
    margin-left: 24px;
    position: relative;
}

.hierarchy-child::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(156, 163, 175, 0.3);
}

.hierarchy-group-header {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px 0;
    padding: 0 12px;
}

.hierarchy-group-header:first-child {
    margin-top: 0;
}

.hierarchy-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hierarchy-status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.lock-icon {
    color: #EF4444;
}

.visible-icon {
    color: var(--cyan);
}

.layer-badge {
    background-color: rgba(var(--teal-rgb), 0.5);
    color: var(--teal-light);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* CSS custom property for inverse zoom scaling - maintains constant visual size */
:root {
    --dropdown-zoom: 1; /* Parent window uses regular scaling, iframe uses inverse */
}

/* Use CSS transform scale instead of zoom - more reliable for UI elements */
.dropdown-zoomed {
    transform: scale(var(--dropdown-zoom)) !important;
    transform-origin: top left !important;
    z-index: 9999 !important;
}

/* Apply transform scale to specific dropdown elements */
#menu-items.dropdown-zoomed,
#mode-dropdown.dropdown-zoomed, 
#grid-controls.dropdown-zoomed,
#fog-controls.dropdown-zoomed,
#wall-controls.dropdown-zoomed,
#layer-context-menu.dropdown-zoomed {
    transform: scale(var(--dropdown-zoom)) !important;
    transform-origin: top left !important;
    z-index: 9999 !important;
}

/* Transform scale select elements */
select.dropdown-zoomed {
    transform: scale(var(--dropdown-zoom)) !important;
    transform-origin: top left !important;
    min-width: 100px;
    min-height: 30px;
    box-sizing: border-box;
}

/* Alternative: Direct font-size scaling approach */
.dropdown-font-scaled {
    font-size: calc(1rem * var(--dropdown-zoom)) !important;
}

.dropdown-font-scaled * {
    font-size: inherit !important;
}

/* Enhanced dropdown styling */
.bg-gray-750 {
    background-color: #374151;
}

/* Custom scrollbar for game list */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Dropdown arrow rotation animation */
.dropdown-arrow {
    transition: transform 0.2s ease-in-out;
}

/* Add some visual polish to dropdown containers */
#mode-dropdown,
#grid-controls,
#fog-controls,
#wall-controls {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Improved focus states for inputs */
input[type="number"]:focus,
input[type="range"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--cyan-glow);
}

/* Better range slider styling with visible backgrounds */
input[type="range"] {
    -webkit-appearance: none;
    background: #374151; /* Dark gray background for the entire slider */
    cursor: pointer;
    height: 8px;
    border-radius: 4px;
    border: 1px solid #4B5563;
    padding: 0;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-track {
    background: #4B5563; /* Darker track */
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: var(--orange);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--orange-glow);
    transition: all 0.2s ease;
    border: 2px solid #ffffff;
    margin-top: -6px; /* Better centered alignment on the track */
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--orange-dark);
    transform: scale(1.1);
    box-shadow: 0 3px 6px var(--orange-glow);
}

/* Firefox slider styling */
input[type="range"]::-moz-range-track {
    background: rgba(var(--teal-rgb), 0.2);
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: var(--orange);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px var(--orange-glow);
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--orange-dark);
}

/* Slider container styling for better visibility */
.slider-container, 
.space-y-2:has(input[type="range"]),
.space-y-6:has(input[type="range"]) {
    padding: 8px 12px;
    background: rgba(var(--teal-rgb), 0.2);
    border-radius: 6px;
    border: 1px solid rgba(var(--teal-light-rgb), 0.3);
    margin: 4px 0;
}

/* Ensure slider labels are visible */
label:has(+ input[type="range"]) {
    color: var(--teal-light);
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

/* Specific styling for sliders in panels */
.side-panel input[type="range"],
#player-panel input[type="range"],
#enemy-panel input[type="range"],
#npc-panel input[type="range"] {
    width: 100%;
    background: #374151;
    border: 1px solid #4B5563;
}

/* Specific high-priority transform rules for context menu */
#layer-context-menu.dropdown-zoomed {
    transform: scale(var(--dropdown-zoom)) !important;
    transform-origin: top left !important;
    font-size: calc(28px * var(--dropdown-zoom)) !important;
    z-index: 9999 !important;
}

#layer-context-menu.dropdown-font-scaled {
    font-size: calc(28px * var(--dropdown-zoom)) !important;
}

/* Quick Action HUD Styles */
#quick-hud {
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4);
    border-image: linear-gradient(90deg, 
        rgba(var(--cyan-rgb), 0.3) 0%, 
        rgba(var(--cyan-rgb), 0.3) 50%, 
        rgba(var(--cyan-rgb), 0.3) 100%) 1;
}

#quick-hud.show {
    transform: translateY(0) !important;
}

#quick-hud.edit-mode {
    border-top-color: var(--orange);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--orange-glow);
}

#hud-toggle-tab {
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
}

#sidebar-toggle {
    display: none; /* Hidden by default, shown when game loads */
}

#svelte-zoom-panel {
    display: none; /* Hidden by default, shown when game loads */
}

#hud-toggle-tab:hover {
    background-color: rgba(var(--teal-rgb), 0.6);
}

.hud-slot {
    width: 80px;
    height: 90px;
    border: 2px solid rgba(var(--teal-light-rgb), 0.4);
    border-radius: 8px;
    background: linear-gradient(135deg, 
        rgba(18, 46, 49, 0.8) 0%, 
        rgba(18, 46, 49, 0.8) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 4px;
}

.hud-slot:hover {
    border-color: var(--cyan);
    background: linear-gradient(135deg, 
        rgba(18, 46, 49, 0.9) 0%, 
        rgba(18, 46, 49, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 
                0 4px 8px var(--cyan-glow);
}

.hud-slot.assigned {
    border: 2px solid var(--cyan);
    background: linear-gradient(135deg, 
        rgba(var(--cyan-rgb), 0.1) 0%, 
        rgba(var(--cyan-rgb), 0.1) 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 
                0 0 8px var(--cyan-glow);
}

.hud-slot.assigned:hover {
    border-color: var(--cyan);
    background: linear-gradient(135deg, 
        rgba(var(--cyan-rgb), 0.2) 0%, 
        rgba(var(--cyan-rgb), 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 
                0 4px 12px var(--cyan-glow);
}

.hud-slot.drag-over {
    border-color: var(--cyan);
    background-color: rgba(var(--cyan-rgb), 0.2);
    transform: scale(1.05);
}

.hud-slot.dragging {
    opacity: 0.6;
    transform: scale(0.95) rotate(2deg);
    border-color: var(--orange);
    background-color: rgba(var(--orange-rgb), 0.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.hud-slot.edit-mode {
    border-style: solid;
}

.hud-slot.edit-mode:hover {
    border-color: #f59e0b;
}

.hud-slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    pointer-events: none;
}

.hud-slot-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    color: var(--teal-medium);
    transition: all 0.2s ease;
}

.hud-slot.assigned .hud-slot-icon {
    color: #22c55e;
}

.hud-slot:hover .hud-slot-icon {
    color: #6366f1;
}

.hud-slot.assigned:hover .hud-slot-icon {
    color: #16a34a;
}

/* Slot preview styles now handled inline in QuickHUD.svelte */

.hud-slot-label {
    font-size: 9px;
    color: var(--teal-light);
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-slot-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background-color: #ef4444;
    border: 2px solid #1f2937;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.hud-slot.edit-mode.assigned:hover .hud-slot-remove {
    display: flex;
}

.hud-slot-remove:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

.hud-slot-remove svg {
    width: 8px;
    height: 8px;
    color: white;
}

/* Drag and Drop Feedback */
.hud-drag-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(var(--cyan-rgb), 0.1) 30%, rgba(var(--cyan-rgb), 0.1) 70%, transparent 70%);
    background-size: 10px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hud-slot.drag-over .hud-drag-indicator {
    opacity: 1;
}

/* Animation for slot activation */
@keyframes hud-slot-activate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.hud-slot.activated {
    animation: hud-slot-activate 0.3s ease;
}

/* Sound wave animation for audio slots */
.hud-slot.playing .hud-slot-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* HUD Assignment Menu */
#hud-assignment-menu {
    background: linear-gradient(135deg, rgba(18, 46, 49, 0.95) 0%, rgba(18, 46, 49, 0.95) 100%);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#hud-assignment-menu button:hover {
    background: linear-gradient(135deg, rgba(var(--orange-rgb), 0.2) 0%, rgba(var(--cyan-rgb), 0.2) 100%);
}

/* HUD Responsive Design */
@media (max-width: 768px) {
    #quick-hud {
        padding: 12px 16px;
    }
    
    .hud-slot {
        width: 70px;
        height: 80px;
    }
    
    .hud-slot-icon {
        width: 16px;
        height: 16px;
    }
    
    .hud-slot-label {
        font-size: 8px;
    }
    
    #hud-grid {
        gap: 6px;
        grid-template-columns: repeat(6, 1fr);
    }
}

/* HUD Keyboard Shortcuts */
.hud-slot[data-shortcut]::after {
    content: attr(data-shortcut);
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--teal-light);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gaming HUD Effects */
#quick-hud::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(var(--cyan-rgb), 0.6) 25%, 
        rgba(var(--cyan-rgb), 0.6) 50%, 
        rgba(var(--orange-rgb), 0.6) 75%, 
        transparent 100%);
    animation: hudGlow 3s ease-in-out infinite;
}

@keyframes hudGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Facebook-style Character Profile */
.character-profile {
    background: rgba(31, 41, 55, 0.95);
}

.profile-banner {
    max-height: 330px;
    overflow: hidden;
}

.profile-banner img {
    transition: transform 0.3s ease;
}

.profile-banner:hover img {
    transform: scale(1.02);
}

/* Token avatar overlay styling */
.character-profile .absolute.-bottom-12 {
    z-index: 10;
}

.character-profile .w-24.h-24 img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.character-profile .w-24.h-24:hover img {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Profile upload button styling */
.profile-banner button {
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.profile-banner button:hover {
    transform: scale(1.05);
}

/* Responsive adjustments for character profile */
@media (max-width: 400px) {
    .profile-banner img {
        height: 150px;
    }
    
    .character-profile .w-24.h-24 {
        width: 80px;
        height: 80px;
    }
}

/* Dashboard Modal Styles - Comprehensive fix */
#dashboard-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10001 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    box-sizing: border-box !important;
}

/* Dashboard-specific hidden class */
#dashboard-modal.hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Dashboard show class - ensure it overrides hidden */
#dashboard-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Dashboard inner container sizing */
#dashboard-modal .bg-gray-900 {
    min-height: 60vh !important;
    max-height: 90vh !important;
    height: auto !important;
    width: 100% !important;
    max-width: 1280px !important;
    min-width: 320px !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
    /* Add back the visual styling from removed Tailwind classes */
    background: linear-gradient(180deg, var(--dark-teal-faq), var(--dark-very-teal-card)) !important;
    backdrop-filter: blur(4px) !important;
    border: 2px solid var(--teal-darker) !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px var(--teal-shadow) !important;
    padding: 0 !important;
}

/* Ensure dashboard content has minimum height */
#dashboard-modal .bg-gray-900 > div {
    min-height: 100px !important;
}

/* Specifically target the main content area */
#dashboard-modal .p-6 {
    min-height: 400px !important;
    padding: 1.5rem !important;
}

.dashboard-game-card {
    background: linear-gradient(135deg, var(--dark-teal-faq) 0%, var(--dark-very-teal-card) 100%);
    border: 1px solid var(--teal-medium);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-orange) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-game-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-cyan);
    box-shadow: 0 20px 25px -5px var(--teal-shadow), 0 10px 10px -5px var(--orange-glow);
}

.dashboard-game-card:hover::before {
    opacity: 1;
}

.dashboard-game-card .game-card-content {
    position: relative;
    z-index: 1;
}

.dashboard-game-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--teal-light);
    margin-bottom: 8px;
    line-height: 1.2;
    font-family: 'Cinzel', serif;
}

.dashboard-game-card .game-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-game-card .game-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    width: fit-content;
}

.dashboard-game-card .game-status.creator {
    background: var(--orange-light);
    color: var(--brand-orange);
    border: 1px solid var(--brand-orange);
}

.dashboard-game-card .game-status.player {
    background: rgba(0, 200, 223, 0.2);
    color: var(--brand-cyan);
    border: 1px solid var(--brand-cyan);
}

.dashboard-game-card .game-last-played {
    font-size: 12px;
    color: var(--teal-medium);
    font-family: 'Manrope', sans-serif;
}

.dashboard-game-card .game-description {
    font-size: 14px;
    color: var(--teal-light);
    line-height: 1.4;
    margin-bottom: 16px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: 'Manrope', sans-serif;
}

.dashboard-game-card .game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--teal-medium);
}

.dashboard-game-card .game-players-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--teal-medium);
    font-family: 'Manrope', sans-serif;
}

.dashboard-game-card .game-quick-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dashboard-game-card:hover .game-quick-actions {
    opacity: 1;
}

.dashboard-game-card .quick-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-game-card .edit-btn {
    background: var(--orange-light);
    color: var(--brand-orange);
}

.dashboard-game-card .edit-btn:hover {
    background: var(--brand-orange);
    color: white;
    transform: scale(1.1);
}

.dashboard-game-card .delete-btn {
    background: rgba(211, 95, 24, 0.2);
    color: var(--brand-orange);
}

.dashboard-game-card .delete-btn:hover {
    background: var(--brand-orange);
    color: white;
    transform: scale(1.1);
}

/* News Feed Styles */
.dashboard-news-item {
    background: linear-gradient(135deg, var(--dark-teal-faq) 0%, var(--dark-very-teal-card) 100%);
    border: 1px solid var(--teal-medium);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dashboard-news-item:hover {
    border-color: var(--brand-cyan);
    transform: translateY(-1px);
}

.dashboard-news-item .news-date {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dashboard-news-item .news-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-light);
    margin-bottom: 8px;
    line-height: 1.3;
}

.dashboard-news-item .news-summary {
    font-size: 12px;
    color: var(--teal-medium);
    line-height: 1.4;
    margin-bottom: 12px;
}

.dashboard-news-item .news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dashboard-news-item .news-tag {
    background: rgba(var(--cyan-rgb), 0.2);
    color: var(--cyan);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

.dashboard-news-item .news-tag.feature {
    background: rgba(var(--cyan-rgb), 0.2);
    color: var(--cyan);
}

.dashboard-news-item .news-tag.update {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.dashboard-news-item .news-tag.announcement {
    background: rgba(147, 51, 234, 0.2);
    color: #a855f7;
}

/* Dashboard Loading States */
.dashboard-games-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-spinner {
    border: 3px solid rgba(var(--teal-rgb), 0.3);
    border-radius: 50%;
    border-top-color: var(--cyan);
    animation: spin 1s ease-in-out infinite;
}

.dashboard-games-loading .loading-spinner {
    width: 40px;
    height: 40px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard Responsive Design */
@media (max-width: 768px) {
    #dashboard-modal .bg-gray-900 {
        max-height: calc(100vh - 2rem) !important;
        min-height: 50vh !important;
        margin: 0 !important;
    }
    
    .dashboard-game-card {
        padding: 16px;
    }
    
    .dashboard-game-card h3 {
        font-size: 16px;
    }
    
    #dashboard-games-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Dashboard fade-in animation */
@keyframes dashboardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Celebration Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
}
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(360deg);
        opacity: 0;
    }
}

/* Celebration modal specific styles */
#upgrade-success-modal .bg-gradient-to-br {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#upgrade-success-modal .animate-bounce {
    animation: bounce 1s infinite;
}

/* Responsive celebration modal */
@media (max-width: 768px) {
    #upgrade-success-modal .max-w-md {
        max-width: 90vw;
        margin: 1rem;
    }
    
    #upgrade-success-modal h2 {
        font-size: 1.5rem;
    }
    
    #upgrade-success-modal .text-6xl {
        font-size: 3rem;
    }
}

@keyframes dashboardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* HUD Assignment Modal */
#hud-assignment-modal .bg-gray-800 {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#hud-assignment-modal .bg-gray-700:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* HUD Slot States */
.hud-slot.assigned {
    border-color: var(--cyan) !important;
    background-color: rgba(var(--cyan-rgb), 0.1);
}

.hud-slot.activated {
    transform: scale(0.95);
    border-color: var(--orange) !important;
    box-shadow: 0 0 0 2px var(--orange-glow);
}

.hud-slot.playing {
    animation: hudPulse 1s ease-in-out;
}

@keyframes hudPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hud-slot-preview {
    border-radius: 4px;
    object-fit: cover;
}

/* Mobile responsive for HUD assignment modal */
@media (max-width: 768px) {
    #hud-assignment-modal .bg-gray-800 {
        margin: 8px;
        max-height: calc(100vh - 16px);
    }
}