/* --- RESET E BASI --- */
:root {
    --bg: #030303;
    --card-bg: rgba(17, 17, 17, 0.7);
    --border: rgba(212, 175, 55, 0.15); /* Bordi dorati sottili */
    --gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.2);
    --red: #ff4444;
    --text-main: #ffffff;
    --text-muted: #888888;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* --- EFFETTO GLOW DI SFONDO --- */
.background-glow {
    position: absolute;
    top: -10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- HEADER --- */
header { text-align: center; padding: 50px 0 30px; }

h1 { font-weight: 800; font-size: 2.2rem; letter-spacing: -2px; text-shadow: 0 0 20px rgba(255,255,255,0.2); }

.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 5px; max-width: 80%; margin: 5px auto 0; }

/* --- EFFETTO VETRO (Glassmorphism) --- */
.glass {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* --- THRONE CARD (RE ATTUALE) --- */
.throne-card {
    width: 100%;
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.throne-card:hover { border-color: rgba(212, 175, 55, 0.4); box-shadow: 0 10px 50px var(--gold-glow); }

.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.live-dot-container { display: flex; position: relative; width: 8px; height: 8px; }

.live-dot { height: 8px; width: 8px; background-color: var(--red); border-radius: 50%; display: block; }

.pulse { position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: var(--red); border-radius: 50%; animation: pulse-red 2s infinite; }

.divider { color: #222; margin: 0 3px; }

.status-text, .countdown-label { color: var(--text-muted); }

#countdown { color: var(--red); font-weight: 800; font-size: 0.8rem; }

.avatar-throne {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto 20px;
}

.crown-icon { font-size: 2.6rem; position: absolute; top: -30px; left: 50%; transform: translateX(-50%); z-index: 2; filter: drop-shadow(0 0 10px var(--gold)); }

#current-king-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid #1a1a1a; transition: border-color 0.3s ease; }

.throne-card:hover #current-king-img { border-color: var(--gold); }

#king-name { font-weight: 800; font-size: 1.8rem; letter-spacing: -0.5px; color: var(--gold); text-shadow: 0 0 20px var(--gold-glow); }

#king-message { color: #cccccc; font-size: 1rem; line-height: 1.4; font-style: italic; margin-top: 5px; }

/* --- ACTION PANEL (PAGAMENTO) --- */
.action-panel {
    width: 100%;
    margin-top: 20px;
    border-radius: 24px;
    padding: 25px;
    text-align: center;
}

.price-block .price-label { display: block; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; }

.price-block .price { font-weight: 800; font-size: 2.2rem; color: var(--text-main); }

.dethrone-button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--gold), #ff8c00);
    color: var(--bg);
    padding: 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dethrone-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--gold-glow);
}

.disclaimer { color: var(--text-muted); font-size: 0.75rem; margin-top: 15px; max-width: 90%; margin: 15px auto 0; }

/* --- HISTORY PANEL (Social Proof) --- */
.history-panel { margin-top: 50px; padding-bottom: 50px; width: 100%; }

.history-panel h3 { text-align: center; color: var(--text-muted); font-size: 0.7rem; letter-spacing: 2.5px; margin-bottom: 20px; }

#history-list { list-style: none; padding: 0; }

#history-list li {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 0.9rem;
}

#history-list li .name { color: #aaa; flex-grow: 1; text-align: left; margin-left: 10px; }

#history-list li .spent { color: var(--gold); font-weight: 700; }

/* --- FOOTER --- */
footer { text-align: center; width: 100%; padding: 30px; border-top: 1px solid rgba(255,255,255,0.02); font-size: 0.7rem; color: #222; }

/* --- ANIMAZIONI --- */
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 8px rgba(255, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); } }

/* ----------------------------------------------------------- */
/* --- MEDIA QUERY: FIX MOBILE (Responsività Totale) --- */
/* ----------------------------------------------------------- */
@media (max-width: 480px) {
    .background-glow { width: 300px; height: 300px; }
    h1 { font-size: 1.8rem; }
    .subtitle { font-size: 0.8rem; }
    .throne-card { padding: 20px; }
    .avatar-throne { width: 130px; height: 130px; margin-bottom: 15px; }
    .crown-icon { font-size: 2.2rem; top: -25px; }
    #king-name { font-size: 1.5rem; }
    #king-message { font-size: 0.9rem; line-height: 1.3; }
    .price-block .price { font-size: 1.8rem; }
    .dethrone-button { padding: 15px; font-size: 0.9rem; }
}

/* --- BOTTONE LINK DEL RE --- */
.king-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--gold);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255, 215, 0, 0.05);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.king-link:hover {
    background-color: var(--gold);
    color: var(--bg);
    box-shadow: 0 0 20px var(--gold-glow);
    border-color: var(--gold);
}