:root {
  --bs-primary: #70a374;
  --bs-primary-rgb: 112, 163, 116;
  --bs-success: #4e8054;
  --bs-font-sans-serif: Open Sans, Arial, Helvetica, sans-serif;
  --bs-body-color: #333333;
}

html,
body {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: auto;
}

body {
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  color: #333333;
  background-color: #2f5e35;
  background-image: linear-gradient(160deg, rgba(47, 94, 53, 0.78) 0%, rgba(20, 30, 22, 0.72) 100%), var(--sfondo-sede);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

svg {
  display: block;
}

header,
footer {
  position: absolute;
  width: 100%;
  z-index: 10;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
}
header a,
footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
header a:hover,
footer a:hover {
  color: #a9cdaa;
}

.lu-header {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid #70a374;
}
.lu-header .lu-brand img {
  height: 30px;
  display: block;
}
@media (min-width: 850px) {
  .lu-header .lu-brand img {
    height: 36px;
  }
}
.lu-header .lu-titolo {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  padding: 4px 12px;
  background: #70a374;
  border-radius: 4px;
}

.lu-footer {
  bottom: 0;
  text-align: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.55);
}
@media (min-width: 850px) {
  .lu-footer {
    font-size: 0.9rem;
  }
}

button span,
button strong,
button i {
  pointer-events: none;
}

.btn {
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-weight: 600;
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-lg {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  padding: 0.7rem 1rem;
}

.btn-primary {
  background-color: #70a374;
  border-color: #70a374;
  color: #fff;
  box-shadow: 0 3px 0 #4e8054;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: #4e8054 !important;
  border-color: #4e8054 !important;
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(112, 163, 116, 0.35);
}

.btn-outline-primary {
  color: #4e8054;
  border-color: #70a374;
  background: #fff;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
  color: #fff !important;
  background-color: #70a374 !important;
  border-color: #70a374 !important;
}

.btn-success {
  background-color: #2f5e35;
  border-color: #2f5e35;
}
.btn-success i {
  color: #ffc106;
}
.btn-success:hover, .btn-success:focus {
  background-color: #254a29;
  border-color: #254a29;
}

.btn-istruzioni {
  color: #333333;
  background: #f3f6f3;
  border: 1px solid #d9e3d9;
}
.btn-istruzioni i {
  color: #4e8054;
}
.btn-istruzioni:hover, .btn-istruzioni:focus {
  background: #e6efe6;
  color: #333333;
}

.form-control {
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  border-radius: 4px;
  border-color: #cfdccf;
}
.form-control:focus {
  border-color: #70a374;
  box-shadow: 0 0 0 0.25rem rgba(112, 163, 116, 0.25);
}

.fadeout {
  opacity: 0 !important;
  transition: opacity 0.5s !important;
}

.fadein {
  opacity: 1 !important;
  transition: opacity 0.5s !important;
}

#intro {
  opacity: 0;
  transition: opacity 0.5s;
  position: absolute;
  width: 80%;
}
#intro .card-body {
  overflow: auto;
  max-height: 60vh;
}

#scegli_giocatori {
  opacity: 0;
  transition: opacity 0.5s;
  position: absolute;
  width: min(92vw, 420px);
}

#scegli_nomi {
  opacity: 0;
  transition: opacity 0.5s;
  position: absolute;
  width: min(92vw, 420px);
}

#gioco {
  opacity: 0;
  transition: opacity 0.5s;
  flex: 0 1;
}

.card-cornice {
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.card {
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.97);
}
.card > .card-header {
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: initial;
  position: relative;
  color: #fff;
  background: linear-gradient(135deg, #70a374 0%, #4e8054 100%);
  border-bottom: 0;
  padding: 0.9rem 1rem;
}
.card > .card-header:before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 4px, transparent 4px 10px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0 12%, transparent 12% 88%, #000 88%);
  mask-image: linear-gradient(to bottom, #000 0 12%, transparent 12% 88%, #000 88%);
  pointer-events: none;
}
.card > .card-header.lu-intro {
  text-align: center;
  padding: 1.5rem 1rem 1.3rem;
}
.card > .card-header.lu-intro .lu-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}
.card > .card-header.lu-intro strong {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0.15rem 0 0.2rem;
}
.card > .card-header.lu-intro small {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}
.card > .card-header .lavagna {
  transition: all 0.5s;
  border-radius: 8px;
}
.card > .card-header .lavagna .color {
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  transition: all 0.5s;
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding-top: 2px;
  padding-bottom: 2px;
}
.card > .card-header .lavagna .riquadro {
  background-color: #fff;
  color: #2f5e35;
  border: 0;
  border-radius: 4px;
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 3px 0;
  padding: 2px 8px;
  transition: all 0.5s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.card > .card-header .lavagna .riquadro small {
  color: #6b7d6c;
  font-weight: 400;
}
@media (min-width: 560px) and (min-height: 810px) {
  .card > .card-header .lavagna .riquadro {
    font-size: 0.95rem;
  }
}
@media (min-width: 680px) and (min-height: 880px) {
  .card > .card-header .lavagna .riquadro {
    font-size: 1.1rem;
  }
}
.card > .card-header .lavagna .riquadro.on {
  background-color: #ffc106;
  color: #333333;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 0 14px 4px rgba(255, 193, 6, 0.7);
}
.card .card-body .lu-domanda {
  text-align: center;
  font-weight: 600;
  color: #4e8054;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}
.card .dida {
  border-bottom: 1px solid #e3ebe3;
  background: #f3f6f3;
  color: #333333;
  font-size: 0.7rem;
  line-height: 1.3em;
}
.card .dida strong {
  color: #2f5e35;
}
@media (min-width: 560px) and (min-height: 810px) {
  .card .dida {
    font-size: 0.8rem;
  }
}
@media (min-width: 680px) and (min-height: 880px) {
  .card .dida {
    font-size: 0.9rem;
  }
}
.card .card-footer {
  background: #f3f6f3;
  border-top: 1px solid #e3ebe3;
}
.card .card-footer .btn {
  font-size: 0.6rem;
}
@media (min-width: 560px) and (min-height: 810px) {
  .card .card-footer .btn {
    font-size: 0.8rem;
  }
}
@media (min-width: 680px) and (min-height: 880px) {
  .card .card-footer .btn {
    font-size: 0.9rem;
  }
}

.attivo .lavagna .color {
  transition: all 0.5s;
  background-color: rgba(255, 255, 255, 0.28);
  border-color: #ffc106;
}

.game {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding-bottom: 50px;
  padding-top: 60px;
}

#gioco .card-body {
  background: radial-gradient(circle at 50% 0%, #fff 0%, #f3f6f3 70%);
}

.game__cards {
  --lato: min(21vw, calc((100vh - 330px) / 4), 130px);
  --lato: min(21vw, calc((100dvh - 330px) / 4), 130px);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, var(--lato));
  grid-auto-rows: var(--lato);
  grid-gap: 8px;
}
@media (min-width: 560px) {
  .game__cards {
    grid-gap: 12px;
  }
}
.game__cards.no-event {
  pointer-events: none;
}

.game__card {
  position: relative;
  cursor: pointer;
  perspective: 700px;
}
.game__card.flipped, .game__card.has-match {
  pointer-events: none;
}
.game__card.flipped .game__back-card, .game__card.has-match .game__back-card {
  transform: rotateY(180deg);
}
.game__card.flipped .game__front-card, .game__card.has-match .game__front-card {
  transform: rotateY(360deg);
}
.game__card .game__both-card, .game__card .game__front-card, .game__card .game__back-card {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background: #70a374;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 400ms, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 6px 12px -6px rgba(47, 94, 53, 0.5);
}
.game__card .game__back-card {
  z-index: 1;
}
.game__card .game__front-card {
  transform: rotateY(180deg);
  background: #fff;
}
.game__card:hover .game__back-card {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #70a374, 0 8px 16px -6px rgba(47, 94, 53, 0.6);
}
.game__card img {
  border-radius: 8px;
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: all 0.3s;
}
.game__card.ok .game__front-card {
  box-shadow: 0 0 0 3px #70a374;
}
.game__card.ok .game__front-card img {
  transform: scale(1.05);
  transition: all 0.3s;
}
.game__card.ok_jolly .game__front-card img {
  transform: scale(1.05);
  box-shadow: 0 0 7px 4px #ffc106;
  transition: all 0.3s;
}

.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(20, 35, 22, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 20;
}

.messaggio {
  transform: scale(0.5);
  position: absolute;
  background-color: #ffffff;
  max-width: 640px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.messaggio ol li {
  margin-bottom: 0.4rem;
}
.messaggio ol li strong {
  color: #4e8054;
}
.messaggio.istruzioni {
  border-top: 0;
}
.messaggio.vittoria {
  background: linear-gradient(135deg, #70a374 0%, #2f5e35 100%);
}
.messaggio.vittoria .posizioni-classifica {
  margin-bottom: 1rem;
}
.messaggio.vittoria .posizioni-classifica > div {
  display: inline-block;
  margin: 2px 4px;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}
.messaggio.vittoria .posizioni-classifica i {
  color: #ffc106;
}
.messaggio.vittoria .btn-primary {
  background: #fff;
  color: #2f5e35;
  border-color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.messaggio.vittoria .btn-primary:hover {
  background: #ffc106 !important;
  border-color: #ffc106 !important;
  color: #333333 !important;
}
.messaggio.errore {
  border: 4px solid #c40404;
}
.messaggio p:last-child {
  margin-bottom: 0;
}
.messaggio p.testogrande {
  font-size: 2rem;
  font-weight: 800;
}
.messaggio p.testogrande small {
  font-weight: 400;
}
.messaggio.fadein {
  transition: opacity 0.5s, transform 0.5s !important;
  transform: scale(1) !important;
}
.messaggio.fadeout {
  transition: opacity 0.5s, transform 0.5s !important;
  transform: scale(0.5) !important;
}
.messaggio.classifica {
  width: 60%;
}
@media (max-width: 700px) {
  .messaggio.classifica {
    width: 94%;
  }
}
.messaggio.classifica .card-body {
  background-image: url(/images/confetti.png);
}
.messaggio.classifica .my-custom-scrollbar {
  position: relative;
  height: 500px;
  max-height: 60vh;
  overflow: auto;
}
.messaggio.classifica .table-wrapper-scroll-y {
  display: block;
}
@media (max-width: 575px) {
  .messaggio.classifica .card-body {
    padding: 0.5rem;
  }
  .messaggio.classifica .table {
    font-size: 0.8rem;
  }
  .messaggio.classifica .table > :not(caption) > * > * {
    padding: 0.35rem 0.3rem;
  }
  .messaggio.classifica .posizione.posizione1, .messaggio.classifica .posizione.posizione2, .messaggio.classifica .posizione.posizione3 {
    font-size: 100%;
  }
  .messaggio.classifica .posizione img, .messaggio.classifica .posizione.posizione1 img, .messaggio.classifica .posizione.posizione2 img, .messaggio.classifica .posizione.posizione3 img {
    width: 20px;
  }
}
.messaggio.classifica thead tr {
  background-color: rgba(169, 205, 170, 0.55);
  color: #2f5e35;
}
.messaggio.classifica .posizione {
  background-color: rgba(243, 246, 243, 0.85);
  font-weight: bold;
}
.messaggio.classifica .posizione td {
  vertical-align: middle;
}
.messaggio.classifica .posizione .icona,
.messaggio.classifica .posizione .numero {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}
.messaggio.classifica .posizione .durata,
.messaggio.classifica .posizione .mosse {
  text-align: center;
  white-space: nowrap;
}
.messaggio.classifica .posizione td {
  color: #2f5e35;
}
.messaggio.classifica .posizione img {
  width: 20px;
}
.messaggio.classifica .posizione.posizione1 {
  background-color: rgba(255, 193, 6, 0.8);
  font-size: 150%;
}
.messaggio.classifica .posizione.posizione1 td {
  color: #5c4700;
}
.messaggio.classifica .posizione.posizione1 img {
  width: 35px;
}
.messaggio.classifica .posizione.posizione2 {
  background-color: rgba(233, 233, 233, 0.8);
  font-size: 130%;
}
.messaggio.classifica .posizione.posizione2 td {
  color: #606060;
}
.messaggio.classifica .posizione.posizione2 img {
  width: 30px;
}
.messaggio.classifica .posizione.posizione3 {
  background-color: rgba(255, 187, 64, 0.8);
  font-size: 110%;
}
.messaggio.classifica .posizione.posizione3 td {
  color: #815300;
}
.messaggio.classifica .posizione.posizione3 img {
  width: 25px;
}
