* { box-sizing: border-box; }
html { background: #f8f5ed; color: #251941; }
body {
  margin: 0;
  font: 16px/1.45 "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, select, input { font: inherit; }
button, select, .card-link { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a:focus, button:focus, select:focus, [tabindex]:focus { outline: 3px solid #9d5ce9; outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.frame { width: 92%; max-width: 1060px; margin: 0 auto; }

.masthead { border-bottom: 1px solid #dad2e8; background: #fdfbf6; }
.masthead-inner { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; padding: 17px 0; }
.school { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; text-decoration: none; }
.school strong, .school > span > span { display: block; }
.school strong { font-size: 17px; letter-spacing: -.025em; line-height: 1.25; }
.school > span > span { margin-top: 2px; color: #5b506f; font-size: 12px; }
.school-mark { position: relative; display: block; width: 38px; height: 38px; -webkit-flex: 0 0 38px; flex: 0 0 38px; border-radius: 10px; background: #392080; margin-right: 11px; }
.school-mark i { position: absolute; width: 9px; height: 9px; border-radius: 1px; background: #c9fb70; }
.school-mark i:nth-child(1) { top: 9px; left: 9px; }
.school-mark i:nth-child(2) { top: 9px; left: 20px; background: #ff9070; }
.school-mark i:nth-child(3) { top: 20px; left: 9px; background: #b69af9; }
.school-mark i:nth-child(4) { top: 20px; left: 20px; background: #ffd372; -webkit-transform: rotate(-45deg) scale(.87); transform: rotate(-45deg) scale(.87); }
.event-label { margin-left: 12px; padding: 6px 10px; border: 1px solid #bdb2d4; border-radius: 6px; color: #463175; font-weight: 750; white-space: nowrap; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }

.screen { padding: 25px 0 40px; }
.screen.is-hidden { display: none; }
.hero {
  position: relative;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  overflow: hidden;
  min-height: 316px;
  background: #2e1b67;
  color: #fffaf0;
  border-radius: 21px;
  box-shadow: 0 7px 0 #dcd3e9;
}
.hero-copy { position: relative; z-index: 1; padding: 27px 0 30px 40px; width: 56%; }
.hero h1 { margin: 0; font-size: 68px; font-weight: 800; line-height: .98; letter-spacing: -.054em; }
.hero h1 em { color: #c9fb70; font-style: italic; }
.hero p { max-width: 330px; margin: 16px 0 0; color: #eee5ff; font-size: 17px; line-height: 1.45; }
.hero-art { position: absolute; width: 51%; height: 100%; right: 18px; top: 0; }

.game-cards { margin: 25px -8px 0; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.game-card { background: #fffdf8; border: 1px solid #d8cde7; border-radius: 17px; overflow: hidden; margin: 0 8px 16px; min-width: 0; width: calc(50% - 16px); }
.card-illustration { height: 138px; overflow: hidden; border-bottom: 1px solid #d8cde7; }
.card-illustration svg { width: 100%; height: 100%; display: block; }
.tang-art { background: #e3f9b8; }
.pav-art { background: #e7dafa; }
.num-art { background: #ffe6a6; }
.spec-art { background: #caefe4; }
.card-body { padding: 17px 18px 18px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; }
.card-body h2 { font-size: 29px; line-height: 1.06; letter-spacing: -.045em; margin: 0 0 6px; }
.card-body p { color: #564965; margin: 0; font-size: 14px; }
.card-link { padding: 10px 12px; margin-left: 14px; text-decoration: none; flex: 0 0 auto; display: block; min-width: 87px; min-height: 45px; border-radius: 9px; font-size: 14px; font-weight: bold; white-space: nowrap; }
.card-link span + span { margin-left: 6px; font-size: 17px; }
.tang-link { background: #c9fb70; color: #29390e; }
.pav-link { background: #6d44cd; color: #fff; }
.numero-link { background: #ffcd58; color: #482c1d; }
.specchio-link { background: #267663; color: #fff; }
.card-link:hover, .btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px rgba(32,19,66,.25); }

.game-screen { max-width: 830px; margin: 0 auto; padding-top: 9px; }
.game-nav { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; margin: 0 -5px 2px; font-size: 13px; font-weight: bold; color: #5936a1; }
.game-nav a { min-height: 44px; padding: 12px 5px; display: block; text-decoration: none; }
.game-nav a:hover { text-decoration: underline; }
.game-screen h1 { margin: 0 0 10px; font-size: 45px; letter-spacing: -.055em; line-height: 1.05; }
.game-content { padding: 13px; min-width: 0; border: 1px solid #d7cce7; border-radius: 16px; background: #fffdf8; }
.game-head, .game-actions { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: center; align-items: center; margin: 0 -3px; }
.game-head > *, .game-actions > * { margin: 3px; }
.game-head label, .game-label { font-weight: bold; color: #45365a; font-size: 14px; }
.game-help { color: #594e6b; font-size: 13px; margin: 7px 0 8px; }
.game-board { position: relative; overflow: hidden; margin: 8px 0; border-radius: 11px; border: 1px solid #d8cde6; background: #f2ecf9; }
.playfield { width: 100%; height: auto; display: block; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.playfield text { font-family: "Avenir Next", "Trebuchet MS", Arial, sans-serif; }
.playfield [tabindex]:focus { outline: none; }
.playfield g[tabindex]:focus polygon, .playfield polygon[tabindex]:focus { stroke: #2d174c; stroke-width: 4; }
.game-head select, .btn, .game-actions button { min-height: 44px; border: 1px solid #beadd9; border-radius: 8px; background: #f5effb; color: #392766; padding: 8px 11px; font-size: 14px; font-weight: bold; line-height: 1.15; }
.game-head select { max-width: 100%; }
.btn.primary { color: #fff; background: #633ac1; border-color: #633ac1; }
.tang-content .btn.primary { color: #22320e; background: #c9fb70; border-color: #a1c65f; }
.btn.quiet { background: #fffdf8; }
.game-message { padding: 7px 10px; min-height: 36px; background: #f1ecfa; color: #473862; border-radius: 7px; font-size: 13px; margin: 8px 0 0; }
.game-message[data-kind="good"] { color: #254714; background: #e5f6c7; font-weight: bold; }
.game-message[data-kind="try"] { color: #6b370a; background: #fff0cc; }
.no-script { padding: 10px; background: #fff0cc; }
.mobile-break { display: none; }
@media (max-width: 1140px) {
  .hero h1 { font-size: 5.9vw; }
}
@media (max-width: 900px) {
  .hero { min-height: 280px; }
}
@media (max-width: 650px) {
  .frame { width: 94%; }
  .masthead-inner { padding: 10px 0; }
  .school strong { font-size: 14px; }
  .school > span > span { font-size: 10.5px; line-height: 1.2; }
  .school-mark { margin-right: 8px; }
  .event-label { padding: 5px 6px; margin-left: 6px; font-size: 9px; }
  .screen { padding-top: 15px; }
  .hero { min-height: 204px; border-radius: 15px; }
  .hero-copy { padding: 19px 0 21px 17px; width: 100%; }
  .hero h1 { font-size: 45px; }
  .hero p { max-width: 178px; margin-top: 10px; font-size: 14px; }
  .hero-art { width: 46%; height: 57%; top: auto; bottom: 3%; right: 1%; opacity: .9; }
  .game-cards { margin: 16px 0 0; display: block; }
  .game-card { margin: 0 0 10px; width: 100%; min-height: 112px; display: -webkit-flex; display: flex; border-radius: 12px; }
  .card-illustration { width: 29%; min-height: 111px; height: auto; position: relative; border: 0; border-right: 1px solid #d8cde7; }
  .card-illustration svg { width: 200%; max-width: none; height: 100%; position: absolute; left: -50%; }
  .card-body { padding: 10px; width: 71%; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .card-body h2 { font-size: 23px; margin-bottom: 3px; }
  .card-body p { font-size: 12px; }
  .card-link { font-size: 12px; padding: 8px 9px; min-width: 69px; min-height: 44px; margin: 4px 0 0; }
  .game-screen { padding: 2px 0 22px; }
  .game-screen h1 { font-size: 33px; margin-bottom: 6px; }
  .game-content { padding: 7px; border-radius: 12px; }
  .game-head select, .btn, .game-actions button { padding: 6px 8px; font-size: 13px; }
  .game-head, .game-actions { margin: 0 -2px; }
  .game-head > *, .game-actions > * { margin: 2px; }
  .game-nav { font-size: 12px; margin-bottom: 0; }
  .mobile-break { display: initial; }
}
@media (max-width: 370px) {
  .hero h1 { font-size: 36px; }
  .hero p { max-width: 154px; }
  .hero { min-height: 188px; }
  .school strong { font-size: 13px; }
  .card-body h2 { font-size: 21px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .game-screen { max-width: 670px; }
}
.mosaic-reference {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  color: #473862;
  font-size: 13px;
  font-weight: bold;
}
.mosaic-reference svg { display: block; margin-left: 8px; }
.game-head button { flex-shrink: 0; }
.mosaic-board-wrap { background: #fcfbf4; }
#mosaic-board { width: 100%; max-width: 510px !important; margin: 0 auto; }
#tangram-wrap { background: #f7f3ff; }
#specchio-board rect[tabindex]:focus { stroke: #2d174c; stroke-width: 3; }
.numero-content .btn.primary { color: #503222; background: #ffcf62; border-color: #c2872d; }
.specchio-content .btn.primary { background: #267663; border-color: #267663; }
.number-deck { padding: 13px 12px 16px; background: #fff4d7; border-color: #ead5a6; }
.number-target { display: block; margin: 0 auto 10px; text-align: center; font-weight: bold; color: #52396b; }
.number-target-value { display: block; font-size: 50px; line-height: 1.02; font-weight: 850; letter-spacing: -.04em; color: #392080; }
.number-cards { display: -webkit-flex; display: flex; max-width: 560px; margin: 0 auto; }
.number-card { position: relative; display: block; -webkit-flex: 1; flex: 1; min-width: 0; min-height: 62px; margin: 3px; padding: 6px 3px;
  border: 1px solid #aa8abb; border-bottom: 4px solid #9472b1; border-radius: 10px;
  background: #fbf6ff; color: #382466; font-size: 25px; font-weight: 800; }
.number-card[aria-pressed="true"] { border-color: #4d297d; background: #6d44cd; color: #fff; }
.number-card[data-order]::after { content: attr(data-order); position: absolute; right: 5px; top: 4px; width: 17px; height: 17px;
  border-radius: 9px; background: #fff6d9; color: #442467; font: bold 11px/17px Arial, sans-serif; }
.number-card:disabled { opacity: 1; border-bottom-width: 1px; }
.number-equation { margin: 9px 0 0; text-align: center; font-size: 18px; font-weight: bold; color: #493566; }
.number-operations { -webkit-justify-content: center; justify-content: center; }
.number-operations button { min-width: 49px; font-size: 21px; }
@supports (display: grid) {
  @media (min-width: 700px) {
    .game-content:not(.numero-content) {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 225px;
      grid-template-rows: auto auto auto auto 1fr;
      gap: 9px 15px;
      align-items: start;
      padding: 14px;
    }
    .game-content > * { grid-column: 2; }
    .game-content > .game-board { grid-column: 1; grid-row: 1 / 6; margin: 0; }
    .game-content > .game-head { grid-row: 1; }
    .game-content > .game-help { grid-row: 2; margin: 1px 0; }
    .game-content > .mosaic-reference { grid-row: 3; }
    .game-content > .game-actions { grid-row: 4; }
    .game-content > .game-message { grid-row: 5; margin: 0; }
    .tang-content > .game-actions { grid-row: 3; }
    .tang-content > .game-message { grid-row: 4; }
    .specchio-content > .specchio-palette { grid-row: 3; }
  }
}
