﻿    :root {
      --bg1: #170f27;
      --bg2: #2a1631;
      --panel: rgba(14,16,24,.86);
      --border: rgba(255,255,255,.12);
      --text: #f5f3ef;
      --blue: rgba(0,194,66,.92);
      --red: rgba(241,0,226,.92);
      --gold: #ffb85c;
      --shadow: 0 18px 44px rgba(0,0,0,.35);
      --vh: 100svh;
      font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    }

    .quozLogoImage{
display:inline-block!important;
margin:0px!important;
    }



@font-face {
  font-family: 'sudoki';
  src: url('sudoki.woff2?v=2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}



.cell {
  font-family: 'sudoki', sans-serif;
}

.cell,
.turn-indicator,
.live-battle-bar,
.picker button,
.actions button,
.overlay button,
.menu-overlay button {
  font-kerning: none;
  font-variant-ligatures: none;
}



    @supports (height: 100dvh) { :root { --vh: 100dvh; } }
    * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    html, body {
      margin: 0;
      min-height: 100%;
      overscroll-behavior: none;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), transparent 40%),
        linear-gradient(180deg, var(--bg1), var(--bg2));
      color: var(--text);
    }
    body {
      min-height: var(--vh);
      overflow: hidden;
    }
    body.menu-open .game-shell {
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }
    .scene {
      position: relative;
      min-height: var(--vh);
      display: grid;
      place-items: center;
      padding: 18px;
      overflow: hidden;
      isolation: isolate;
          background-image: url(background2.jpg);
    background-size: cover;
}
.logoimg{
filter: drop-shadow(4px 6px 8px rgba(0, 0, 0, 0.45));

}    


    .scene::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.5)),
        radial-gradient(circle at 75% 30%, rgba(255,255,255,.14), transparent 32%);
      z-index: 0;
    }
    .matrix-layer {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      opacity: .92;
      mix-blend-mode: screen;
    }
    .matrix-layer canvas {
      width: 100%;
      height: 100%;
      display: block;
    }
    .game-shell {
      position: relative;
      z-index: 2;
      width: min(94vw, 560px);
      margin-top:80px;
    }

    .top-shell{
    position:absolute;
    width:100%;
    top:20px;
    max-width:600px;
    justify-items: center;
    }



    .dialog {
      position: relative;
      border-radius: 24px;
    border: 1px solid #00000066;
    background: #00000055;
      box-shadow: var(--shadow);
      padding: 18px 16px 16px;
      backdrop-filter: blur(8px);
      transition: background .25s ease, border-color .25s ease;
    }
    .dialog.turn-p1 {
     /* background: linear-gradient(180deg, rgba(10,18,38,.92), rgba(14,16,24,.9));
      border-color: rgba(82,160,255,.28); */
    }
    .dialog.turn-p2 {
     /* background: linear-gradient(180deg, rgba(44,14,18,.92), rgba(14,16,24,.9));
      border-color: rgba(255,120,120,.28); */
    }
    .turn-indicator {
    padding: 5px;
    text-align: left;
    font-size: 36px;
    font-weight: bold;
    letter-spacing: .01em;
    position: absolute;
    top: 20px;
    /* max-width: 700px; */
    color: white;
    text-shadow: 2px 2px 5px #000000dd;
    z-index: 10;
    font-family: 'sudoki';   
  }
/*
    .turn-indicator.p1 { color: var(--blue); }
    .turn-indicator.p2 { color: var(--red); }
*/
    .message {
    line-height: 1.1;
    white-space: pre-wrap;
    text-align: center;
    color: #000000;
    font-size: 20px;
    position: absolute;
    top: 110px;
    font-weight: bold;
    max-width: 700px;
    padding: 7px 12px;
    border-radius: 35px;
    backdrop-filter: blur(5px);
    background-color: #ffffff;
    border: 1px solid #000000;
    max-width: 700px;
    box-shadow: 0px 2px 10px #00000055;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease;
    font-style: italic;
    min-width:80px;
    }
.message::before {
  content: "";
  position: absolute;
    top: -30px;
    right: 10px;
    width: 40px;
    height: 40px;
  background: url(fumetto.png) no-repeat center / contain;
  pointer-events: none;
}
#menuIntro{
text-align: left;
}

.menu-open .turn-indicator{
  display:none;
}
.menu-open .message{
  display:none;
}
.menu-open .live-battle-bar{
  display:none;
}
.menu-open .actions{
  display:none;
}
    .cursor {
      display: inline-block;
      margin-left: 2px;
      animation: blink .5s step-end infinite;
    }
    @keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
    .board-wrap {
      position: relative;
      display: grid;
      justify-items: center;
    }
    .board {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      width: min(100%, 530px);
    }
    .box {
      position: relative;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 2px;
      padding: 4px;
      border-radius: 30px;
      border: 2px solid rgba(255,255,255,.24);
      background: rgba(255,255,255,.06);
      overflow: hidden;
    }
    .box.x { border-color: var(--blue); background: rgba(255,255,255,.8); }
    .box.o { border-color: var(--red); background: rgba(255,255,255,.8); }
    .box.x::after, .box.o::after {
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: .5;
      background-position: center;
      background-repeat: no-repeat;
      background-size: 90% 90%;
    }
    .box.x::after { content: ""; background-image: url("x.png"); }
    .box.o::after { content: ""; background-image: url("o.png"); }
    @keyframes tris-bounce {
      0%   { transform: scale(1); }
      50%  { transform: scale(2); }
      100% { transform: scale(1); }
    }
    .box.tris-win-0::after, .box.tris-win-1::after, .box.tris-win-2::after {
      animation-name: tris-bounce;
      animation-duration: 0.5s;
      animation-timing-function: ease-in-out;
      animation-iteration-count: 2;
      animation-fill-mode: both;
    }
    .box.tris-win-0::after { animation-delay: 0s; }
    .box.tris-win-1::after { animation-delay: 0.3s; }
    .box.tris-win-2::after { animation-delay: 0.6s; }
    .box.x.mark-new.tris-win-0::after, .box.o.mark-new.tris-win-0::after {
      animation-name: mark-appear, tris-bounce;
      animation-duration: 4.5s, 0.5s;
      animation-timing-function: ease-out, ease-in-out;
      animation-delay: calc(-1 * var(--mark-elapsed, 0s)), 0s;
      animation-iteration-count: 1, 2;
      animation-fill-mode: forwards, both;
    }
    @keyframes mark-appear {
      0%   { transform: scale(2); opacity: 0; }
      44%  { transform: scale(1); opacity: 1; }
      89%  { transform: scale(1); opacity: 1; }
      100% { transform: scale(1); opacity: .5; }
    }
    .box.x.mark-new::after, .box.o.mark-new::after {
      opacity: 1;
      animation-name: mark-appear;
      animation-duration: 4.5s;
      animation-delay: calc(-1 * var(--mark-elapsed, 0s));
      animation-timing-function: ease-out;
      animation-fill-mode: forwards;
      animation-iteration-count: 1;
    }
    .box.box-claimed-p1 { border-color: #0bc60b; background: rgba(11,198,11,.18); }
    .box.box-claimed-p2 { border-color: #d909cb; background: rgba(217,9,203,.18); }
    .box.box-completed-p1 { border-color: #0bc60b; background: rgba(11,198,11,.58); }
    .box.box-completed-p2 { border-color: #d909cb; background: rgba(217,9,203,.58); }
    .cell {
      position: relative;
      aspect-ratio: 1;
      border: 0px;
     /*  border: 1px solid rgba(255,255,255,.14); */
      border-radius: 50%;
      background: rgba(255,255,255,.05);
      color: #fff;
      display: grid;
      place-items: center;
      padding: 0;
      font: 700 clamp(.95rem, 2.8vw, 1.15rem)/1 inherit;
      overflow: hidden;
      cursor: default;
      font-size: 30px;

box-shadow: inset -2px -2px 0px rgba(0,0,0,0.2);


    }
    .cell.given { background: #ffffffdd; color:#777777}
    .cell.highlighted { background: #ffffff !important; color: #111 !important; outline: 2px solid rgba(255,220,100,.9); outline-offset: -2px; }
    .cell.playable {
      cursor: pointer;
      background: rgba(255,255,255,.08);
      border-color: rgba(255,255,255,.28);
    }

    .cell.selected {
      outline: 2px solid rgba(255,188,92,.95);
      outline-offset: -2px;
    }
    .cell.recent-correct {
      animation: blink-white .4s ease-out infinite;
    }
    @keyframes blink-white {
      0%,62.5% {
        background: rgba(255,255,255,.98);
        color: #121212;
        opacity: 1;
      }
      62.5001%,100% {
        background: rgba(255,255,255,.08);
        color: inherit;
        opacity: 1;
      }
    }
    .cell.placed-p1 { background: #0bc60b; color: #ffffff; }
    .cell.placed-p2 { background: #d909cb; color: #ffffff; }
    @keyframes flash-placed-p1 {
      0%, 40%   { background: #ffffff; color: #111; }
      60%, 100% { background: #0bc60b; color: #fff; }
    }
    @keyframes flash-placed-p2 {
      0%, 40%   { background: #ffffff; color: #111; }
      60%, 100% { background: #d909cb; color: #fff; }
    }
    .cell.cell-placed-p1 { animation: flash-placed-p1 .45s ease-out 3 forwards; }
    .cell.cell-placed-p2 { animation: flash-placed-p2 .45s ease-out 3 forwards; }
    .last-wrong {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      color: rgb(255, 252, 49);
      font-size: 25px;
      font-weight: normal;
      line-height: 1;
      pointer-events: none;
      border-radius: inherit;
    }
    .last-wrong.recent-wrong {
      color: rgb(255, 252, 49);
      animation: blink-red .4s ease-out infinite;
    }
    @keyframes blink-red {
      0%,62.5% {
        background: rgb(255, 252, 49);
        color: #ff4646;
        opacity: 1;
      }
      62.5001%,100% {
        background: transparent;
      color: rgb(255, 252, 49);
        opacity: 1;
      }
    }
    .notes {
      position: absolute;
      left: 4px;
      right: 4px;
      color: rgb(255, 252, 49);
      font-size: .56rem;
      line-height: 1.08;
      text-align: center;
      pointer-events: none;
    }
    .notes-bottom {
      bottom: 3px;
    }
    .notes-top {
      top: 3px;
    }
    .picker {
      position: absolute;
      z-index: 10;
      transform: translate(-50%, -50%);
      width: 120px;
      padding: 4px;
      border-radius: 22px;
      background: rgba(255,255,255,.8);
      border: 1px solid rgba(0,0,0,.18);
      box-shadow: 0 14px 34px rgba(0,0,0,.35);
      animation: picker-pop .3s ease-out;
    }
    .picker.is-closing {
      pointer-events: none;
      animation: picker-close .3s ease-out forwards;
    }
    .picker-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 3px;
    }
    .picker button {
      min-height: 35px;
      min-width: 35px;
      border-radius: 50%;
      border: 1px solid rgba(0,0,0,.16);
      background: #fff;
      color: #111;
font-size: 23px;
    font-weight: bold;
      cursor: pointer;
      font-family: 'sudoki', sans-serif;
      
box-shadow: inset -2px -2px 0px rgba(0,0,0,0.2), 2px 2px 4px rgba(0,0,0,0.2);
    }
    .picker button:disabled {
      background: #ececec;
      color: #999;
      border-color: rgba(0,0,0,.08);
      cursor: not-allowed;
      opacity: .55;
    }
      .picker button:active {
      background: #ff00ef;
      border: 1px solid #ffffff;
      color: #FFFFFF;
              box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.2), 0px 0px 4px rgba(0, 0, 0, 0.2);
}
    @keyframes picker-pop {
      from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
      }
      to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
      }
    }
    @keyframes picker-close {
      from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
      }
      to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
      }
    }
    .actions {
      height: 44px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: 10px;
      width:100%;
      position:absolute;
      max-width:600px;
      bottom:20px;
      z-index: 10;
      padding:10px;
    }
    .actions button,
    .overlay button,
    .menu-overlay button {
    width: 28%;
      min-height: 35px;
      padding: 0 10px;
      border: 0;
      border-radius: 999px;
    background: #ffffffdd;
    border: 1px solid #77777799;
      color: #000000;
      font: 800 .96rem/1 inherit;
      cursor: pointer;
          margin: 2px 5px;
          font-size: 18px;
          backdrop-filter: blur(4px);
    font-family: 'sudoki';   
        box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.2), 2px 2px 4px rgba(0, 0, 0, 0.2);
   }

    .actions button:active, .menu-overlay button:active{
background-color:#ff00ef;
color:#ffffff;


        box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.2), 0px 0px 4px rgba(0, 0, 0, 0.2);

    }
#actionsLogo{
 background: none;
    border: 0;
    backdrop-filter: none;
    padding: 0;
    width:44%;
}
    #actionsLogo img{
      width:100%;
    }

    .menu-overlay,
    .overlay {
      position: absolute;
      inset: 0;
      display: none;
      place-items: center;
      padding: 18px;
      // background: rgba(7,8,12,.32);
      z-index: 20;
    }
    .menu-overlay.show,
    .overlay.show { display: grid; }
    .card {
    width: min(100%, 530px);
      border-radius: 22px;
      background: #00000066;
      border: 1px solid #00000077;
      box-shadow: var(--shadow);
      padding: 18px;
      text-align: center;
      max-height: 40vh;
      overflow-y:auto;
      
    backdrop-filter: blur(8px);
    }
    .menu-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-top: 14px;
    }
    .menu-actions > p {
      flex-basis: 100%;
      margin: 4px 0 0;
    }
    
    button.mode-tile {
    flex: 0 0 calc(30% - 6px);
    aspect-ratio: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 5px !important;
    border-radius: 16px !important;
    min-height: unset !important;
    width: auto !important;
    font-size: unset !important;
    gap: 2px;
    overflow: hidden;
    /*  border: 5px solid #00000033 !important; */
      background-color:#ed86ff ;

box-shadow: inset -3px -5px 0px rgba(0, 0, 0, 0.2), 3px 5px 4px rgba(0, 0, 0, 0.4)

    }


button.mode-tile:active{
box-shadow: inset -1px -2px 0px rgba(0, 0, 0, 0.2), 1px 1px 2px rgba(0, 0, 0, 0.3)
}

    button.mode-tile.live-btn {
      background-color: #ffb949;
    }
    .mode-tile-img {
      display: block;
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
      pointer-events: none;
    }
    .mode-tile-label {
      font-size: 15px;
      font-weight: bold;
      text-align: center;
      line-height: 1.2;
      word-break: break-word;
      pointer-events: none;
      text-transform: uppercase;
    }
    .online-panel {
      display: none;
      gap: 10px;
      margin-top: 14px;
      text-align: left;
    }
    .online-panel.show { display: grid; }
    .online-divider {
      margin: 2px 0;
      border: 0;
      border-top: 1px solid rgba(255,255,255,.12);
    }
    .online-block {
      display: grid;
      gap: 10px;
    }
    .online-block[hidden],
    .online-divider[hidden],
    .active-games[hidden] {
      display: none !important;
    }
    .online-block-title {
      margin: 0;
      text-align: center;
      font-size: 1rem;
      font-weight: 800;
      color: rgba(255,255,255,.92);
    }
    .menu-overlay label {
      display: grid;
      gap: 6px;
      font-size: .9rem;
      color: rgba(255,255,255,.8);
    }
    .menu-overlay input,
    .menu-overlay select {
      min-height: 40px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.18);
      background: rgba(255,255,255,.08);
      color: #fff;
      padding: 0 12px;
      font: 700 16px/1 inherit;
    }
    .menu-overlay select option {
      color: #b9b9b9;
      background: #1c1d22;
    }
    .join-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      align-items: end;
    }
    .join-row label {
      min-width: 0;
    }
    .join-row label input {
      width: 100%;
      box-sizing: border-box;
    }
    .join-row button {
      min-width: 160px;
      min-height: 40px;
      align-self: end;
    }
    .create-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: end;
    }
    .create-row label {
      min-width: 0;
    }
    .create-row button {
      min-width: 124px;
      min-height: 40px;
      align-self: end;
    }
    .online-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .online-actions.single {
      grid-template-columns: 1fr;
    }
    .menu-status {
      min-height: 1.25em;
      margin: 0;
      font-size: .88rem;
      color: rgba(255,255,255,.72);
      text-align: center;
      white-space: pre-wrap;
    }
    .active-games {
      display: grid;
      gap: 10px;
      margin-bottom: 16px;
      text-align: left;
    }
    .menu-brand {
      position:absolute;
      bottom:0px;
      max-width:500px;
      padding:10px;
      text-align: right;
      overflow: hidden;
    }
    .menu-brand img {
      max-width: 22%;
      display: inline-block;
      margin: 5px;
    }
    .lang-switcher { float: left; display: inline-flex; gap: 4px; margin-top: 5px; }
    .coffee-btn {
      display: block;
      text-align: center;
      margin: 20px 0 15px;
      font-size: .8rem;
      color: rgba(255,255,255,.8);
      text-decoration: underline;
      letter-spacing: .3px;
      transition: color .2s;
    }
    .coffee-btn:active { color: rgba(255,255,255,.9); }
    button.alt-costume-btn {
      width:auto;
      min-height: auto;

      display: block;
      background: none;
      border: none;
      padding: 0;
      margin: 15px auto 20px;
      font-size: .75rem;
      color: rgba(255,255,255,.5);
      cursor: pointer;
      letter-spacing: .3px;
      transition: color .2s;
      padding: 2px 5px;
      border:1px solid #ffffff99;
  
    }
    button.alt-costume-btn:active { background-color: #ffffff88; 
    color:#000000;}
    button.alt-costume-btn.is-on { background-color: #ffffffcc; 
    color:#000000;    }
    button.alt-costume-btn.locked { opacity: .5; }
    button.alt-costume-btn.locked.msg-show { opacity: 1 !important; color: #fff; }
    button.lang-btn {
      background: rgba(255,255,255,.1);
      border: 1px solid rgba(255,255,255,.2);
      color: rgba(255,255,255,.55);
      border-radius: 50%;
      font-size: 11px!important;
      font-weight: 900;
      width: 24px;
      height: 24px;
      padding: 0!important;
      cursor: pointer;
      min-height: unset !important;
      line-height: 1;
    }
    button.lang-btn.active {
      background: rgba(255,255,255,.9);
      color: #000000;
      border-color: rgba(255,255,255,.5);
    }
    button.music-toggle-btn {
      font-size: 15px !important;
    }
    .active-games[hidden] { display: none; }
    .active-games h3 {
      margin: 0;
      font-size: 1rem;
      text-align: center;
    }
    .active-game-list {
      display: grid;
      gap: 8px;
    }
    .active-game-item {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.1);
    }
    .active-game-icon {
      height: 44px;
      width: auto;
      object-fit: contain;
      display: block;
      flex-shrink: 0;
    }
    .active-game-item.is-your-turn {
      background: rgba(48, 126, 72, .34);
      border-color: rgba(113, 214, 136, .42);
      box-shadow: inset 0 0 0 1px rgba(113, 214, 136, .14);
    }
    .active-game-main {
      min-width: 0;
    }
    .active-game-item strong {
      display: block;
      font-size: .95rem;
    }
    .active-game-meta {
      margin: 0;
      font-size: .84rem;
      line-height: 1.35;
      color: rgba(255,255,255,.72);
      white-space: pre-wrap;
    }
    .active-game-actions {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 8px;
    }
    .active-game-actions button {
      min-width: 96px;
      min-height: 34px;
      font-size: .86rem;
      background-color:rgb(82, 235, 11);
    }

    .active-games[hidden] { display: none; }
    .active-games h3 {
      margin: 0;
      font-size: 1rem;
      text-align: left;
    }
    .active-game-list {
      display: grid;
      gap: 8px;
    }
    .active-game-item {
      display: grid;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.1);
    }
    .active-game-item strong {
      display: block;
      font-size: .95rem;
    }
    .active-game-meta {
      margin: 0;
      font-size: .84rem;
      color: rgba(255,255,255,.72);
      line-height: 1.35;
      white-space: pre-wrap;
    }
    .active-game-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .active-game-actions button {
      min-width: 100px;
      min-height: 34px;
      font-size: .88rem;
    }
    .invite-link {
      display: none;
      margin: 0 0 12px;
      text-align: center;
      font-size: .82rem;
      line-height: 1.35;
      color: rgba(255,255,255,.76);
      text-decoration: underline;
      text-underline-offset: 3px;
      cursor: pointer;
      word-break: break-all;
    }
    .invite-link.show { display: block; }
    .card h2 { margin: 0 0 10px; }
    .card p { margin: 0 0 14px; color: rgba(255,255,255,.7); line-height: 1.4; }
    .card img {
      /*
      width: 100%;
      max-height: 48vh;
      object-fit: contain;
      border-radius: 14px;
      display: none;
      margin-bottom: 12px;
      */

    }
    .card img.show { display: block; }
    .overlay-actions {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .overlay .secondary,
    .menu-overlay .secondary { background: #ffffffcc;
    }
    .intro-overlay {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(7,8,12,.82);
      z-index: 200;
      backdrop-filter: blur(4px);
    }
    .intro-overlay[hidden] { display: none; }
    .intro-card {
      width: min(92vw, 380px);
      border-radius: 24px;
      background: rgba(18,20,28,.97);
      border: 1px solid rgba(255,255,255,.14);
      box-shadow: var(--shadow);
      padding: 24px 20px 20px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }
    .intro-howto-img {
      width: 100%;
      max-width: 320px;
      border-radius: 12px;
    }
    .intro-card h2 {
      margin: 0;
      font-size: 1.25rem;
      color: #fff;
    }
    .intro-card p {
      margin: 0;
      color: rgba(255,255,255,.75);
      line-height: 1.5;
      font-size: .95rem;
    }
    .intro-card button {
      margin-top: 4px;
    min-width: 125px;
    min-height: 32px;
    font-size: 17px;
      border-radius:20px;
    }
    .confirm-overlay {
      position: absolute;
      inset: 0;
      display: none;
      place-items: center;
      padding: 18px;
      background: rgba(7,8,12,.62);
      z-index: 25;
    }
    .confirm-overlay.show { display: grid; }
    .confirm-card {
      width: min(92vw, 340px);
      border-radius: 22px;
      background: rgba(18,20,28,.96);
      border: 1px solid rgba(255,255,255,.12);
      box-shadow: var(--shadow);
      padding: 18px;
      text-align: center;
    }
    .confirm-card h3 {
      margin: 0 0 10px;
      font-size: 1.15rem;
    }
    .confirm-card p {
      margin: 0 0 14px;
      color: rgba(255,255,255,.76);
      line-height: 1.4;
    }
    .confirm-actions {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .confirm-actions button {
      min-width: 118px;
      min-height: 38px;
      padding: 0 16px;
      border-radius: 999px;
      font-size: 1rem;
      font-weight: 700;
      color:#000000;
    }

#menuOverlay{
  /* overflow-y:auto; */
}


.box.o .cell{
  background-color:#ffffff;
  color:#555555;
}
.box.x .cell{
  background-color:#ffffff;
  color:#555555;
}


















@media (orientation: portrait) {
  

    .top-shell{
      justify-items: left;
    }

      .turn-indicator{
    max-width: 50%;
      }


    .mode-tile-img {
    width: 40px;
    height: 40px;
    }



#menuIntro{
text-align: center;
}
.nomobile{
  display:none;
}
.active-games h3{
  text-align:center;
}

   .actions button,
    .overlay button {
    min-height: 25px;
    padding: 0 5px;
      font-size: 11px;

    }

      .card {
        max-height:50vh;
}
      .box{
        border-radius:19px;
      }
      .cell{
        font-size:22px;
        line-height: 22px;
      }
      .last-wrong{
        font-size:16px;
      }
      .notes-bottom {
        bottom: 0px;
}
.notes-top{
  top:0px;
}
      .game-shell { width: min(100%, 560px); }
      .dialog { padding: 16px 12px 14px; }
      .picker {
        width: 168px;
        padding: 10px;
                border-radius: 30px;
      }
      .picker-grid { gap: 6px; }
      .picker button {
        min-height: 45px;
font-size: 25px;
        font-weight: bold;
      }
      .menu-overlay input,
      .menu-overlay select {
        font-size: 16px;
      }
    }


























    body .auth-widget {
      opacity: 0;
      pointer-events: none;
    }
    body.menu-open .auth-widget {
      opacity: 1;
      pointer-events: auto;
    }
    .auth-widget {
      position: absolute;
      top: max(12px, env(safe-area-inset-top));
      left: max(12px, env(safe-area-inset-right));
      z-index: 26;
      display: grid;
      gap: 8px;
    }
    .auth-button {
      min-width: 44px;
      height: 44px;
      border-radius: 999px;
      border: 2px solid rgba(255,255,255,.72);
      background: rgba(18,20,28,.78);
      color: #fff;
      display: inline-grid;
      place-items: center;
      padding: 0 13px;
      font: 900 13px/1 inherit;
      letter-spacing: 1px;
      box-shadow: 0 8px 24px rgba(0,0,0,.28);
      cursor: pointer;
    }
    .auth-button.is-logged {
      width: 48px;
      min-width: 48px;
      padding: 0;
      background: rgba(82,160,255,.85);
    }
    .auth-button img {
      width: 100%;
      height: 100%;
      display: block;
      border-radius: 999px;
      object-fit: cover;
    }
    .auth-button.is-pending { visibility: hidden; }
    .auth-button.is-offline {
      border-color: rgba(255,255,255,.25);
      color: rgba(255,255,255,.35);
      background: transparent;
      cursor: default;
      box-shadow: none;
      pointer-events: none;
    }
    .mode-tile.requires-online {
      opacity: .5;
      pointer-events: none;
    }
    .auth-menu {
      display: none;
      width: min(92vw, 320px);
      padding: 14px;
      border-radius: 18px;
      background: rgba(18,20,28,.96);
      border: 1px solid rgba(255,255,255,.16);
      box-shadow: 0 8px 32px rgba(0,0,0,.6);
      color: #fff;
    }
    .auth-menu.show {
      display: grid;
      gap: 10px;
    }
    .auth-menu label {
      display: grid;
      gap: 5px;
      color: rgba(255,255,255,.6);
      font-size: .82rem;
      font-weight: 800;
      margin-top:5px;
    }
    .auth-menu input {
      width: 100%;
      min-height: 42px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.18);
      background: rgba(255,255,255,.08);
      color: #fff;
      padding: 0 12px;
      font: 800 15px/42px inherit;
      box-sizing: border-box;
      margin-bottom:10px;
    }
    .auth-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .auth-actions button,
    .auth-menu button {
      min-height: 38px;
      min-width: 0;
      padding: 7px 12px;
      font-size: 13px;
      letter-spacing: 1px;
      border-radius:40px;
    }
    .auth-google-container {
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      overflow: hidden;
      background: #fff;
    }
    .auth-google-container > div,
    .auth-google-container iframe {
      width: 100% !important;
    }
    .auth-status {
      min-height: 18px;
      color: rgba(255,255,255,.55);
      font-size: .8rem;
      line-height: 1.3;
    }
    .friend-list {
      display: grid;
      gap: 7px;
    }
    .friend-list-title {
      color: rgba(255,255,255,.6);
      font-size: .82rem;
      font-weight: 900;
      margin-top: 2px;
    }
    .friend-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      padding: 6px 8px;
      border-radius: 12px;
      background: rgba(255,255,255,.07);
    }
    .friend-actions {
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .friend-actions button {
      min-height: 30px !important;
      padding: 5px 8px !important;
      font-size: 8px !important;
    }
    .friend-row span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: .82rem;
      font-weight: 800;
    }
    .auth-stats {
      display: grid;
      gap: 4px;
      padding: 8px 10px;
      border-radius: 12px;
      background: rgba(255,255,255,.08);
      color: rgba(255,255,255,.86);
      text-align: left;
      font-size: .8rem;
      line-height: 1.3;
    }
    .auth-stats strong {
      color: #fff;
      font-size: .92rem;
    }
    .auth-stats em {
      color: rgba(255,255,255,.62);
      font-size: .68rem;
      font-style: italic;
      font-weight: 400;
    }
    .auth-stats small {
      color: rgba(255,255,255,.65);
      font-size: .72rem;
    }
    .auth-logged-panel {
      display: none;
      gap: 10px;
    }
    .auth-widget.is-logged .auth-login-panel {
      display: none;
    }
    .auth-widget.is-logged .auth-logged-panel {
      display: grid;
    }

    .tris-btn {  background-color: #fb7aff !important; }
    .tris-btn:active { background: #ffffff !important; color: #000000 !important; }

    .live-btn {  background-color: #68ff3a !important; }
    .live-btn:active { background: #ffffff !important; color: #000000 !important; }
    .live-battle-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
      font-weight: 900;
      position: absolute;
      top: 40px;
      left: 50%;
      transform: translateX(-50%);
      width: 95%;
      max-width: 700px;
      z-index: 10;
    font-family: 'sudoki';   
    }
    .live-battle-p { display: flex; align-items: center; gap: 8px; }
    .live-battle-p.p1 { color: #4adf4a; }
    .live-battle-p.p2 { color: #c080f0; text-align:right }
    .live-battle-score {     font-size: 35px;
    min-width: 50px; 
    min-height: 50px; text-align: center; padding:5px; color:#ffffff; box-shadow:0px 5px 15px #00000099;border-radius:50px;   
   }

    .p1 .live-battle-score{
      background-color: #4adf4a; 
    }    
    .p2 .live-battle-score{
      background-color: #c080f0; 
    }
    .live-battle-name { font-size: 30px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow:0px 3px 10px #000000dd;     padding: 5px;
    border-radius: 10px;}
    .live-battle-center { color: rgba(255,255,255,.7); font-size: 22px; text-decoration: italic;      padding: 5px 15px;
    border-radius: 30px;
    backdrop-filter: blur(4px);}
    .live-blocked-msg { color: #ff5555dd; font-weight: 900; animation: blink-red .4s ease-out infinite; }
    .score-delta { z-index: 12; font-size: 25px; min-height:35px; font-weight: bold; opacity: 0; transition: opacity .2s; pointer-events: none; color: #111111; background: #ffffaa; border-radius: 999px; padding: 2px; white-space: nowrap; box-shadow:0px 3px 10px #000000dd }
    .score-delta.show { opacity: 1; }
    .score-float-badge { position: fixed; z-index: 9999; background: #ffffff; color: #111111; border-radius: 999px; padding: 4px 13px; font-size: 1.05rem; font-weight: 900; pointer-events: none; box-shadow: 0 2px 14px rgba(0,0,0,.7); white-space: nowrap; user-select: none; }
    .score-float-badge.negative { color: #cc0000; }




















@media (orientation: portrait) {




.scene{
padding:7px;

}
.mode-tile-label {
  font-size:12px;
}

.menu-overlay, .overlay {
  padding:7px;
}

.active-game-actions button{
  font-size:12px;
}


.live-battle-bar {
  padding:0px;
  top:0px;
}

#liveBattleScoreP1{
  margin-left:5px;
}
#liveBattleScoreP2{
  margin-right:5px;
}

    .live-battle-score {
        padding: 10px;
        font-size: 25px;
        min-width: 50px;
        min-height: 50px;
    }
    .score-delta { display: none; }
    .live-battle-p {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        max-width: 42%;
    }
    .live-battle-p.p2 { align-items: flex-end; }
    .p1 .live-battle-name { order: -1; }
    .live-battle-name {
              min-width: 60px;
        text-align: center;
                font-size: 23px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: auto;
    }
    .live-battle-center {
      font-size:15px;
    }

    }









    /* ── Mei character ─────────────────────────────────────────────────────── */
 .mei-character {
      position: fixed;
      left: 0;
      bottom: 0px;
      height: 100svh;
      width: auto;
      z-index: 1;
      pointer-events: none;
      user-select: none;
      display: block;
      transition: opacity 0.5s ease;
    }



    






@media (orientation: landscape) {




.message::before {
  content: "";
  position: absolute;
  top: auto;
  bottom: -30px;
  right: 10px;
  left: auto;
  width: 40px;
  height: 40px;
  transform: scaleY(-1);
  background: url(fumetto.png) no-repeat center / contain;
  pointer-events: none;
}

.card{
      max-height: 55vh;
    margin-bottom: 55px;
}

.logoimg{
      align-self: center!important;
}
      .actions,.menu-overlay {
        transform:translateX(-200px);
      }
   
.game-shell{
   transform: translateX(-200px)
}     
      .message, .turn-indicator{
        transform:translateX(-200px);
      }

      .live-battle-bar{
    transform: translateX(calc(-50% - 200px))
      }

.mei-character{
        left: 50%;
        transform:translateX(5%);
        bottom: 0px;
}

    }




















    





@media (orientation: portrait) {

.turn-indicator{
  top:0px;
    left: 20px;
    font-size:24px;
}
.message{
  font-size:15px;
  left:20px;
  max-width:50%;
  top:10vh;
}

.mode-battaglia .message{
  top:15vh;
}

.game-shell{
        position: absolute;
       /* width: 98%; */
        bottom: 80px;
}

      .mei-character {
        top: 10px;
        height: 50svh;
        left: 50%;
        bottom: auto;
        transform: translateX(-30%);
        -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 100px), transparent 100%);
        mask-image: linear-gradient(to bottom, black calc(100% - 100px), transparent 100%);
      }
    }
















@media (orientation: landscape) and (min-width: 1280px) and (min-height: 700px) {


.menu-brand, .logoimg, .card{
    transform: scale(1.2);
}

.game-shell{
   transform: translateX(-200px) scale(1.2);
   margin-top:110px;
}  


    }


@media (orientation: landscape) and (min-width: 1901px)  and (min-height: 900px) {

.message{
  top:90px;
}

      .picker {
        width: 130px;
        padding: 5px;
      }
      .picker-grid { gap: 6px; }
      .picker button {
        min-height: 35px;
        font-size: 1.05rem;
      }

      .game-shell {
        transform: translateX(-200px) scale(1.3);
        transform-origin: center center;
      }
    }





@media (orientation: portrait) and (max-width: 380px) {
.mode-tile-img {
    width: 40px;
    height: 40px;
}
    .mode-tile-label {
  font-size:10px;
}

}



@media (orientation: landscape) and (max-height: 500px) {
.mode-tile-img {
    width: 40px;
    height: 40px;
}

    .mode-tile-label {
  font-size:10px;
}


.game-shell {
        position: absolute;
        top: 5svh;
        margin-top: 0px;
        transform: none;
        left: 5svw;
        height: 90svh;
        width: 90svh;
}

.top-shell{
width:75svh;
max-width:75svh;
right:5svh;
transform:none;
justify-items:left;
}
    .live-battle-bar {

        transform: scale(0.8) translateX(calc(-50% - 72px));
     top:10px;
    }
.turn-indicator{
  transform:none;
  font-size:28px;
}
.actions button, .overlay button, .menu-overlay button{
  font-size:12px;
}
.cell{
  font-size:22px;
}
.mei-character{
      height: 95svh;
}
.message{
  transform:none;
  font-size:15px;
  max-width:40%;
}
.actions{
  transform:none!important;
  width:75svh;
  right:5svh;
}

.logoimg{
  max-width: 300px!important;
}
  .card{
  max-width:60%;
}
    .actions, .menu-overlay {
        transform: translateX(-50px);
    }

    .mei-character {
        transform: translateX(50%);
    }


}

