/* Cenário da partida: a capa fica na apresentação do módulo. */
#matchIntroPanel { position: relative; z-index: 2; display: grid; height: 100dvh; min-height: 0; grid-template-columns: minmax(0, 1fr); padding: 84px clamp(16px, 4vw, 50px) 28px; overflow: auto; align-content: safe center; scrollbar-width: thin; scrollbar-color: #dc79ad #43265f; }
.match-game-environment { background: linear-gradient(#fffaf526, #fffaf54d), url('/assets/cozinha-divar-menu.webp') center / cover; }
.match-mode-chooser { width: min(940px, 100%); margin: auto; color: #321b50; text-align: center; }
.match-level-heading { width: min(680px, 100%); margin: 0 auto; padding: 18px 22px; border: 3px solid #341c54; border-radius: 18px; background: linear-gradient(#66437e, #43275e); box-shadow: 0 6px #34204655; }
.match-level-heading > p:first-child { margin: 0 0 4px; font-weight: 950; color: #ffd966; text-transform: uppercase; letter-spacing: .13em; font-size: .95rem; }
.match-level-heading h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; color: #fffaf5; text-shadow: 0 3px #39224e; }
.match-level-heading h1:focus { outline: none; }
.match-level-status { margin: 12px auto 0; max-width: 580px; font-size: .9rem; color: #ffe7f1; line-height: 1.4; }
.match-mode-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 8vw, 110px); max-width: 780px; margin: 30px auto 22px; }
.match-mode-grid::before { content: ''; position: absolute; left: 24%; right: 24%; top: 102px; border-top: 6px dotted #f8c579; opacity: .7; }
.match-level-node { position: relative; display: grid; justify-items: center; gap: 6px; padding: 14px 18px 20px; color: #321b50; border: 3px solid #4b2b68; border-radius: 24px; background: linear-gradient(#fffaf5, #eee5f3); box-shadow: 0 7px #43255d88; font: inherit; cursor: pointer; transition: transform .2s; }
.match-level-number { position: absolute; z-index: 2; top: 2px; left: 12%; display: grid; place-items: center; width: 54px; height: 54px; border: 3px solid #fff4d0; border-radius: 50%; background: #c82777; color: #fff; font-size: 1.7rem; font-weight: 950; box-shadow: 0 5px #4d245e; }
.match-level-art { position: relative; display: block; width: min(270px, 100%); height: 190px; margin-bottom: 4px; }
.match-level-art::after { content: ''; position: absolute; z-index: 0; bottom: 4px; left: 3%; right: 3%; height: 42px; border: 3px solid #e0bdd8; border-radius: 50%; background: #c5b0d6; box-shadow: 0 8px #513968, 0 14px 18px #28173366; }
.match-level-art img { position: absolute; z-index: 1; object-fit: contain; transition: transform .24s; filter: drop-shadow(0 6px 2px #2f1b4955); }
.match-level-cards img { top: 16px; width: 112px; height: 142px; border: 4px solid #ffafd1; border-radius: 12px; background: #fff7ed; }
.match-level-cards img:first-child { left: 18%; transform: rotate(-13deg); }
.match-level-cards img:nth-child(2) { left: 43%; transform: rotate(12deg); padding: 10px; }
.match-level-boards img { width: 158px; height: 118px; top: 24px; left: 15%; transform: rotate(-20deg); }
.match-level-boards img:nth-child(2) { left: 23%; top: 40px; transform: rotate(-2deg); }
.match-level-boards img:nth-child(3) { left: 32%; top: 58px; transform: rotate(17deg); }
.match-level-lock { display: none; position: absolute; z-index: 3; inset: 44px 0 auto; font-style: normal; font-size: 3.1rem; filter: drop-shadow(0 4px #342046); }
.match-level-kicker { font-size: .76rem; font-weight: 800; color: #70517f; }
.match-level-node strong { font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.2; text-shadow: none; }
.match-level-node small { font-size: .9rem; color: #71537a; }
.match-level-node b { display: grid; align-items: center; margin-top: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid #ffc4df; border-radius: 14px; background: #c62473; color: #fff; box-shadow: 0 5px #582648; font-size: .88rem; }
.match-level-node:disabled { cursor: default; }
.is-level-locked .match-level-art { filter: saturate(.25); opacity: .75; }
.is-level-locked .match-level-lock { display: block; }
.match-level-node:disabled b { color: #ecdfed; background: #51405d; border-color: #9d83aa; box-shadow: 0 5px #302139; }
.match-level-node.is-level-complete .match-level-number { background: #298275; }
@media (hover: hover) { .match-level-node:not(:disabled):hover { transform: translateY(-7px); } .match-level-node:not(:disabled):hover .match-level-art img { translate: 0 -5px; } }
.match-level-node:focus-visible { outline: 3px solid #ffdf82; outline-offset: 5px; }
.match-menu-exit { min-height: 44px; padding: 10px 24px; border: 1px solid #f5d4e9; border-radius: 999px; color: #42245e; background: #fffaf5f2; font: inherit; font-size: .9rem; cursor: pointer; }
.match-menu-exit:hover { background: #ece1f3; }
.match-menu-exit:focus-visible { outline: 3px solid #ffdf82; outline-offset: 3px; }
.match-board-study { width: min(850px, 100%); margin-inline: auto; padding: clamp(18px, 3vw, 30px); border: 2px solid #d9c6eb; border-radius: 22px; background: #fffaf5f5; color: #382056; box-shadow: 0 8px 0 #26113d55; }
.match-board-study > p { margin: 0 0 6px; color: #bd246d; font-size: .8rem; font-weight: 900; text-transform: uppercase; }
.match-board-study h1 { margin: 0 0 18px; font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.15; }
.match-board-study > span { font-size: .9rem; line-height: 1.5; }
.match-board-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.match-board-legend article { padding: 12px; border: 1px solid #d5c6e2; border-radius: 12px; background: #fff; display: grid; gap: 4px; }
.match-board-legend article > div { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; height: 78px; }
.match-board-legend img { width: 100%; height: 78px; object-fit: contain; }
.match-board-legend strong { font-size: .85rem; line-height: 1.25; }
.match-board-legend span, .match-board-study > small { font-size: .78rem; line-height: 1.4; color: #715a7d; }
.match-board-study .score-actions { margin-top: 18px; }
.match-live-panel .memory-card-grid.is-board-mode { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.is-board-mode .memory-card-front { background: #fffaf5; border-color: #43265f; padding: 8%; place-items: center; }
.is-board-mode .memory-card-front img { filter: none; }
.is-board-presentation .match-pair-presentation-content > img { background-size: contain; background-position: center; background-repeat: no-repeat; padding: 14%; }
.is-board-presentation .memory-pair-marker { display: none; }

@media (max-width: 700px) {

  .match-board-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-live-panel .memory-card-grid.is-board-mode { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-height: 600px) and (orientation: landscape) {
  .match-board-study { padding: 16px; }
  .match-mode-grid { margin-block: 14px; }
  .match-level-art { height: 150px; scale: .85; margin-block: -10px; }
  .match-level-heading h1 { font-size: 1.7rem; }
  .match-board-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0; }
  .match-board-legend article > div, .match-board-legend img { height: 52px; }
  .match-board-legend article { padding: 8px; }
}

@media (orientation: landscape) and (max-height: 600px) { .match-live-panel .memory-card-grid.is-board-mode { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.board-selection-panel[hidden], .board-selection-panel [hidden] { display: none !important; }
.board-selection-panel {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-rows: auto minmax(min-content, 1fr) auto auto auto auto;
  gap: 14px; height: 100dvh; padding: 78px clamp(20px, 4vw, 56px) 24px;
  overflow: auto; color: #321b50;
  background: linear-gradient(#fffaf526, #fffaf54d), url('/assets/cozinha-divar-menu.webp') center / cover;
  scrollbar-width: thin; scrollbar-color: #db6fab #43265f;
}
.board-round-hud { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; width: min(720px, 100%); margin-inline: auto; }
.board-round-hud div { display: flex; align-items: center; gap: 20px; }
.board-round-hud span { font-size: .8rem; font-weight: 700; }
.board-round-hud strong { font-size: .95rem; white-space: nowrap; }
.board-round-hud progress { grid-column: 1 / -1; width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: clip; background: #ffffff30; accent-color: #ffe075; }
.board-round-hud progress::-webkit-progress-bar { background: #ffffff30; border-radius: 10px; }
.board-round-hud progress::-webkit-progress-value { background: #ffe075; border-radius: 10px; }
.board-round-hud progress::-moz-progress-bar { background: #ffe075; border-radius: 10px; }
.board-food-stage { display: grid; justify-items: center; align-content: center; text-align: center; min-height: 0; }
.board-food-stage > p { margin: 0 0 6px; font-size: .86rem; color: #664775; }
.board-food-stage h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.3rem); color: #321b50; line-height: 1.15; }
.board-food-stage h1:focus { outline: none; }
.board-food-display { position: relative; display: grid; place-items: center; width: min(320px, 80%); height: clamp(125px, 27vh, 250px); }
.board-food-display > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; object-fit: contain; pointer-events: none; filter: drop-shadow(0 8px 4px #24103355); transition: opacity .25s; }
.board-food-shadow { position: absolute; bottom: 0; width: 50%; height: 12px; border-radius: 50%; background: #210f3540; filter: blur(5px); }
.board-selection-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 2vw, 28px); width: min(1200px, 100%); margin: 0 auto; }
.board-choice { position: relative; display: grid; place-items: center; min-width: 0; min-height: 130px; padding: 8px; border: 2px solid transparent; border-radius: 24px; background: transparent; cursor: pointer; transition: transform .22s, background .22s, border-color .22s; -webkit-tap-highlight-color: transparent; }
.board-choice-art { position: relative; display: block; width: 100%; animation: board-float 4s ease-in-out var(--float-delay) infinite; }
.board-choice-art > img { display: block; width: 100%; height: clamp(90px, 13vh, 140px); object-fit: contain; filter: drop-shadow(0 4px 1px #26143750); }
.board-choice-art > .board-placed-food { position: absolute; inset: 10% 18%; width: 64%; height: 75%; filter: drop-shadow(0 3px 1px #26143750); animation: board-food-land .35s ease-out; }
.board-choice-shadow { position: absolute; bottom: 0; width: 65%; height: 12px; border-radius: 50%; background: #1b0c304f; filter: blur(4px); transition: transform .22s, opacity .22s; }
.board-choice:hover:not(:disabled), .board-choice:focus-visible { transform: translateY(-12px) scale(1.06); background: #ffffff10; border-color: #fff0c5; outline: none; }
.board-choice:hover:not(:disabled) .board-choice-shadow, .board-choice:focus-visible .board-choice-shadow { transform: translateY(12px) scale(.8); opacity: .6; }
.board-choice:disabled { cursor: default; opacity: .55; }
.board-choice.is-selected { opacity: 1; border-color: #c9f5c2; background: #aee1a529; transform: none; }
.board-choice.is-selected .board-choice-art { animation: none; }
.board-choice.is-wrong { border-color: #ffabc9; background: #f4387826; animation: board-wrong .3s; }
.board-selection-panel.is-correct .board-food-display > img, .board-selection-panel.is-correct .board-food-shadow { opacity: 0; }
.board-selection-feedback { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 58px; width: min(1100px, 100%); margin-inline: auto; }
.board-selection-feedback p { margin: 0; max-width: 650px; font-size: .9rem; line-height: 1.4; }
.board-selection-feedback .button { flex-shrink: 0; min-height: 44px; }
.is-wrong .board-selection-feedback p { color: #9a205b; }
.is-correct .board-selection-feedback p { color: #216553; }
@keyframes board-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes board-food-land { from { opacity: 0; transform: translateY(-22px) scale(.8); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes board-wrong { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (max-width: 850px) {
  .board-selection-panel { gap: 10px; padding-inline: 20px; }
  .board-round-hud { gap: 8px; }
  .board-round-hud div { gap: 10px; }
  .board-choice { padding: 3px; min-height: 110px; border-radius: 16px; }
  .board-selection-feedback { gap: 12px; }
  .board-selection-feedback p { font-size: .82rem; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .board-selection-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-food-display { height: clamp(120px, 20dvh, 170px); }
  .board-round-hud div { flex-direction: column; align-items: start; gap: 4px; }
  .board-selection-feedback { flex-direction: column; }
}
@media (max-height: 600px) and (orientation: landscape) {
  .board-selection-panel { padding: 62px 18px 10px; gap: 6px; grid-template-rows: auto minmax(min-content, 1fr) auto auto auto auto; }
  .board-round-hud { width: min(580px, 100%); gap: 5px 14px; }
  .board-round-hud span { font-size: .7rem; }
  .board-round-hud strong { font-size: .8rem; }
  .board-food-stage > p { font-size: .72rem; margin-bottom: 3px; }
  .board-food-stage h1 { font-size: 1.25rem; }
  .board-food-display { height: clamp(65px, 21vh, 110px); width: 180px; }
  .board-choice { min-height: 83px; padding: 3px; }
  .board-choice-art > img { height: 76px; }
  .board-selection-feedback { min-height: 44px; gap: 12px; }
  .board-selection-feedback p { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .board-selection-panel *, .board-selection-panel *::before, .board-selection-panel *::after { animation: none !important; transition: none !important; }
}

.board-input-hint { margin: 0; text-align: center; font-size: .8rem; color: #684574; }
.board-auto { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: .8rem; color: #684574; cursor: pointer; }
.board-auto input { width: 20px; height: 20px; accent-color: #ef3b87; }
.board-key { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #ffffff55; border-radius: 8px; background: #291237; font-size: .8rem; color: #fff; }
.board-food-display > img { animation: board-food-land .25s ease-out; }
@media (max-height: 600px) and (orientation: landscape) { .board-auto { min-height: 32px; } .board-input-hint { font-size: .7rem; } }
@media (max-width: 900px) and (orientation: portrait) {
  .play-page:is(.is-match-levels, .is-board-selection) .mobile-landscape-prompt { display: none; }

  .board-selection-panel { padding: 70px 14px 18px; }
}

/* Duas estações conectadas, sem reaproveitar o cartaz da abertura. */
.play-page.is-game-focused .fake-game-stage:is([data-game-state="match-intro"], [data-game-state="match-playing"], [data-game-state="match-result"])::before { background: linear-gradient(#fffaf526, #fffaf54d), url('/assets/cozinha-divar-menu.webp') center / cover; opacity: 1; filter: none; transform: none; }
@media (max-width: 600px) and (orientation: portrait) {
  #matchIntroPanel { padding: 78px 16px 24px; }
  .match-level-heading h1 { font-size: 1.8rem; }
  .match-mode-grid { gap: 26px; margin-block: 22px; grid-template-columns: 1fr; }
  .match-mode-grid::before { left: 50%; right: auto; top: 80px; bottom: 90px; border-top: 0; border-left: 5px dotted #e9b675; }
  .match-level-node { grid-template-columns: 116px 1fr; gap: 6px 14px; text-align: left; justify-items: start; padding: 14px 8px; border: 2px solid #bb89b366; background: linear-gradient(#fffaf5, #eee5f3); border-radius: 22px; }
  .match-level-art { grid-column: 1; grid-row: 1 / span 4; width: 130px; height: 144px; scale: .8; transform-origin: left center; margin-right: -14px; }
  .match-level-cards img { width: 65px; height: 96px; top: 24px; left: 4%; }
  .match-level-cards img:nth-child(2) { left: 43%; padding: 5px; }
  .match-level-boards img { width: 105px; height: 95px; left: 0; top: 22px; }
  .match-level-boards img:nth-child(2) { left: 9%; top: 35px; }
  .match-level-boards img:nth-child(3) { left: 17%; top: 48px; }
  .match-level-number { width: 38px; height: 38px; font-size: 1.2rem; left: 8px; top: 8px; }
  .match-level-node strong { font-size: 1.2rem; }
  .match-level-kicker { font-size: .7rem; }
  .match-level-node b { font-size: .76rem; min-height: 44px; padding: 8px; margin-top: 2px; }
  .match-level-node small { font-size: .8rem; }
}
.board-flight { position: fixed; z-index: 8; pointer-events: none; object-fit: contain; filter: drop-shadow(0 12px 8px #28163166); }
.board-selection-panel.is-landing .board-placed-food { visibility: hidden; }
.board-choice.is-selected .board-choice-art { animation: board-confirm .65s ease-out; }
@keyframes board-confirm { 0% { transform: translateY(-12px) rotate(-5deg); } 45% { transform: translateY(-20px) rotate(3deg); } 75% { transform: translateY(4px) scale(.96); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .match-level-node, .match-level-art img { transition: none; } .board-flight { display: none; } }

.board-selection-panel.is-paused * { animation-play-state: paused !important; }

.board-round-hud { padding: 12px 18px; border: 3px solid #43235c; border-radius: 16px; background: #fffaf5ed; box-shadow: 0 5px #43235c44; }
.board-round-hud progress { background: #cbbbd6; accent-color: #ca2f7b; }
.board-round-hud progress::-webkit-progress-bar { background: #cbbbd6; }
.board-round-hud progress::-webkit-progress-value { background: #ca2f7b; }
.board-round-hud progress::-moz-progress-bar { background: #ca2f7b; }
.board-food-stage > p, .board-food-stage h1 { padding: 4px 16px; border-radius: 12px; background: #fffaf5e0; }
.board-selection-choices { padding: 18px 14px; border: 3px solid #4b2b68; border-radius: 22px; background: linear-gradient(#fffaf5, #dfd1e9); box-shadow: 0 7px #4b2b6855; }
.board-selection-feedback { height: max-content; padding: 10px 16px; border: 2px solid #a68ab5; border-radius: 14px; background: #fffaf5ed; }
.board-choice:hover:not(:disabled), .board-choice:focus-visible { border-color: #8b56a8; background: #a17bb522; }
.board-choice.is-selected { border-color: #4c9a77; background: #72ba8a29; }
.board-choice.is-wrong { border-color: #bb2a70; background: #f4387826; }
.board-auto { padding-inline: 12px; width: fit-content; margin: auto; border-radius: 10px; background: #fffaf5e0; }
@media (max-width: 600px) { .board-selection-choices { padding: 12px 8px; gap: 8px; } .match-level-heading { padding: 14px; } }
