﻿/* =============================================================================
   PAROLIAMO — Foglio di stile condiviso
   Tema "Cosmic Dark": viola #8b5cf6 | ciano #06b6d4 | oro #f59e0b
   Sfondo: #08080f | Card: #0f0f23 | Bordi: #312e81
   ============================================================================= */

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; }

/* Forza sfondo scuro sull'elemento html (compatibilità quirks mode) */
html { background: #08080f; }

/* ---- BODY ---- */
body {
    font-family: Verdana, sans-serif;
    background: #08080f;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.04) 0%, transparent 50%);
    margin: 0;
    padding: 0;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ---- LAYOUT ---- */
.page-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.wrapper {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
    padding: 8px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header-bg {
    background: linear-gradient(160deg, #1e1b4b 0%, #0f0f23 60%, #08080f 100%);
    border-bottom: 4px solid #7c3aed;
    padding: 20px 16px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.header-bg::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(139,92,246,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.logo-tricolore {
    font-family: Verdana, Impact, sans-serif;
    text-transform: uppercase;
    font-size: clamp(1.8rem, 7vw, 3.2rem);
    font-weight: 900;
    font-style: italic;
    line-height: 1.1;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(139,92,246,0.5)) drop-shadow(2px 3px 0px rgba(0,0,0,0.7));
    margin-bottom: 14px;
}

.header-img {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 2px solid rgba(139,92,246,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 30px rgba(139,92,246,0.15);
}

/* ============================================================
   AVVISO / BANNER
   ============================================================ */
.avviso {
    background: rgba(239,68,68,0.08);
    border-left: 4px solid #ef4444;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin: 14px 12px;
    text-align: center;
    font-size: 0.7rem;
    color: #fca5a5;
}
.avviso strong { color: #f87171; }

/* ============================================================
   PANNELLI CON CORNICE (pattern universale)
   ============================================================ */
.lettere-wrap,
.parola-wrap,
.regole-wrap,
.trovate-wrap,
.hiscore-wrap,
.form-wrap,
.counter-wrap,
.attesa-wrap,
.info-wrap {
    margin: 14px auto;
    padding: 3px;
    background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 50%, #f59e0b 100%);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 40px rgba(139,92,246,0.15);
}

.lettere-wrap  { max-width: 520px; }
.trovate-wrap  { max-width: 728px; }
.hiscore-wrap  { max-width: 728px; }
.regole-wrap   { max-width: 700px; }
.attesa-wrap   { max-width: 620px; }
.info-wrap     { max-width: 640px; }

/* Interno dei pannelli */
.lettere-inner,
.parola-inner,
.attesa-inner,
.info-inner {
    background: #0f0f23;
    border-radius: 11px;
    padding: 20px 16px;
    text-align: center;
}

/* ============================================================
   FORM — HOME PAGE (default.asp)
   ============================================================ */
.form-wrap { margin: 0 12px 20px; }

.form-inner {
    background: #0f0f23;
    border-radius: 11px;
    overflow: hidden;
}

.form-title {
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #ffffff;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 16px;
}

.form-body { padding: 16px; }

.field-label {
    display: block;
    font-size: 0.65rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.field-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #312e81;
    border-radius: 8px;
    background: #08080f;
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    font-family: Verdana, sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 12px;
}
.field-input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #08080f;
    border: 2px solid #312e81;
    border-radius: 10px;
    padding: 10px 12px;
}

.select-lettere {
    padding: 8px 10px;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    background: #14142b;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.label-lettere {
    font-size: 0.7rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   BOTTONI
   ============================================================ */
.btn-gioca {
    flex: 1;
    padding: 12px 16px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #ffffff;
    font-weight: 900;
    font-size: clamp(1rem, 3vw, 1.2rem);
    border: 2px solid rgba(139,92,246,0.5);
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 14px rgba(124,58,237,0.4), 0 0 20px rgba(124,58,237,0.2);
    transition: all 0.2s ease;
}
.btn-gioca:hover {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    box-shadow: 0 8px 22px rgba(6,182,212,0.4), 0 0 30px rgba(6,182,212,0.2);
    transform: translateY(-2px) scale(1.03);
    border-color: rgba(6,182,212,0.5);
}
.btn-gioca:active { transform: scale(0.97); }

.btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-undo,
.btn-reset {
    padding: 10px 16px;
    background: #1a1a35;
    color: #e2e8f0;
    border: 2px solid #312e81;
    border-radius: 50px;
    font-family: Verdana, sans-serif;
    font-weight: bold;
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-undo:hover  { background: #ef4444; border-color: #ef4444; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(239,68,68,0.3); }
.btn-reset:hover { background: #312e81; border-color: #7c3aed; transform: translateY(-2px); }

.btn-ok {
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    border: 2px solid rgba(139,92,246,0.4);
    border-radius: 50px;
    font-family: Verdana, sans-serif;
    font-weight: bold;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(139,92,246,0.3);
    letter-spacing: 1px;
    transition: all 0.2s ease;
}
.btn-ok:hover {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 22px rgba(6,182,212,0.4);
    border-color: rgba(6,182,212,0.5);
}
.btn-ok:active { transform: scale(0.97); }

.btn-partita {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    color: #ffffff !important;
    font-family: Verdana, sans-serif;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: bold;
    text-decoration: none !important;
    border-radius: 50px;
    border: 2px solid rgba(139,92,246,0.4);
    box-shadow: 0 4px 14px rgba(124,58,237,0.35), 0 0 20px rgba(124,58,237,0.2);
    letter-spacing: 1px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn-partita:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 22px rgba(6,182,212,0.4);
    border-color: rgba(6,182,212,0.5);
}
.btn-partita:active { transform: translateY(0) scale(0.98); }

.btn-invia {
    padding: 12px 32px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    border: 2px solid rgba(139,92,246,0.4);
    border-radius: 50px;
    font-family: Verdana, sans-serif;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 4px 14px rgba(139,92,246,0.4);
    transition: all 0.2s ease;
}
.btn-invia:hover {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 22px rgba(6,182,212,0.4);
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee-wrap {
    background: linear-gradient(135deg, #1e1b4b, #14142b);
    border: 1px solid #312e81;
    border-radius: 8px;
    margin: 0 12px 20px;
    padding: 6px 10px;
    overflow: hidden;
}
.marquee-wrap marquee {
    font-weight: bold;
    font-size: 0.7rem;
    color: #c4b5fd;
    font-style: italic;
}

/* ============================================================
   GRIGLIA SOCIAL / INFO (default.asp)
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 12px 20px;
}

.card-social {
    background: #0f0f23;
    border: 2px solid #312e81;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.card-info {
    background: #0f0f23;
    border: 2px solid #7c3aed;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.65rem;
    color: #94a3b8;
    font-style: italic;
    display: flex;
    align-items: center;
}

/* ============================================================
   CONTATORE VISITE (default.asp)
   ============================================================ */
.counter-wrap { margin: 0 12px 20px; }

.counter-inner {
    background: #0f0f23;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.counter-label {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8b5cf6;
    margin-bottom: 6px;
}
.counter-number {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 900;
    color: #f59e0b;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(245,158,11,0.6), 0 0 40px rgba(245,158,11,0.25);
}

/* ============================================================
   STORIA (default.asp)
   ============================================================ */
.storia-wrap {
    margin: 0 12px 20px;
    background: #0f0f23;
    border-radius: 12px;
    border: 2px solid #312e81;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.storia-title {
    font-size: 0.8rem;
    font-weight: 900;
    color: #8b5cf6;
    text-transform: uppercase;
    font-style: italic;
    border-bottom: 2px solid #7c3aed;
    padding-bottom: 6px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.storia-body {
    display: flex;
    gap: 12px;
}
.storia-body img {
    width: 64px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.storia-text {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.5;
}
.storia-novita {
    margin-top: 12px;
    background: rgba(139,92,246,0.08);
    border: 1px solid #7c3aed;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.65rem;
    color: #c4b5fd;
    font-style: italic;
}
.storia-novita strong { color: #a78bfa; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    margin: 0 12px;
    padding: 16px 0 32px;
    border-top: 1px solid #1e1b4b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.footer-copy {
    font-size: 0.6rem;
    color: #475569;
    font-weight: bold;
    text-transform: uppercase;
}
.footer-copy a { color: #8b5cf6; text-decoration: none; }
.footer-copy a:hover { color: #06b6d4; text-decoration: underline; }

/* ============================================================
   TABELLA LETTERE — tile interattiva (indice.asp)
   ============================================================ */
.tbl-lettere {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 auto;
    border: none !important;
    display: block;
}

.tbl-lettere tbody,
.tbl-lettere tr {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 520px) {
    .tbl-lettere tbody,
    .tbl-lettere tr { flex-wrap: wrap; }
}

.tbl-lettere td {
    background: linear-gradient(145deg, #1e1b4b, #14142b) !important;
    text-align: center !important;
    border-radius: 10px !important;
    border: 2px solid #4c1d95 !important;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(139,92,246,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    user-select: none;
    width:  clamp(52px, 14vw, 68px);
    height: clamp(60px, 16vw, 78px);
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tbl-lettere td:hover {
    background: linear-gradient(145deg, #7c3aed, #4c1d95) !important;
    border-color: #a78bfa !important;
    transform: translateY(-5px) scale(1.12);
    box-shadow: 0 12px 24px rgba(0,0,0,0.5), 0 0 20px rgba(139,92,246,0.6);
}

.tbl-lettere td.used {
    background: linear-gradient(145deg, #0d0d1a, #0a0a12) !important;
    border-color: #1e1b4b !important;
    opacity: 0.3;
    cursor: default;
    transform: none !important;
    box-shadow: none !important;
}

.tbl-lettere td font {
    color: #e2e8f0 !important;
    font-size: clamp(1.5rem, 5.5vw, 2.4rem) !important;
    font-family: 'Georgia', serif !important;
    font-weight: bold !important;
    text-shadow: 0 0 10px rgba(139,92,246,0.8), 1px 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
    line-height: 1;
}

.tbl-lettere td img {
    max-width: 90%;
    height: auto;
    pointer-events: none;
}

/* ============================================================
   TABELLA LETTERE — variante display (controllasoluzione.asp)
   Attivata dal body con class="pg-soluzione"
   Riusa il layout flex-card di indice.asp, solo tile viola+oro
   ============================================================ */
.pg-soluzione .tbl-lettere td {
    cursor: default;
    pointer-events: none;
    background: linear-gradient(145deg, #6d28d9, #4c1d95) !important;
    border-color: #a78bfa !important;
    box-shadow: 0 0 20px rgba(139,92,246,0.4),
                inset 0 1px 0 rgba(255,255,255,0.12),
                0 6px 16px rgba(0,0,0,0.5) !important;
    animation: popIn 0.35s ease both;
}

.pg-soluzione .tbl-lettere td font {
    color: #fde68a !important;
    text-shadow: 0 0 16px rgba(251,191,36,0.85),
                 0 0 5px rgba(251,191,36,0.5),
                 1px 2px 4px rgba(0,0,0,0.6) !important;
}

.pg-soluzione .tbl-lettere font {
    font-size: clamp(1.6rem, 6vw, 2.8rem) !important;
    font-family: 'Georgia', 'Comic Sans MS', serif !important;
    font-weight: bold !important;
}

.pg-soluzione .tbl-lettere img {
    max-width: 90%;
    height: auto;
    border-radius: 6px;
}

/* ============================================================
   TABELLA GIOCATA (giocata.asp) — lettere non interattive
   ============================================================ */
.tbl-giocata {
    border-collapse: separate;
    border-spacing: 6px;
    margin: 0 auto;
}
.tbl-giocata td {
    background: linear-gradient(145deg, #1e1b4b, #14142b) !important;
    border: 2px solid #4c1d95 !important;
    border-radius: 10px;
    text-align: center;
    padding: 8px !important;
    min-width: 52px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(139,92,246,0.2);
}
.tbl-giocata td font {
    color: #e2e8f0 !important;
    font-size: clamp(1.4rem, 5vw, 2rem) !important;
    font-weight: bold !important;
    text-shadow: 0 0 10px rgba(139,92,246,0.8);
}

/* ============================================================
   SLOT PAROLA COMPOSTA (indice.asp)
   ============================================================ */
#slots-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
    min-height: 52px;
    margin-bottom: 14px;
    overflow-x: hidden;
}

@media (max-width: 520px) {
    #slots-container { flex-wrap: wrap; overflow-x: hidden; }
}

.slot {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: Georgia, serif;
    width:     clamp(52px, 14vw, 68px);
    height:    clamp(60px, 16vw, 78px);
    font-size: clamp(1.5rem, 5.5vw, 2.4rem);
}

.slot-empty {
    border: 2px dashed #312e81;
    background: rgba(49,46,129,0.1);
}

.slot-filled {
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    border: 2px solid #a78bfa;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(139,92,246,0.8), 1px 1px 3px rgba(0,0,0,0.4);
    box-shadow: 0 4px 10px rgba(124,58,237,0.5), 0 0 20px rgba(124,58,237,0.2);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-last {
    background: linear-gradient(135deg, #06b6d4, #0284c7) !important;
    border-color: #67e8f9 !important;
    cursor: pointer !important;
    animation: pulsaCyan 0.9s infinite alternate !important;
}

@keyframes popIn {
    from { transform: scale(0.2) translateY(-30px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);     opacity: 1; }
}

@keyframes pulsaCyan {
    from { box-shadow: 0 4px 10px rgba(6,182,212,0.4), 0 0 15px rgba(6,182,212,0.2); }
    to   { box-shadow: 0 8px 22px rgba(6,182,212,0.9), 0 0 30px rgba(6,182,212,0.5); transform: scale(1.06); }
}

/* ============================================================
   LETTERA VOLANTE (indice.asp)
   ============================================================ */
.flying-letter {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width:  clamp(52px, 14vw, 68px);
    height: clamp(52px, 14vw, 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #ffffff;
    font-size: clamp(1.5rem, 5.5vw, 2.4rem);
    font-weight: bold;
    font-family: Georgia, serif;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(124,58,237,0.5);
    transition: left      0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top       0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.38s ease,
                opacity   0.15s ease 0.28s;
}

/* ============================================================
   TABELLA REGOLE (indice.asp)
   ============================================================ */
.tbl-regole {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    border: none !important;
}
.tbl-regole td {
    padding: 12px 16px;
    border-radius: 10px;
    vertical-align: top;
    border: none !important;
    width: 50%;
}
.tbl-regole tr:first-child td:first-child { background: linear-gradient(145deg, #7c3aed, #4c1d95) !important; }
.tbl-regole tr:first-child td:last-child  { background: linear-gradient(145deg, #0284c7, #0369a1) !important; }
.tbl-regole tr:first-child td font        { color: #ffffff !important; font-weight: bold; }
.tbl-regole tr:last-child  td:first-child { background: rgba(124,58,237,0.15) !important; border: 1px solid #4c1d95 !important; }
.tbl-regole tr:last-child  td:last-child  { background: rgba(2,132,199,0.15)  !important; border: 1px solid #0284c7 !important; }
.tbl-regole tr:last-child  td font        { color: #e2e8f0 !important; }

/* ============================================================
   TABELLA PAROLE TROVATE dalla CPU (controllasoluzione.asp)
   ============================================================ */
.tbl-trovate {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    background: transparent;
    border: none !important;
}

.tbl-trovate td {
    border: none !important;
    padding: 6px 10px;
    border-radius: 8px;
}

.tbl-trovate tr:first-child td:first-child {
    background: linear-gradient(135deg, #7c3aed, #4c1d95) !important;
    border-radius: 8px 0 0 8px;
}
.tbl-trovate tr:first-child td:last-child {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-radius: 0 8px 8px 0;
}
.tbl-trovate tr:first-child font {
    color: #ffffff !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.tbl-trovate tr:not(:first-child) td:first-child {
    background: linear-gradient(135deg, #4c1d95, #312e81) !important;
    text-align: center !important;
    min-width: 54px;
    border-radius: 8px;
}
.tbl-trovate tr:not(:first-child) td:first-child font {
    color: #c4b5fd !important;
    font-weight: bold;
    font-size: clamp(1rem, 4vw, 1.6rem) !important;
}

.tbl-trovate tr:not(:first-child) td:last-child {
    background: #0f0f23 !important;
    border: 1px solid #312e81 !important;
    text-align: left !important;
    border-radius: 8px;
    word-break: break-word;
}
.tbl-trovate tr:not(:first-child) td:last-child font {
    color: #06b6d4 !important;
    font-weight: bold;
    font-size: clamp(0.75rem, 2vw, 0.95rem) !important;
}

/* ============================================================
   HISCORE TABLE (controllasoluzione.asp)
   ============================================================ */
.tbl-hiscore {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border: none !important;
}

.tbl-hiscore td {
    padding: 6px 10px;
    font-size: clamp(0.6rem, 2vw, 0.85rem);
    word-break: break-word;
    border-bottom: 1px solid #1e1b4b !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: #0a0a1a !important;
}

/* intestazione */
.tbl-hiscore tr:first-child td {
    background: #1e1b4b !important;
    padding: 8px 10px;
    border-bottom: 2px solid #7c3aed !important;
}
.tbl-hiscore tr:first-child td font {
    color: #c4b5fd !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem !important;
}

/* righe alternanti leggere */
.tbl-hiscore tr:not(:first-child):nth-child(even) td { background: #0f0f23 !important; }
.tbl-hiscore tr:not(:first-child) td font             { color: #cbd5e1 !important; }

/* riga evidenziata — giocatore corrente */
.tbl-hiscore tr.riga-player td {
    background: rgba(139,92,246,0.12) !important;
    border-bottom: 1px solid #7c3aed !important;
}
.tbl-hiscore tr.riga-player td font { color: #fde68a !important; font-weight: bold; }

/* medaglie: nessun gradiente, solo bordo sinistro colorato */
.tbl-hiscore tr.riga-oro td:first-child,
.tbl-hiscore tr.riga-argento td:first-child,
.tbl-hiscore tr.riga-bronzo td:first-child { border-left: 3px solid !important; }

.tbl-hiscore tr.riga-oro td,
.tbl-hiscore tr.riga-argento td,
.tbl-hiscore tr.riga-bronzo td { background: #0a0a1a !important; }

.tbl-hiscore tr.riga-oro td:first-child     { border-left: 3px solid #f59e0b !important; }
.tbl-hiscore tr.riga-argento td:first-child  { border-left: 3px solid #94a3b8 !important; }
.tbl-hiscore tr.riga-bronzo td:first-child   { border-left: 3px solid #b45309 !important; }

.tbl-hiscore tr.riga-oro     td font { color: #fcd34d !important; }
.tbl-hiscore tr.riga-argento td font { color: #cbd5e1 !important; }
.tbl-hiscore tr.riga-bronzo  td font { color: #c07830 !important; }

/* ============================================================
   POPUP PODIO MEDAGLIA (controllasoluzione.asp)
   ============================================================ */
#popup-podio {
    position: fixed;
    inset: 0;
    background: rgba(8,8,15,0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}
#popup-podio.visible { opacity: 1; display: flex; }

#popup-podio-card {
    background: linear-gradient(150deg, #0f0f23 0%, #1e1b4b 60%, #08080f 100%);
    border: 2px solid #7c3aed;
    border-radius: 20px;
    padding: 36px 32px 28px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 0 60px rgba(139,92,246,0.45),
                0 0 120px rgba(139,92,246,0.15),
                0 24px 48px rgba(0,0,0,0.7);
    transform: scale(0.6) translateY(50px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
#popup-podio.visible #popup-podio-card {
    transform: scale(1) translateY(0);
}
#popup-podio-card::before {
    content: '\2726 \2727 \2726 \2727 \2726 \2727 \2726';
    display: block;
    font-size: 0.85rem;
    color: #f59e0b;
    letter-spacing: 6px;
    margin-bottom: 14px;
    animation: shimmerStars 2s infinite alternate;
}
@keyframes shimmerStars {
    from { opacity: 0.4; letter-spacing: 3px; }
    to   { opacity: 1;   letter-spacing: 9px; }
}
#popup-medaglia {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 6px;
    display: block;
    animation: bounceMedal 0.8s cubic-bezier(0.34,1.56,0.64,1) 0.25s both;
}
@keyframes bounceMedal {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}
#popup-titolo {
    font-size: 1.6rem;
    font-weight: 900;
    color: #f59e0b;
    text-shadow: 0 0 22px rgba(245,158,11,0.75);
    margin-bottom: 6px;
    letter-spacing: 1px;
}
#popup-pos {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #c4b5fd;
    margin-bottom: 10px;
}
#popup-giocatore {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e2e8f0;
    margin-bottom: 4px;
}
#popup-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 14px;
}
#popup-punti {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fde68a;
    text-shadow: 0 0 24px rgba(251,191,36,0.85);
    font-family: 'Courier New', monospace;
    margin-bottom: 22px;
    animation: pulseGold 1.2s infinite alternate;
}
@keyframes pulseGold {
    from { text-shadow: 0 0 12px rgba(251,191,36,0.5); }
    to   { text-shadow: 0 0 36px rgba(251,191,36,1), 0 0 60px rgba(251,191,36,0.45); }
}
#popup-podio-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #fff;
    border: 2px solid rgba(139,92,246,0.5);
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    font-family: Verdana, sans-serif;
}
#popup-podio-btn:hover {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(6,182,212,0.45);
    border-color: rgba(6,182,212,0.5);
}

/* ============================================================
   TABELLA PAROLA MANCANTE (controllasoluzione.asp)
   ============================================================ */
.tbl-mancante {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    border-collapse: collapse;
}
.tbl-mancante td { padding: 8px; vertical-align: top; }

input[type="text"] { max-width: 100%; }

/* ============================================================
   PAGINA ATTESA — countdown (attesa_.asp)
   ============================================================ */
.countdown-box {
    background: #0f0f23;
    border-radius: 10px;
    padding: 28px 16px 20px;
    text-align: center;
}

.countdown-label {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8b5cf6;
    margin-bottom: 12px;
}

.countdown-input {
    background: transparent;
    border: none;
    color: #f59e0b;
    font-size: clamp(3rem, 14vw, 5.5rem);
    font-weight: 900;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 28px rgba(245,158,11,0.8), 0 0 50px rgba(245,158,11,0.3);
    text-align: center;
    width: 3ch;
    outline: none;
    -moz-appearance: textfield;
    pointer-events: none;
}

.countdown-ora {
    font-size: 1rem;
    color: #94a3b8;
    margin-top: 8px;
}

.player-card {
    background: #0f0f23;
    border: 2px solid #312e81;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 10px auto;
    max-width: 620px;
    font-size: 0.85rem;
    color: #e2e8f0;
    text-align: center;
}

.player-card table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    margin-top: 8px;
}

.player-card td {
    background: rgba(139,92,246,0.1) !important;
    border: 1px solid #312e81 !important;
    border-radius: 6px;
    padding: 6px 10px;
    color: #c4b5fd !important;
    font-size: 0.8rem;
    text-align: center;
}

/* ============================================================
   PAGINA GIOCATA — timer e form parola (giocata.asp)
   ============================================================ */
.timer-bar {
    background: #0f0f23;
    border-bottom: 3px solid #7c3aed;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.timer-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-input {
    background: transparent;
    border: 2px solid #7c3aed;
    border-radius: 6px;
    color: #f59e0b;
    font-size: 1.4rem;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    text-align: center;
    width: 3ch;
    padding: 4px 6px;
    outline: none;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(245,158,11,0.5);
}

.word-input-wrap {
    margin: 16px auto;
    max-width: 480px;
    background: #0f0f23;
    border: 2px solid #312e81;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.word-input-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.word-input {
    width: 100%;
    padding: 12px 16px;
    background: #08080f;
    border: 3px solid #312e81;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: center;
    outline: none;
    letter-spacing: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.word-input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }

/* ============================================================
   CHAT (chat.asp)
   ============================================================ */
.chat-card {
    background: #0f0f23;
    border: 2px solid #312e81;
    border-radius: 12px;
    padding: 16px;
    margin: 14px auto;
    max-width: 700px;
    text-align: left;
}

.chat-title {
    font-size: 0.9rem;
    font-weight: 900;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #7c3aed;
    padding-bottom: 8px;
    margin-bottom: 14px;
    text-align: center;
}

.chat-msg-list { list-style: none; padding: 0; margin: 0; }

.chat-msg {
    padding: 6px 0;
    border-bottom: 1px solid #1e1b4b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.chat-time  { color: #475569; font-size: 0.7rem; }
.chat-nick  { color: #8b5cf6; font-weight: bold; }
.chat-text  { color: #e2e8f0; }

.chat-form {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: #08080f;
    border: 2px solid #312e81;
    border-radius: 8px;
    color: #ffffff;
    font-family: Verdana, sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: #8b5cf6; }

.chat-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #ffffff;
    border: 2px solid rgba(139,92,246,0.4);
    border-radius: 8px;
    font-family: Verdana, sans-serif;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.chat-send:hover { background: linear-gradient(135deg, #06b6d4, #0284c7); border-color: rgba(6,182,212,0.4); }

/* ============================================================
   PAGINE INFORMATIVE (consiglia.asp, spedisciposta.asp, mancanti.asp)
   ============================================================ */
.info-icon {
    font-size: 2.8rem;
    margin-bottom: 10px;
}

.info-title {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 900;
    color: #8b5cf6;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-body {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 16px;
}
.info-body a { color: #06b6d4; text-decoration: none; }
.info-body a:hover { text-decoration: underline; }

.info-badge {
    display: inline-block;
    background: rgba(139,92,246,0.12);
    border: 1px solid #7c3aed;
    border-radius: 8px;
    color: #c4b5fd;
    font-size: 0.8rem;
    padding: 8px 16px;
    margin-top: 8px;
    font-weight: bold;
}

/* ============================================================
   PAGINA DOWNLOAD (download_paroliamo.asp)
   ============================================================ */
.download-wrap {
    margin: 14px 12px;
    padding: 3px;
    background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 40px rgba(139,92,246,0.15);
}
.download-inner {
    background: #0f0f23;
    border-radius: 11px;
    padding: 20px;
}
.download-title {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    text-align: center;
}
.download-body {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.7;
    text-align: justify;
}
.download-body a { color: #06b6d4; }
.download-link {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(124,58,237,0.4);
    transition: all 0.2s ease;
    border: 2px solid rgba(139,92,246,0.4);
    margin: 10px 0;
}
.download-link:hover {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(6,182,212,0.4);
}

.letters-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0;
}
.letters-display a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 72px;
    background: linear-gradient(145deg, #1e1b4b, #14142b);
    border: 2px solid #4c1d95;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    font-size: 1.8rem;
    font-weight: bold;
    font-family: Georgia, serif;
    color: #e2e8f0;
    text-shadow: 0 0 10px rgba(139,92,246,0.8);
}
.letters-display a:hover {
    background: linear-gradient(145deg, #7c3aed, #4c1d95);
    border-color: #a78bfa;
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(124,58,237,0.5);
}
.letters-display img {
    max-width: 80%;
    height: auto;
}

/* ============================================================
   CARD GENERICA (consiglia, spedisciposta, mancanti)
   ============================================================ */
.msg-card {
    background: #0f0f23;
    border: 2px solid #312e81;
    border-radius: 12px;
    padding: 24px;
    margin: 14px 12px;
    text-align: center;
}
.msg-card h2, .msg-card h3 {
    color: #8b5cf6;
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.msg-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 10px 0;
}
.msg-card b { color: #e2e8f0; }

hr.dark-hr {
    border: none;
    border-top: 1px solid #1e1b4b;
    margin: 16px 12px;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 600px) {
    .tbl-regole,
    .tbl-regole tbody,
    .tbl-regole tr,
    .tbl-regole td {
        display: block !important;
        width: 100% !important;
    }
    .tbl-regole tr:first-child { display: flex !important; }
    .tbl-regole tr:first-child td { width: 50% !important; }

    .btn-group { flex-direction: column; align-items: center; }
    .btn-ok, .btn-undo, .btn-reset { width: 90%; text-align: center; }

    .pg-soluzione .tbl-lettere td { padding: 6px 2px; border-radius: 7px; }

    .tbl-trovate,
    .tbl-trovate tbody,
    .tbl-trovate tr,
    .tbl-trovate td {
        display: block;
        width: 100% !important;
        border-radius: 6px !important;
    }
    .tbl-trovate tr { margin-bottom: 6px; }

    .tbl-hiscore td:nth-child(5),
    .tbl-hiscore td:nth-child(6) { display: none; }

    .tbl-mancante,
    .tbl-mancante tbody,
    .tbl-mancante tr,
    .tbl-mancante td { display: block; width: 100% !important; }

    input[type="text"] { width: 100%; max-width: 100%; }

    .btn-partita { display: block; margin: 8px auto; width: 90%; text-align: center; }
    .chat-form   { flex-direction: column; }
    .storia-body { flex-direction: column; }
    .grid-2      { grid-template-columns: 1fr; }
    .letters-display a { width: 44px; height: 62px; font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .tbl-regole tr:first-child td { width: 50% !important; }
}

/* ============================================================
   CHAT SIDEBAR — barra laterale destra (solo desktop ≥ 960px)
   Usata in: indice.asp, controllasoluzione.asp, attesa_.asp
   ============================================================ */
.chat-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 272px;
    height: 100vh;
    z-index: 600;
    display: flex;
    flex-direction: column;
    background: #0c0c20;
    border-left: 2px solid #7c3aed;
    box-shadow: -4px 0 28px rgba(0,0,0,0.65), -2px 0 40px rgba(124,58,237,0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.chat-sidebar.open { transform: translateX(0); }

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1e1b4b 0%, #14142b 100%);
    border-bottom: 2px solid #7c3aed;
    font-size: 0.75rem;
    font-weight: bold;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    user-select: none;
}
.chat-sidebar-close {
    background: none;
    border: none;
    color: #8b5cf6;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}
.chat-sidebar-close:hover { color: #06b6d4; }

.chat-sidebar-frame {
    flex: 1;
    border: none;
    width: 100%;
    min-height: 0;
    display: block;
}

/* Toggle button: tab che sporge dal bordo sinistro della sidebar */
.chat-sidebar-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(0);
    z-index: 601;
    background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 14px 8px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: -3px 0 14px rgba(124,58,237,0.5);
    transition: background 0.2s, right 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    line-height: 1;
}
.chat-sidebar-toggle .cs-label {
    font-size: 0.55rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    opacity: 0.85;
}
.chat-sidebar-toggle:hover { background: linear-gradient(180deg, #06b6d4 0%, #0284c7 100%); }

/* Sposta il tab quando la sidebar è aperta */
.chat-sidebar.open + .chat-sidebar-toggle,
.chat-sidebar-toggle.cs-open { right: 272px; }

/* Nascosto su mobile / tablet */
@media (max-width: 960px) {
    .chat-sidebar,
    .chat-sidebar-toggle { display: none !important; }
}
