/* Game HUD and choice cards retain the controls, labels and progress of each game. */
html[data-brand] {
  --play-ink: #fff1dc;
  --play-muted: #f2cba9;
  --play-edge: #d8a77891;
  --play-glass: linear-gradient(155deg, #481b28f2, #1e0b13f2 78%);
  --play-choice: linear-gradient(145deg, #4b202af5, #240d17f5 78%);
  --play-choice-active: linear-gradient(145deg, #6e3943, #381923 82%);
  --play-track: #16070c;
  --play-meter: linear-gradient(90deg, #aa663e, #ffc48c 58%, #ffe1a7);
  --play-glow: #ffb8677a;
  --play-focus: #ffe09b;
}

html[data-brand="clean"] {
  --play-ink: #4c2229;
  --play-muted: #673b39;
  --play-edge: #9e674b9c;
  --play-glass: linear-gradient(150deg, #fff7eaf7, #f3d9c8f7 90%);
  --play-choice: linear-gradient(145deg, #fff6eafc, #f3dbcefc 86%);
  --play-choice-active: linear-gradient(145deg, #ffebdd, #eabdb7 82%);
  --play-track: #dbb5a2;
  --play-meter: linear-gradient(90deg, #97475e, #bf5e70 62%, #ce795e);
  --play-glow: #c4965360;
  --play-focus: #814b34;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"]:has(.room-question > .aq-frame-art) {
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
  overflow: auto !important;
}

.room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-shell {
  max-width: 1200px;
  height: auto;
  min-height: 0;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  min-height: 62px !important;
  align-items: center;
  gap: clamp(4px, 1.4vw, 14px) !important;
  padding: 0 0 6px !important;
}

.room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading .salon-mark {
  width: 68px;
  height: 62px;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading p:not(.room-eyebrow) {
  width: fit-content;
  max-width: none;
  padding: 6px 10px;
  border: 1px solid var(--play-edge);
  border-radius: 50px;
  background: var(--play-glass);
  color: var(--play-ink);
  font: 600 11px/1.25 Manrope, system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls {
  align-items: center;
  gap: 4px !important;
  min-width: 0;
}

html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls :is(#roomSound,#roomBack,#roomFullscreen) {
  box-sizing: border-box;
  display: inline-grid !important;
  place-items: center;
  width: auto !important;
  height: 44px !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 0 10px !important;
  border: 1px solid var(--play-edge) !important;
  border-radius: 13px !important;
  background: var(--play-glass) !important;
  box-shadow: inset 0 1px #fff0d240, 0 4px 14px #210b1638;
  color: var(--play-ink) !important;
  font: 650 12px/1 Manrope, system-ui, sans-serif !important;
  text-shadow: none !important;
  white-space: nowrap;
}

html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls #roomSound {
  --play-sound-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5zm5 5 5 5m0-5-5 5'/%3E%3C/svg%3E");
  order: -2;
  font-size: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

html[data-brand] body:has(#soundBtn[aria-pressed="true"]) .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls #roomSound {
  --play-sound-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5zm4 4c1.7 1.7 1.7 4.3 0 6m3-8c2.8 2.8 2.8 7.2 0 10'/%3E%3C/svg%3E");
}

html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls #roomSound::before {
  content: "";
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--play-sound-icon) center / contain no-repeat;
  mask: var(--play-sound-icon) center / contain no-repeat;
}

html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls #roomFullscreen svg {
  width: 19px !important;
  height: 19px !important;
}

.room-panel.atelier-room[data-status="playing"] #roomBody:has(.aq-frame-art) {
  flex: 0 1 auto;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: clamp(7px, 1.3dvh, 14px) 10px;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] #roomBody:has(.aq-frame-art) > .room-progress,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .game-head {
  box-sizing: border-box;
  margin: 0 !important;
  padding: 9px clamp(10px, 2vw, 21px) !important;
  min-height: 46px !important;
  border: 1px solid var(--play-edge) !important;
  border-radius: 17px;
  background: var(--play-glass) !important;
  box-shadow: inset 0 1px #fff2d63d, 0 6px 20px #210c1528;
  color: var(--play-ink);
  font: 650 clamp(11px, 1.1vw, 14px)/1.3 Manrope, system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
}

.room-panel.atelier-room[data-status="playing"] #roomBody:has(.aq-frame-art) > .room-progress {
  display: grid;
  grid-template-columns: auto minmax(20px, 1fr) auto;
  gap: clamp(9px, 2.4vw, 22px) !important;
  align-items: center;
}

.room-panel.atelier-room[data-status="playing"] .room-progress > span:last-child {
  color: var(--play-muted);
  justify-self: end;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-progress > progress,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .progress-bar {
  width: 100%;
  height: 7px !important;
  margin-block-start: 0;
  border: 1px solid var(--play-edge);
  border-radius: 99px;
  background: var(--play-track);
  box-shadow: inset 0 1px 2px #0002;
}

.room-panel .room-progress > progress::-webkit-progress-bar { background: var(--play-track); }
.room-panel .room-progress > progress::-webkit-progress-value { background: var(--play-meter); }
.room-panel .room-progress > progress::-moz-progress-bar { background: var(--play-meter); }
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) #progressFill {
  border-radius: inherit;
  background: var(--play-meter);
  box-shadow: 0 0 8px var(--play-glow);
}

html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .progress-wrap {
  width: clamp(94px, 31%, 290px) !important;
  max-width: 290px;
  display: grid;
  gap: 4px;
}

html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .progress-text {
  font: 650 12px/1.15 Manrope, system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
  color: var(--play-ink);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) {
  width: min(100%, 1200px);
  margin: 0 auto !important;
  padding: 0 0 2px !important;
  align-content: start;
  gap: clamp(9px, 1.8dvh, 18px);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question:has(> .aq-frame-art) {
  width: min(100%, 890px);
  max-width: none;
  height: auto;
  min-height: var(--play-question-min-height, min-content) !important;
  aspect-ratio: 2.15;
  padding: clamp(43px, 8.5dvh, 84px) clamp(25px, 6.3vw, 84px) !important;
  color: var(--play-ink);
}

.room-panel.atelier-room[data-status="playing"] .room-question:has(> .aq-frame-art) > :is(p, h2) {
  flex-shrink: 0;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question:has(> .aq-frame-art) h2 {
  font-size: clamp(25px, 5dvh, 53px) !important;
  line-height: 1.08 !important;
  margin: 8px 0 !important;
  color: var(--play-ink);
  text-wrap: balance;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question :is(.room-eyebrow,.room-turn-name,.salon-question-instruction) {
  color: var(--play-muted);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question .room-eyebrow {
  letter-spacing: .12em;
}

html[data-brand] #gameScreen .atelier-game #card:has(> .aq-frame-art) .card-inner {
  padding-block: clamp(34px, 8.5dvh, 80px) !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) > #roomAnswerForms {
  justify-self: center;
  max-width: 750px !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms :is(.room-answer,.room-waiting) {
  padding: clamp(9px, 1.8dvh, 18px) !important;
  border: 1px solid var(--play-edge) !important;
  border-radius: 18px;
  background: var(--play-glass) !important;
  box-shadow: inset 0 1px #fff1d43d, 0 6px 20px #210c1530;
  color: var(--play-ink) !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms :is(h3,.room-answer-instruction,.room-answer-saved) {
  color: var(--play-ink);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .room-answer-instruction {
  margin: 4px 0 9px !important;
  font-size: clamp(12px, 1.4vw, 16px) !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .salon-option,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-choice:not(.c-vote-person) {
  min-height: 54px !important;
  padding: 8px 13px !important;
  gap: 11px;
  border: 1px solid var(--play-edge) !important;
  border-radius: 13px !important;
  background: var(--play-choice) !important;
  color: var(--play-ink) !important;
  box-shadow: inset 0 1px #fff1d42c;
  font: 600 clamp(13px, 1.35vw, 17px)/1.38 Manrope, system-ui, sans-serif !important;
  overflow-wrap: anywhere;
  text-shadow: none !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .salon-option[aria-pressed="true"],
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-choice[aria-pressed="true"]:not(.c-vote-person) {
  border-color: var(--play-focus) !important;
  background: var(--play-choice-active) !important;
  box-shadow: inset 0 0 0 1px var(--play-focus), 0 0 14px var(--play-glow);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] #roomAnswerForms .salon-option-number,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-choice-number {
  flex: none;
  color: var(--play-muted);
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .salon-seat,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-vote-person {
  width: min(calc((100% - 24px) / 3), clamp(92px, 17dvh, 174px)) !important;
  border-color: var(--play-edge) !important;
  border-radius: 13px !important;
  background: var(--play-choice) !important;
  color: var(--play-ink) !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .salon-seat[aria-pressed="true"],
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-vote-person[aria-pressed="true"] {
  border-color: var(--play-focus) !important;
  box-shadow: 0 0 0 1px var(--play-focus), 0 0 14px var(--play-glow) !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) .salon-seat-photo,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-vote-person .portrait-frame {
  height: auto !important;
  aspect-ratio: 4 / 5 !important;
}

html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) .salon-seat strong,
html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-vote-name {
  font: 650 clamp(17px, 2.8dvh, 25px)/1.12 'Cormorant Garamond', Georgia, serif !important;
  padding-block: 6px !important;
}

@media (min-width: 761px) {
  html[data-brand] body.game-mode-open:has(#gameScreen.active .aq-frame-art) .scene-control-cluster {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  html[data-brand] body.game-mode-open:has(#gameScreen.active .aq-frame-art) .scene-control-cluster > button {
    display: inline-grid;
    place-items: center;
    flex: none;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art):is([data-aq-kind="vote"],:has(.salon-answer-list)) {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) !important;
    align-content: start;
    column-gap: clamp(16px, 3vw, 42px);
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art):is([data-aq-kind="vote"],:has(.salon-answer-list)) .room-question {
    width: 100%;
    aspect-ratio: 1.64;
    padding: clamp(42px, 7dvh, 72px) clamp(24px, 4.4vw, 68px) !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art):is([data-aq-kind="vote"],:has(.salon-answer-list)) .room-question h2 {
    font-size: clamp(24px, 4.1dvh, 45px) !important;
  }
}

@media (max-width: 760px) {
  html[data-brand] .room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading {
    grid-template-columns: minmax(0, 1fr) auto minmax(153px, 1fr) !important;
    min-height: 50px !important;
  }

  .room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading .salon-mark {
    width: 46px;
    height: 48px;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"]:has(.aq-frame-art) .room-heading p:not(.room-eyebrow) {
    padding: 4px 5px;
    font-size: 10px !important;
    overflow-wrap: anywhere;
  }

  html[data-brand] .room-panel:is(.atelier-room[data-status="playing"]:has(.aq-frame-art), :has(.room-finale)) .room-controls #roomBack {
    padding: 0 6px !important;
    font-size: 11px !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) .room-question:has(> .aq-frame-art) {
    --aq-frame-motion: var(--aq-wide-motion);
    --aq-frame-still: var(--aq-wide-still);
    width: 100%;
    aspect-ratio: 1.52;
    padding: clamp(30px, 9.1vw, 52px) clamp(20px, 8.2vw, 39px) !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question:has(> .aq-frame-art) h2 {
    font-size: clamp(23px, 7.5vw, 38px) !important;
  }

  html[data-brand] #gameScreen .atelier-game #card:has(> .aq-frame-art) .card-inner {
    padding-block: clamp(26px, 6dvh, 55px) !important;
  }
}

@media (min-width: 600px) and (max-height: 550px) and (orientation: landscape) {
  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) .room-question:has(> .aq-frame-art) {
    width: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    padding-block: clamp(27px, 10dvh, 45px) !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-question:has(> .aq-frame-art) h2 {
    font-size: clamp(23px, 5.7dvh, 31px) !important;
  }

  html[data-brand] #gameScreen .atelier-game #card:has(> .aq-frame-art) .card-inner {
    padding-block: clamp(18px, 6dvh, 31px) !important;
  }

  html[data-brand] .room-panel.atelier-room[data-status="playing"] .room-play-grid:has(.aq-frame-art) #roomAnswerForms .salon-seat,
  html[data-brand] #gameScreen .atelier-game:has(#card > .aq-frame-art) .c-vote-person {
    width: min(calc((100% - 24px) / 3), 21dvh) !important;
  }
}
