/* Global + Home */


    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    html, body {
      height: 100%;
      width: 100%;
      overflow: hidden;
    }

    body {
      background: radial-gradient(circle at top, #020617, #000000);
      color: #e5e7eb;
    }

    .page-root {
      height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 12px;
      gap: 12px;
    }

    .site-header {
      padding: 14px 18px;
      background: linear-gradient(135deg, #020617, #111827);
      box-shadow: 0 10px 24px rgba(0,0,0,0.6);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .site-title {
      text-align: center;
      font-weight: 900;
      font-size: 1.6rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #f9fafb;
    }

    .site-subtitle {
      text-align: center;
      font-size: 0.95rem;
      color: #9ca3af;
    }

    .site-subtitle span {
      color: #38bdf8;
      font-weight: 600;
    }

    .main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 0;
    }

    .games-card {
      
      padding: 14px 18px;
      background: radial-gradient(circle at top, #111827, #020617);
      border: 1px solid rgba(148,163,184,0.4);
      box-shadow: 0 8px 22px rgba(15,23,42,0.9);
      display: flex;
      flex-direction: column;
      gap: 14px;
      flex: 1;
    }

    .games-title {
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: #9ca3af;
      text-align: center;
    }

    .games-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex: 1;
      justify-content: center;
    }

    @media (min-width: 768px) {
      .games-grid {
        flex-direction: row;
      }
    }

    .game-button {
      flex: 1;
      
      border: 1px solid rgba(55,65,81,0.9);
      background: radial-gradient(circle at top, #0b1120, #020617);
      box-shadow: 0 10px 26px rgba(0,0,0,0.9);
      padding: 16px 18px;
      text-decoration: none;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 6px;
      transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    }

    .game-button:hover {
      transform: translateY(-3px);
      box-shadow: 0 14px 32px rgba(37,99,235,0.45);
      border-color: #60a5fa;
    }

    .game-button:active {
      transform: translateY(-1px);
      box-shadow: 0 8px 20px rgba(37,99,235,0.45);
    }

    .game-title {
      font-size: 1.2rem;
      font-weight: 800;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      text-align: center;
      color: #f9fafb;
    }

    .game-tagline {
      font-size: 0.9rem;
      text-align: center;
      color: #e5e7eb;
    }

    .game-pill {
      margin-top: 4px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      border: 1px solid rgba(96,165,250,0.7);
      color: #93c5fd;
    }

    .game-button.tombola {
      border-color: rgba(250,204,21,0.7);
      box-shadow: 0 10px 26px rgba(250,204,21,0.35);
    }

    .game-button.tombola:hover {
      box-shadow: 0 14px 32px rgba(250,204,21,0.5);
      border-color: #facc15;
    }

    .game-button.twoletters {
      border-color: rgba(56,189,248,0.7);
      box-shadow: 0 10px 26px rgba(56,189,248,0.45);
    }

    .game-button.twoletters:hover {
      box-shadow: 0 14px 32px rgba(56,189,248,0.65);
      border-color: #38bdf8;
    }

    .site-footer {
      text-align: center;
      font-size: 0.8rem;
      color: #6b7280;
    }
  
    /* Header uniforme come nei giochi */
    .site-header {
      padding: 8px 12px 0;
      text-align: center;
      border-radius: 0;
      background: none;
      box-shadow: none;
      display: block;
    }
    .site-title-link {
      display: inline-block;
      font-weight: 800;
      font-size: 1.35rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: #facc15;
      text-decoration: none;
    }
    .site-title-link:hover,
    .site-title-link:focus {
      text-shadow: 0 0 8px rgba(250,204,21,0.7);
    }

  

/* Tombola */


    :root {
      --bg: #020617;
      --bg-alt: #111827;
      --card-bg: radial-gradient(circle at top, #111827, #020617);
      --border-soft: rgba(148,163,184,0.35);
      --text-main: #e5e7eb;
      --text-soft: #9ca3af;
      --text-strong: #f9fafb;
      --primary: #2563eb;
      --primary-alt: #1d4ed8;
      --accent: #22c55e;
      --danger: #ef4444;
      --warning: #f97316;
      --chip-bg: #1f2937;
      --chip-soft: #0f172a;
      --chip-text: #e5e7eb;
    }

    * { box-sizing: border-box; }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      margin: 0;
      padding: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      min-height: 100vh;
      color: var(--text-main);
    }

    h1, h2, h3 {
      margin: 0;
      text-align: left;
      font-weight: 700;
      color: var(--text-strong);
    }

    .page {
      width: 100%;
      max-width: 1200px;
      display: none;
    }

    .card {
      background: var(--card-bg);
      padding: 0px;
      
      box-shadow: 0 8px 24px rgba(0,0,0,0.55);
      margin-bottom: 10px;
      border: 0px
    }

    .center { text-align: center; }

    .header-bar {
      width: 100%;
      max-width: 100%;
      
      color: #fff;
      padding: 0px 16px;
      
      display: flex;
      align-items: center;
      justify-content: space-between;
      
    }

    .header-title {
      font-size: 40px;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #f9fafb;
    }

    .home-btn {
      background: rgba(15,23,42,0.9);
      color: #e5e7eb;
      border: 1px solid rgba(148,163,184,0.7);
      box-shadow: 0 4px 12px rgba(0,0,0,0.7);
      padding: 6px 10px;
      font-size: 18px;
      border-radius: 999px;
    }

    .home-btn:hover {
      background: rgba(30,64,175,0.85);
    }

    button {
      border: none;
      border-radius: 6px;
      padding: 8px 16px;
      font-size: 16px;
      cursor: pointer;
      background: linear-gradient(135deg, var(--primary), var(--accent));
      color: #f9fafb;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
      box-shadow: 0 6px 18px rgba(15,23,42,0.9);
      text-transform: none;
    }

    button:hover {
      background: linear-gradient(135deg, var(--primary-alt), var(--accent));
    }

    button:active {
      transform: translateY(1px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.8);
    }

    button.secondary {
      background: #020617;
      color: var(--text-main);
      border: 1px solid var(--border-soft);
      box-shadow: 0 3px 10px rgba(0,0,0,0.7);
    }

    button.secondary:hover {
      background: #030712;
    }

    button:disabled {
      background: #4b5563;
      cursor: not-allowed;
      box-shadow: none;
      opacity: 0.6;
    }

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

    .small-label {
      font-size: 13px;
      color: var(--text-soft);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    /* TABELLONE layout */
    #page-tabellone {
      display: none;
      flex-direction: column;
      gap: 8px;
    }

    #tabellone-layout {
      display: grid;
      grid-template-columns: 2.2fr 1.1fr;
      gap: 10px;
      align-items: stretch;
    }

    @media (max-width: 900px) {
      #tabellone-layout {
        grid-template-columns: 1fr;
      }
    }

    .board {
      background: radial-gradient(circle at top, #020617, #000000);
      box-shadow: 0 10px 30px rgba(0,0,0,0.9);
      display: flex;
      flex-direction: column;
    }

    /* Griglia 2x3 delle 6 cartelle del tabellone: sempre 2 colonne, anche su mobile */
    .board-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 0px;
    }

    .board-card {
      
      border: 0px solid rgba(148,163,184,0.7);
      padding: 0px;
      background: radial-gradient(circle at top, #020617, #020617);
      box-shadow: 0 4px 12px rgba(0,0,0,0.85);
    }

    .board-card table {
      border-collapse: collapse;
      width: 100%;
    }

    .board-card td {
      border: 1px solid #666;
      text-align: center;
      font-size: min(3.4vw, 56px);
      font-weight: 700;
      color: #e5e7eb;
      padding: 4px 0;
      background: #020617;
      user-select: none;
    }

    .board-card td.drawn {
      background: #fbbf24;
      color: #111827;
      border-color: #111827;
    }

    .controls {
      /*! background: radial-gradient(circle at top, #111827, #020617); */
      padding: 40px;
      
      /*! box-shadow: 0 10px 26px rgba(0,0,0,0.9); */
      /*! border: 1px solid var(--border-soft); */
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    #current-number {
      font-size: 52px;
      font-weight: 800;
      margin-top: 4px;
      text-align: center;
      color: #f97316;
      text-shadow: 0 0 12px rgba(248, 250, 252, 0.2);
    }

    .history {
      background: #020617;
      border-radius: 0px;
      padding: 6px 10px;
      min-height: 34px;
      font-size: 16px;
      text-align: center;
      border: 1px solid rgba(55,65,81,0.9);
      box-shadow: inset 0 0 10px rgba(15,23,42,0.9);
      margin-top: 5px
    }

    .history span {
      display: inline-block;
      margin: 2px 6px;
      padding: 3px 12px;
      background: #1f2937;
      border-radius: 999px;
      font-weight: 600;
      font-size: 18px;
      color: #e5e7eb;
      box-shadow: 0 2px 8px rgba(0,0,0,0.8);
    }

    .operation-box {
      background: #020617;
      margin-top: 5px;
      padding: 8px 10px;
      text-align: center;
      border: 1px solid #fbbf24;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      font-weight: 700;
      color: #facc15;
      box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    }

    /* SCHEDE giocatori */
    #schede-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      justify-content: center;
      margin-top: 10px;
      margin-bottom: 10px;
    }

    #num-schede {
      width: 70px;
      padding: 6px 8px;
      border-radius: 999px;
      border: 1px solid var(--border-soft);
      font-size: 14px;
      text-align: center;
      background: #020617;
      color: var(--text-main);
      box-shadow: 0 3px 10px rgba(0,0,0,0.6);
    }

    .schede-container {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
      align-items: center;
    }

    .scheda {
      
      border: 1px solid rgba(148,163,184,0.7);
      padding: 8px;
      background: radial-gradient(circle at top, #020617, #020617);
      width: 100%;
      max-width: 100%;
      box-shadow: 0 6px 18px rgba(0,0,0,0.9);
    }

    .scheda-title {
      font-size: 14px;
      text-align: center;
      margin-bottom: 4px;
      font-weight: 600;
      color: #e5e7eb;
    }

    .scheda table {
      border-collapse: collapse;
      width: 100%;
    }

    .scheda td {
      border: 1px solid #1f2937;
      text-align: center;
      font-size: 15px;
      cursor: pointer;
      user-select: none;
      background: #020617;
      width: min(14vw, 48px);
      height: min(14vw, 48px);
      color: #e5e7eb;
      box-shadow: 0 3px 10px rgba(0,0,0,0.7);
    }

    .scheda td.marked {
      background: #fbbf24;
      font-weight: 700;
      color: #111827;
      box-shadow: 0 0 0 2px #facc15, 0 4px 10px rgba(0,0,0,0.8);
    }

    input[type="text"], input[type="number"], select {
      background: #020617;
      color: #e5e7eb;
      border-radius: 999px;
      border: 1px solid var(--border-soft);
      padding: 6px 8px;
      font-size: 14px;
      box-shadow: 0 3px 10px rgba(0,0,0,0.6);
    }

    input::placeholder {
      color: #6b7280;
    }

    @media (max-width: 700px) {
      .header-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
      }
      .header-title { font-size: 18px; }
      .card { padding: 12px; }
      #current-number { font-size: 44px; }
      .operation-box { font-size: 20px; }
    }

  
    /* Header del sito comune */
    .site-header {
      padding: 8px 12px 0;
      text-align: center;
    }
    .site-title-link {
      display: inline-block;
      font-weight: 800;
      font-size: 1.35rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: #facc15;
      text-decoration: none;
    }
    .site-title-link:hover,
    .site-title-link:focus {
      text-shadow: 0 0 8px rgba(250,204,21,0.7);
    }

    .header-bar {
      justify-content: center;
    }



/* 2 Lettere */

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    html, body {
      height: 100%;
      width: 100%;
      overflow: hidden;
    }
    body {
      background: #020617;
      color: #e5e7eb;
      font-size: 18px;
    }
    .game-root {
      height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 8px;
      gap: 8px;
    }
    .game-header {
      
      padding: 8px 12px;
      background: linear-gradient(135deg, #020617, #111827);
      box-shadow: 0 8px 20px rgba(0,0,0,0.45);
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex-shrink: 0;
    }
    .game-title-main {
      text-align: center;
      font-weight: 800;
      font-size: 1.25rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #f9fafb;
    }
    .game-header-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }
    .header-block {
      display: flex;
      flex-direction: column;
      gap: 2px;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #9ca3af;
    }
    .header-value {
      font-size: 1.6rem;
      font-weight: 700;
      color: #f9fafb;
    }
    .header-value.timer-warning { color: #f97316; }
    .header-value.timer-danger { color: #ef4444; }
    .game-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-height: 0;
    }
    .panel {
      
      padding: 8px 10px;
      background: radial-gradient(circle at top, #111827, #020617);
      border: 1px solid rgba(148,163,184,0.35);
      box-shadow: 0 6px 18px rgba(15,23,42,0.8);
      flex-shrink: 0;
    }
    .panel-label {
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: #9ca3af;
      margin-bottom: 4px;
    }
    .panel-word {
      font-size: clamp(1.4rem, 4.5vw, 2.2rem);
      font-weight: 800;
      letter-spacing: 0.18em;
      text-align: center;
      color: #e5e7eb;
      word-break: break-word;
    }
    .panel-word.pc-word { color: #38bdf8; }
    .panel-word.player-word { color: #a5b4fc; }
    .panel-prefix {
      margin-top: 4px;
      text-align: center;
      font-size: 0.95rem;
      color: #fbbf24;
      min-height: 1.2em;
    }
    .panel-prefix span {
      font-weight: 800;
      letter-spacing: 0.18em;
      font-size: 1.05rem;
    }
    .status-message {
      margin-top: 4px;
      min-height: 1.4em;
      font-size: 0.9rem;
      text-align: center;
      color: #e5e7eb;
    }
    .status-message.error { color: #f87171; }
    .status-message.info { color: #93c5fd; }
    .status-message.success { color: #4ade80; }
    .controls-row {
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .btn {
      border: none;
      border-radius: 999px;
      padding: 8px 16px;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease;
      white-space: nowrap;
    }
    .btn:active {
      transform: translateY(1px);
      box-shadow: none;
    }
    .btn-primary {
      background: linear-gradient(135deg, #2563eb, #22c55e);
      color: #f9fafb;
      box-shadow: 0 6px 16px rgba(37,99,235,0.45);
    }
    .btn:disabled {
      opacity: 0.4;
      cursor: default;
      box-shadow: none;
      transform: none;
    }
    .keyboard-wrapper {
      padding: 8px 6px 10px 6px;
      
      background: radial-gradient(circle at top, #020617, #000000);
      border: 1px solid rgba(55,65,81,0.95);
      box-shadow: 0 -4px 18px rgba(0,0,0,0.9);
      flex-shrink: 0;
    }
    .keyboard-row {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin-bottom: 8px;
      flex-wrap: nowrap;
    }
    .key {
      min-width: 9%;
      padding: 10px 6px;
      
      border: none;
      font-size: 1.05rem;
      font-weight: 700;
      cursor: pointer;
      background: #111827;
      color: #e5e7eb;
      box-shadow: 0 4px 10px rgba(15,23,42,0.9);
      transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease;
      text-align: center;
    }
    .key:active { transform: translateY(1px); box-shadow: none; }
    .key-wide { min-width: 18%; font-size: 0.85rem; }
    .key-delete { background: #b91c1c; }
    .key-action { background: #1d4ed8; }
    .key-disabled { opacity: 0.35; pointer-events: none; box-shadow: none; }
    .bottom-controls { flex-shrink: 0; }

    /* Header del sito */
    .site-header {
      padding: 0px 4px 0;
      text-align: center;
      margin-bottom: -10px;
      border-bottom: 3px solid #fff
    }
    .site-title-link {
      display: inline-block;
      font-weight: 800;
      font-size: 1.35rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: #facc15;
      text-decoration: none;
    }
    .site-title-link:hover,
    .site-title-link:focus {
      text-shadow: 0 0 8px rgba(250,204,21,0.7);
    }

    /* Link e modale Regolamento */
    .rules-link {
      text-align: center;
      margin-top: 6px;
      font-size: 0.8rem;
      color: #9ca3af;
    }
    .rules-link button {
      background: none;
      border: none;
      padding: 4px 8px 10px;
      font: inherit;
      color: inherit;
      text-decoration: underline;
      cursor: pointer;
    }

    .rules-modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(15,23,42,0.92);
      z-index: 40;
    }
    .rules-modal-backdrop.open {
      display: flex;
    }
    .rules-modal-panel {
      max-width: 500px;
      width: 100%;
      background: #020617;
      
      padding: 18px 20px;
      border: 1px solid rgba(148,163,184,0.7);
      box-shadow: 0 24px 60px rgba(0,0,0,0.9);
    }
    .rules-modal-panel h2 {
      font-size: 1.1rem;
      margin-bottom: 6px;
      text-align: center;
      color: #facc15;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .rules-modal-panel p {
      font-size: 0.9rem;
      margin-bottom: 6px;
    }
    .rules-modal-panel ul {
      font-size: 0.9rem;
      padding-left: 1.1rem;
      margin-bottom: 8px;
    }
    .rules-modal-panel li {
      margin-bottom: 4px;
    }
    .rules-modal-footer {
      text-align: center;
      margin-top: 10px;
    }

    @media (max-height: 640px) {
      body { font-size: 16px; }
      .game-title-main { font-size: 1.1rem; }
      .panel-word { font-size: clamp(1.3rem, 4vw, 2rem); }
      .key { padding: 8px 4px; font-size: 0.95rem; }
    }
  