@font-face {
  font-family: Atti Sans;
  src: url("./assets/ui.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #322a48;
  --muted: #746e83;
  --accent: #7748d6;
  --paper: #fcfbff;
  --line: #e3deed;
  font-family: "Atti Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  font-synthesis: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  --gutter: clamp(10px, 1.3vw, 24px);
  background: #171918;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #a36de8;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p,
ol {
  margin: 0;
}
button svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
}
[data-icon] {
  display: inline-flex;
  flex: none;
  font-style: normal;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.topbar {
  flex: none;
  height: 60px;
  background: #202220;
  border-bottom: 1px solid #444640;
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.brand {
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #eeeae0;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -1.2px;
}
.brand-copy {
  display: grid;
  line-height: 1.1;
}
.brand-copy small {
  margin-top: 2px;
  color: #d5c7ef;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.brand-symbol {
  width: 34px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 2px solid #523278;
  border-radius: 11px;
  background: #9064e3;
  color: #ffe183;
  box-shadow:
    inset 0 2px #b797ff,
    0 2px #58377a;
  font:
    27px/1 Georgia,
    serif;
  text-shadow: 1px 1px #65438c;
  transform: rotate(-6deg);
}
.utilities,
.utility,
.controls,
.primary,
.sound-row,
.paused-screen span {
  display: flex;
  align-items: center;
}
.utilities {
  gap: 8px;
}
.utility {
  justify-content: center;
  gap: 8px;
  border: 1px solid #53554f;
  border-radius: 11px;
  color: #eeeae0;
  background: #30322f;
  box-shadow: inset 0 1px #ffffff0d, 0 2px #151614;
  font-size: 14px;
  font-weight: 700;
  min-height: 39px;
  padding: 0 15px;
}
.utility:hover,
.cancel:hover {
  background: #41443e;
  border-color: #86857b;
}
.utility[aria-expanded="true"],
.utility[aria-pressed="true"] {
  color: #ffe8bd;
  background: #49463b;
}
#game-settings:disabled {
  opacity: 0.5;
}
.page {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: var(--gutter) max(var(--gutter), env(safe-area-inset-right)) max(calc(var(--gutter) + 4px), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.cabinet {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 240px;
  padding: clamp(9px, 1vw, 15px) clamp(9px, 1vw, 15px) 0;
  border: 2px solid #54564f;
  border-radius: 24px;
  background: linear-gradient(155deg, #424540 0%, #2c2f2c 55%, #242624 100%);
  box-shadow:
    inset 0 1px #a3a29855,
    inset 0 -4px #1d201d,
    0 3px 0 #101210,
    0 8px 19px #08090755;
}
.screw {
  position: absolute;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #918573 39%,
    #3c3931 42% 58%,
    #968a75 62%
  );
  box-shadow: 0 1px #0e100f, inset 0 1px #b6aa92;
}
.tl {
  top: 8px;
  left: 12px;
}
.tr {
  top: 8px;
  right: 12px;
}
.bl {
  bottom: 13px;
  left: 13px;
}
.br {
  bottom: 13px;
  right: 13px;
}
.stage-window {
  isolation: isolate;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 2px solid #171a17;
  border-radius: 15px;
  background-color: #403d38;
  background-image:
    radial-gradient(ellipse at 44% 41%, transparent 26%, #0e100d4d 100%),
    url("./assets/tabletop.webp");
  background-position: center;
  background-size: cover;
  box-shadow: 0 1px #a3a29560;
}
.stage-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 2px 9px #06080588;
}
#scene,
.stage-overlay,
.paused-screen {
  position: absolute;
  inset: 0;
}
#scene {
  z-index: 1;
  pointer-events: none;
}
#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.stage-hud {
  position: absolute;
  inset: 14px 15px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
  pointer-events: none;
  font-size: 13px;
  font-weight: 700;
}
#status-chip,
.round-counter {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 4px 11px;
  border: 1px solid #767669;
  border-radius: 9px;
  background: #282a26f5;
  color: #eee9dd;
  box-shadow: 0 2px 5px #13141040;
  line-height: 1.4;
}
#status-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4b876;
}
.round-counter span {
  color: #cecabf;
  font-size: 12px;
}
.round-counter strong {
  font-family: "Atti Sans", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.console-controls {
  flex: none;
  min-height: clamp(68px, 10vh, 90px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 5% 15px;
}
.controls {
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.primary {
  border: 2px solid #8c79ad;
  border-radius: 15px;
  color: white;
  background: linear-gradient(#75628c, #604c76 75%);
  box-shadow:
    inset 0 1px #c7b3dd80,
    0 4px #382d42,
    0 6px 10px #0f100e66;
  justify-content: center;
  gap: 11px;
  min-height: 53px;
  min-width: clamp(165px, 18vw, 248px);
  padding: 8px 23px;
  font-size: clamp(18px, 1.55vw, 23px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.primary:hover {
  filter: brightness(1.055);
}
.primary:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px #c7b3dd80,
    0 2px #382d42;
}
.primary i {
  color: #fff2b9;
  font-size: 1.03em;
}
.vent {
  width: 34px;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    #111511 0 3px,
    #6d706640 3px 4px,
    transparent 4px 8px
  );
  transform: skew(-17deg);
  border-radius: 3px;
  opacity: 0.76;
}
.cancel {
  border: 1px solid #63655c;
  border-radius: 10px;
  color: #e5e2d8;
  background: #363934;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 700;
}
.face-list {
  display: grid;
  gap: 11px;
  margin: 14px 0;
  flex: 1;
}
.face-card {
  --tint: #ede4ff;
  --face: #764ca2;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: clamp(62px, 5.55vw, 83px) 1fr 28px;
  align-items: center;
  gap: 10px;
  text-align: left;
  overflow: hidden;
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid color-mix(in srgb, var(--face) 32%, white);
  border-radius: 14px;
  background: linear-gradient(
    115deg,
    var(--tint),
    color-mix(in srgb, var(--tint) 55%, white)
  );
  font-size: 16px;
  min-height: 88px;
}
.face-card::before,
.face-card::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--face) 12%, transparent);
  width: 115px;
  height: 115px;
  border-radius: 50%;
  bottom: -88px;
  right: 10px;
  z-index: -1;
}
.face-card::after {
  width: 138px;
  height: 138px;
  right: -2px;
  bottom: -100px;
}
.face-card:hover {
  border-color: var(--face);
}
.face-card canvas {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 1px #4f31562b);
  transform: rotate(-9deg);
}
.face-card:nth-child(2) canvas {
  transform: rotate(7deg);
}
.side-text {
  min-width: 0;
}
.side-tag {
  display: block;
  color: var(--face);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.side-name {
  display: block;
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.045em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.face-phrase {
  display: block;
  color: #696373;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.edit-icon {
  margin-left: auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--face) 32%, white);
  border-radius: 8px;
  background: #ffffffa8;
  color: var(--face);
}
.edit-icon svg {
  width: 14px;
  height: 14px;
}
.match-options {
  display: flex;
  flex-direction: column;
  border-top: 1px dashed #d9d1e1;
  padding-top: 8px;
  gap: 2px;
}
.match-options button {
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 3px 3px;
  font-size: 14px;
}
.match-options button > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c637a;
  font-weight: 550;
}
.match-options i {
  color: #92869d;
}
.match-options b {
  font-weight: 750;
  color: #55446c;
}
.match-options button:hover b {
  text-decoration: underline;
}
.stage-overlay,
.paused-screen {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.stage-overlay {
  background: #14161288;
  backdrop-filter: blur(4px);
}
.reveal {
  max-width: min(90%, 540px);
  max-height: calc(100% - 68px);
  overflow: auto;
  margin-top: 21px;
  text-align: center;
  border: 1px solid #8a8473;
  border-radius: 18px;
  color: #f5f1e6;
  background: linear-gradient(155deg, #393b36, #282a26);
  box-shadow:
    inset 0 1px #dfd4b53d,
    0 3px #191b17,
    0 12px 32px #080a0777;
  padding: 12px 26px 14px;
  pointer-events: auto;
}
#reveal-title {
  font-size: 14px;
  font-weight: 750;
  color: #ddcfac;
  overflow-wrap: anywhere;
}
.reveal canvas {
  display: block;
  margin: 5px auto;
  width: clamp(78px, 11vh, 125px);
  height: auto;
  filter: drop-shadow(0 3px 2px #14161080);
}
.reveal h2 {
  font-size: clamp(24px, 2.7vw, 37px);
  line-height: 1.22;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}
#result-phrase {
  font-size: 16px;
  margin-top: 4px;
  color: #dedbd0;
  overflow-wrap: anywhere;
}
#result-phrase:empty {
  display: none;
}
#result-score {
  font-size: 15px;
  font-weight: 700;
  margin-top: 9px;
  overflow-wrap: anywhere;
}
.paused-screen {
  z-index: 3;
  background: #1a1d1988;
  backdrop-filter: blur(3px);
}
.paused-screen span {
  gap: 8px;
  padding: 13px 21px;
  border: 1px solid #807d6c;
  border-radius: 12px;
  color: #f2eee2;
  background: #333630;
  font-size: 19px;
  font-weight: 750;
}
.paused-screen svg {
  width: 21px;
  height: 21px;
}
.sound-anchor {
  position: relative;
}
.sound-panel {
  position: absolute;
  z-index: 10;
  right: 0;
  top: calc(100% + 10px);
  width: 254px;
  padding: 19px;
  background: white;
  border: 1px solid #cdbfda;
  box-shadow: 0 6px 22px #332a4825;
  border-radius: 16px;
}
.sound-panel h2 {
  font-size: 18px;
  margin-bottom: 13px;
}
.sound-row {
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}
.switch {
  appearance: none;
  display: block;
  position: relative;
  width: 38px;
  height: 23px;
  background: #cbc5d3;
  border-radius: 20px;
  cursor: pointer;
  margin: 0;
}
.switch:checked {
  background: #8459cb;
}
.switch:before {
  content: "";
  position: absolute;
  background: #fff;
  width: 17px;
  height: 17px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  box-shadow: 0 1px 2px #0002;
}
.switch:checked:before {
  left: 18px;
}
.volume {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
  font-size: 13px;
  gap: 6px;
  color: #71697e;
  margin: 7px 0 13px;
}
.volume:last-of-type {
  margin-bottom: 0;
}
.volume input {
  min-width: 0;
  accent-color: #8459cb;
}
#audio-message {
  color: #8b364e;
  font-size: 13px;
}
body.expanded {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  overscroll-behavior: contain;
}
.expanded .topbar {
  height: 48px;
}
.expanded {
  --gutter: 4px;
}
.expanded .cabinet {
  border-radius: 14px;
  padding: 6px 6px 0;
}
@media (max-width: 720px) {
  .topbar {
    height: 53px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-symbol {
    width: 29px;
    height: 29px;
    font-size: 24px;
  }
  .utility {
    min-height: 38px;
    padding: 0 10px;
  }
  .cabinet {
    border-radius: 19px;
  }
  .console-controls {
    min-height: 70px;
    padding: 9px 3% 13px;
  }
  .primary {
    font-size: 19px;
    min-height: 47px;
    min-width: 160px;
    border-radius: 13px;
  }
  .vent {
    width: 22px;
    height: 13px;
  }
  .stage-hud {
    inset: 12px 12px auto;
  }
  .face-list {
    margin: 12px 0 10px;
    gap: 8px;
  }
  .face-card {
    min-height: 76px;
    grid-template-columns: 57px minmax(0, 1fr) 27px;
    gap: 9px;
    padding: 9px;
  }
  .side-name {
    font-size: 19px;
  }
  .face-phrase {
    font-size: 13px;
  }
  .sound-panel {
    right: -42px;
  }
}
@media (max-width: 450px) {
  .utility:not(#game-settings) span {
    display: none;
  }
  .utility:not(#game-settings) {
    width: 38px;
    padding: 0;
  }
  .utilities {
    gap: 6px;
  }
  .brand {
    gap: 7px;
  }
  .controls {
    gap: 7px;
  }
  .controls #pause {
    min-width: 120px;
  }
  .cancel {
    font-size: 13px;
    padding: 9px;
  }
  .vent {
    width: 15px;
  }
}
@media (max-height: 540px) {
  .topbar, .expanded .topbar {
    height: 45px;
  }
  .page {
    padding-top: 6px;
    padding-bottom: 8px;
  }
  .console-controls {
    min-height: 51px;
    padding-block: 3px 8px;
  }
  .primary {
    min-height: 38px;
    padding-block: 5px;
    font-size: 17px;
  }
  .stage-hud {
    inset: 8px 10px auto;
  }
}
.reveal {
  min-width: min(84%, 380px);
}
.reveal canvas {
  width: clamp(110px, min(24vh, 38vw), 240px);
}
.reveal .tie-medals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 6px 0;
  color: #c5bda9;
  font-size: 24px;
}
.tie-medals canvas {
  width: clamp(54px, 8vh, 85px);
  margin: 0;
}
.tie-medals canvas:first-child {
  transform: rotate(-9deg);
}
.tie-medals canvas:last-child {
  transform: rotate(9deg);
}
@media (max-height: 600px) {
  .reveal canvas {
    width: 78px;
  }
  .tie-medals canvas {
    width: 49px;
  }
}
