:root {
    --bg-color: #07040f;
    --card-bg: rgba(17, 17, 17, 0.75);
    --primary-neon: #00f3ff;
    --secondary-neon: #ff00ff;
    --text-main: #ffffff;
    --text-dim: #a5a1b8;
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 50%, #170d2b 0%, #030107 100%);
    box-sizing: border-box;
    padding: 20px;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 820px;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Header OmegaDrail */
.header-omegadrail {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.omegadrail-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 24px;
    background: rgba(18, 14, 30, 0.5);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 35px rgba(0, 243, 255, 0.12);
    transition: all 0.3s ease;
}

.omegadrail-brand:hover {
    border-color: rgba(255, 0, 255, 0.35);
    box-shadow: 0 0 45px rgba(255, 0, 255, 0.2);
    transform: translateY(-2px);
}

.omega-emblem {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.omega-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.6));
    animation: rotateSlow 20s linear infinite;
}

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

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.omegadrail-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.neon-rail {
    background: linear-gradient(135deg, var(--primary-neon), var(--secondary-neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.6));
}

.omegadrail-tagline {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary-neon);
    margin: 3px 0 0 2px;
    opacity: 0.85;
}

/* Language Selector */
.lang-selector {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.lang-btn .flag {
    font-size: 15px;
}

.lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-neon), var(--secondary-neon));
    color: #000;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* Griglia Principale */
.content-wrapper {
    display: flex;
    flex-direction: row;
    gap: 30px;
    width: 100%;
    justify-content: center;
}

/* Card Comune (Player e Chat) */
.player-card, .chat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    height: 480px;
}

/* Player Card */
.player-card {
    width: 350px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.25;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
}

.album-art {
    width: 170px;
    height: 170px;
    margin: 10px auto 20px;
    position: relative;
}

.vinyl-record {
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, #111, #222, #111, #222, #111);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 6s linear infinite;
    animation-play-state: paused;
}

.vinyl-label {
    width: 65px;
    height: 65px;
    background: linear-gradient(45deg, var(--primary-neon), var(--secondary-neon));
    border-radius: 50%;
    border: 2px solid #fff;
    background-size: cover;
    background-position: center;
}

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

.info-track h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-track h3 {
    font-size: 15px;
    color: var(--text-dim);
    margin: 6px 0 15px;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.play-btn {
    background: linear-gradient(45deg, var(--primary-neon), var(--secondary-neon));
    border: none;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

.volume-control {
    width: 100%;
    max-width: 180px;
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary-neon);
    cursor: pointer;
}

.listeners-container {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 10px;
}

.listeners-container span {
    font-weight: bold;
    color: var(--primary-neon);
}

.live-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff0055;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 0 10px #ff0055;
    opacity: 0;
    transition: opacity 0.5s;
}

.live-indicator.active {
    opacity: 1;
    animation: blink 2s infinite;
}

@keyframes blink {
    50% { opacity: 0.4; }
}

/* Chat Card */
.chat-card {
    width: 380px;
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.12);
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--secondary-neon);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
}

.chat-status-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff66;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-right: -10px;
    padding-right: 10px;
}

/* Custom Scrollbar per la Chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-neon);
}

/* Messaggi della Chat */
.chat-msg {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideIn 0.25s ease-out;
}

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

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.chat-msg-user {
    font-weight: 700;
    color: var(--primary-neon);
}

.chat-msg-time {
    color: var(--text-dim);
}

.chat-msg-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    color: #f1f0f5;
}

/* Chat Footer & Inputs */
.chat-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-user-setup {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.chat-user-setup input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    width: 120px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.chat-input-wrapper input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
}

.chat-input-wrapper input:focus, .chat-user-setup input:focus {
    outline: none;
    border-color: var(--primary-neon);
}

.chat-input-wrapper button {
    background: linear-gradient(45deg, var(--primary-neon), var(--secondary-neon));
    border: none;
    border-radius: 10px;
    color: white;
    padding: 0 18px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.chat-input-wrapper button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

/* Responsive per Cellulari */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .player-card, .chat-card {
        width: 100%;
        max-width: 380px;
        height: auto;
    }

    .chat-card {
        height: 400px;
    }
    
    .hon-logo {
        height: 90px;
    }
}
