:root {
    --bg-dark: #0f0c29;
    --bg-mid: #302b63;
    --bg-light: #24243e;
    --primary: #00d2ff; /* Cyan */
    --secondary: #3a7bd5;
    --accent: #ff00cc; /* Neon Pink */
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 16px;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: radial-gradient(circle at center, var(--bg-mid), var(--bg-dark));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0; /* Important for scroll */
}

/* Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.panel h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

/* Left Panel: Inputs */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

button {
    cursor: pointer;
    font-family: var(--font-family);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}
.btn-primary:hover {
    background: #4be0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    flex: 1;
    font-size: 0.9rem;
}
.btn-secondary:hover, .btn-secondary.active {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid var(--primary);
}

.btn-danger {
    background: rgba(255, 50, 50, 0.1);
    color: #ff5555;
    font-size: 0.9rem;
}
.btn-danger:hover {
    background: rgba(255, 50, 50, 0.3);
}

.names-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.styled-list {
    list-style: none;
}

.player-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-item.fixed {
    border-color: var(--accent);
    background: rgba(255, 0, 204, 0.15);
}

.player-item.selected-for-fix {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.player-item .remove-icon {
    opacity: 0;
    transition: opacity 0.2s;
    color: #ff5555;
}
.player-item:hover .remove-icon {
    opacity: 1;
}

.status-bar {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

/* Center Panel: Wheel */
.center-panel {
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.wheel-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin-bottom: 2rem;
}

canvas#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.1);
    transition: transform 3s cubic-bezier(0.25, 1, 0.5, 1); /* Only basic transition here, JS handles spin */
}

.wheel-marker {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--accent);
    z-index: 10;
    filter: drop-shadow(0 0 10px var(--accent));
}

.wheel-center-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-dark);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--primary);
    border: 3px solid var(--primary);
    z-index: 5;
}

.btn-spin {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 1.5rem;
    padding: 15px 50px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-spin:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.6);
}

.btn-spin:disabled {
    background: #555;
    box-shadow: none;
    color: #888;
    cursor: not-allowed;
}

/* Right Panel: Results */
.results-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr;
    padding-right: 5px;
}

.bed-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--glass-border);
    animation: slideUp 0.5s ease-out;
}

.bed-label {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
}

.bed-occupants {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.seat {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    height: 40px; /* Consitent height */
}

.seat.empty {
    color: #555;
    font-style: italic;
    font-size: 0.9rem;
    border: 1px dashed #555;
    background: transparent;
}

.seat.filled {
    border-left: 3px solid var(--primary);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-text {
    text-align: center;
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--primary);
    min-height: 1.5em;
    font-weight: 600;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    .app-container {
        height: auto;
    }
    .wheel-container {
        width: 350px;
        height: 350px;
    }
}

/* Modal & Admin Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #000;
    border: 1px solid #00ff41; /* Hacker Green */
    border-radius: 10px;
    width: 600px;
    max-width: 90%;
    padding: 30px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.2);
    font-family: 'Courier New', monospace;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px dashed #00ff41;
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #00ff41;
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: #00ff41;
    font-size: 2rem;
    cursor: pointer;
}

.modal-intro {
    color: #00ff41;
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.admin-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-input-group input {
    background: #111;
    border: 1px solid #00ff41;
    color: #00ff41;
    font-family: 'Courier New', monospace;
}

.admin-input-group button.btn-primary {
    background: #00ff41;
    color: #000;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.admin-list {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #00ff41;
    padding: 10px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    color: #00ff41;
    padding: 8px;
    border-bottom: 1px dotted rgba(0, 255, 65, 0.3);
}

.admin-list-item:last-child {
    border-bottom: none;
}

.admin-list-item span {
    font-weight: bold;
}

.full-width {
    width: 100%;
}

