@font-face {
  font-family: "CWCommand";
  src: url("art/fonts/Oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CWReading";
  src: url("art/fonts/Oranienbaum.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CWNumber";
  src: url("art/fonts/OldStandardTT.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #ead9b8;
  --ivory: #f4e6ca;
  --parchment: #dcc59b;
  --muted: #b9ad98;
  --dim: #a8916a;
  --deep: #0b0607;
  --obsidian: #0b0607;
  --obsidian-card: #120c0b;
  --paper: #f3e6cb;
  --cream: #fbf3de;
  --brass: #c29a5b;
  --brass-dark: #7d5b2d;
  --gold: #f3d698;
  --gold-bright: #fff1d5;
  --velvet: #641622;
  --velvet-deep: #340c12;
  --crimson: #9f2930;
  --amber: #e29b2c;
  --lunar: #4989bc;
  --pine: #2a5b46;
  --error: #e1b3a0;
  --cmd-font: "CWCommand", "Oswald", -apple-system, BlinkMacSystemFont, sans-serif;
  --read-font: "CWReading", "Oranienbaum", Georgia, "Times New Roman", serif;
  --num-font: "CWNumber", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 50% 42%, #190d0e 0%, #060304 100%);
  color: var(--ink);
  font-family: var(--read-font);
  height: 100%;
  color-scheme: dark;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#cabinet {
  width: 100%;
  max-width: 440px;
  height: 512px;
  max-height: 100vh;
  background:
    radial-gradient(ellipse 62% 52% at 24% 48%, rgba(255, 198, 114, 0.055) 0%, transparent 72%),
    linear-gradient(180deg, #12090a 0%, #0b0607 100%);
  border: 1px solid rgba(194, 154, 91, 0.38);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(243, 214, 152, 0.08);
}

.pc-layout-switch {
  display: none;
  align-items: center;
  gap: 2px;
  background: rgba(11, 6, 7, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.34);
  border-radius: 2px;
  padding: 1px;
  margin-right: 4px;
}

.pc-layout-switch button,
.cover-pc-pick button {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--dim);
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 7px;
  min-height: 22px;
  box-shadow: none;
}

.pc-layout-switch button.active,
.cover-pc-pick button.active {
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  color: var(--gold-bright);
  border-color: var(--brass);
}

.cover-pc-pick {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}
.cover-pick-label {
  font-family: var(--cmd-font);
  font-size: 10.5px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--parchment);
}
.cover-pc-pick button {
  min-height: 24px;
  border-color: rgba(194, 154, 91, 0.28);
  background: #160d0c;
  color: var(--parchment);
}

/* Frameless Circus Welt Top HUD */
.topbar {
  height: 32px;
  background: linear-gradient(180deg, rgba(11, 6, 7, 0.97) 0%, rgba(11, 6, 7, 0.84) 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border-bottom: 1px solid rgba(194, 154, 91, 0.24);
  flex-shrink: 0;
  gap: 4px;
  z-index: 6;
}

.brand {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f2e3bf 10%, #dcc292 55%, #ad8b58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

/* Base Circus Welt Controls */
button {
  font-family: var(--cmd-font);
  cursor: pointer;
  touch-action: manipulation;
  border-radius: 2px;
  border: 1px solid rgba(194, 154, 91, 0.42);
  background: linear-gradient(180deg, #1b1210 0%, #100a09 100%);
  color: var(--ink);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  min-height: 24px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: color 0.14s, border-color 0.14s, background 0.14s, filter 0.14s;
}

button:hover:not(:disabled) {
  color: var(--gold-bright);
  border-color: var(--brass);
  background: linear-gradient(180deg, #2b1517 0%, #160b0c 100%);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.top-actions button:not(.pc-layout-switch button) {
  position: relative;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 5.5px;
  min-height: 23px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dim);
}

.top-actions button:not(.pc-layout-switch button)::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 2px;
  height: 1px;
  background: var(--brass);
  opacity: 0;
  transition: opacity 0.14s;
}

.top-actions button:not(.pc-layout-switch button):hover:not(:disabled),
.top-actions button:not(.pc-layout-switch button):focus-visible:not(:disabled),
.top-actions button:not(.pc-layout-switch button).is-active {
  background: linear-gradient(90deg, rgba(84, 24, 33, 0.72), rgba(77, 16, 26, 0.35) 75%, transparent);
  color: var(--gold-bright);
}

.top-actions button:not(.pc-layout-switch button):hover:not(:disabled)::after,
.top-actions button:not(.pc-layout-switch button):focus-visible:not(:disabled)::after,
.top-actions button:not(.pc-layout-switch button).is-active::after {
  opacity: 1;
}

@media (max-width: 390px) {
  .topbar { padding: 0 5px; gap: 2px; }
  .brand { font-size: 10px; letter-spacing: 0.09em; }
  .top-actions { gap: 1px; }
  .top-actions button:not(.pc-layout-switch button) { font-size: 9px; padding: 2px 4px; letter-spacing: 0.04em; }
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen[hidden], [hidden] { display: none !important; }

.status-banner {
  background: #1c0f0e;
  color: var(--gold);
  border-bottom: 1px solid rgba(194, 154, 91, 0.34);
  font-family: var(--read-font);
  font-size: 11px;
  padding: 3px 8px;
  text-align: center;
  flex-shrink: 0;
}
.status-banner[hidden] { display: none; }

/* Primary Crimson-Velvet & Framed Brass Action */
.primary-btn {
  font-family: var(--cmd-font);
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  border: 1px solid #cfa560;
  border-radius: 2px;
  color: #f6e6c0;
  min-height: 34px;
  padding: 5px 16px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(246, 224, 172, 0.16),
    inset 0 1px 0 rgba(255, 240, 200, 0.22);
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #741c28 0%, #480f18 100%);
  border-color: var(--gold);
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(242, 196, 112, 0.4);
}

.primary-btn:disabled {
  opacity: 0.65;
  background: linear-gradient(180deg, #17100f 0%, #0f0a09 100%);
  border-color: rgba(194, 154, 91, 0.3);
  color: var(--dim);
  box-shadow: none;
}

.cw-panel-skin {
  background: #100b09;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-image: url("art/ui/panel.webp") 26 28 26 28 fill / 12px 14px / 0 stretch;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.85);
}

/* Cover menu over the theatre illustration */
#cabinet:has(> .cw-cover:not([hidden])) > .topbar {
  display: none;
}

.cw-cover {
  overflow-y: auto;
  padding: clamp(8px, 3vh, 24px) 10px;
  background:
    radial-gradient(ellipse at center, rgba(15, 7, 8, 0.84) 10%, rgba(15, 7, 8, 0.69) 42%, rgba(15, 7, 8, 0.15) 100%),
    linear-gradient(180deg, rgba(11, 6, 7, 0.12), rgba(11, 6, 7, 0.48)),
    url("art/sprites/cue_cover.webp") center 48% / cover no-repeat #0b0607;
}

.cover-content {
  display: grid;
  justify-items: center;
  gap: 8px;
  flex: none;
  width: min(100%, 440px);
  margin: auto;
  text-align: center;
}

.cw-cover-head {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.cw-cover-logo {
  display: block;
  width: auto;
  height: clamp(40px, 12vh, 76px);
  filter: drop-shadow(0 3px 8px #0b0607);
}

.cw-cover-logo-en {
  font-family: var(--read-font);
  font-size: clamp(22px, 4.8vh, 34px);
  letter-spacing: 0.11em;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 2px 5px #0b0607;
}

.cover-eyebrow {
  font-family: var(--cmd-font);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--parchment);
}

.cover-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.cover-badge {
  padding: 2px 8px;
  border: 1px solid rgba(194, 154, 91, 0.5);
  border-radius: 2px;
  background: rgba(11, 6, 7, 0.9);
  color: var(--gold);
  font-family: var(--cmd-font);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cover-content h1 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--cmd-font);
  font-weight: 400;
  font-size: clamp(20px, 4.8vw, 31px);
  line-height: 1.13;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 5px #0b0607;
}

.cover-sub {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(13px, 2.6vw, 16px);
  line-height: 1.2;
  color: var(--cream);
  text-shadow: 0 2px 4px #0b0607;
}

.cover-week-strip,
.cw-menu-nav {
  display: grid;
  width: min(100%, 360px);
  gap: 5px;
}

.cover-week-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cover-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 35px;
  padding: 2px;
  border: 1px solid rgba(194, 154, 91, 0.43);
  background: rgba(18, 12, 11, 0.94);
  color: var(--ink);
  box-shadow: none;
}

.cover-day-pill.focus {
  background: linear-gradient(180deg, #621721, #3a0c13);
  border-color: var(--gold);
  color: var(--gold);
}

.cover-day-pill.cleared {
  background: rgba(24, 52, 38, 0.86);
  border-color: rgba(110, 178, 134, 0.6);
  color: #bfe6cc;
}

.cover-day-pill .pill-day {
  font-size: 11px;
  line-height: 1.1;
}

.cover-day-pill .pill-mark {
  font-size: 9px;
  line-height: 1;
}

.cw-menu-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cw-menu-nav button {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.cw-cmd-main,
.cover-encore {
  grid-column: 1 / -1;
}

.cw-cmd-main {
  min-height: 44px;
  font-size: 15px;
}

.cw-cmd {
  min-height: 38px;
  padding-inline: 4px;
  font-size: 11px;
}

.cover-encore {
  min-height: 38px;
  color: var(--gold);
  border-color: var(--brass);
}

.cw-menu-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.cw-menu-footer-nav button {
  min-height: 28px;
  height: auto;
  padding-inline: 7px;
  border-color: transparent;
  color: var(--ink);
  background: rgba(11, 6, 7, 0.7);
  box-shadow: none;
}

@media (max-height: 360px) {
  .cw-cover { padding-block: 6px; }
  .cover-content { gap: 4px; }
  .cw-cover-logo { height: 32px; }
  .cw-cover-logo-en { font-size: 20px; }
  .cover-eyebrow { display: none; }
  .cover-content h1 { font-size: 20px; }
  .cover-sub { max-width: 54ch; font-size: 13px; }
  .cover-day-pill { min-height: 30px; }
  .cw-cmd-main { min-height: 38px; }
  .cw-cmd, .cover-encore { min-height: 32px; }
}

.folio-header-band h2::after,
.card-box h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(181, 143, 85, 0), rgba(181, 143, 85, 0.78) 25%, rgba(181, 143, 85, 0.78) 75%, rgba(181, 143, 85, 0));
}

.folio-header-band h2::before,
.card-box h2::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2.5px;
  width: 5px;
  height: 5px;
  background: #c7a262;
  transform: translateX(-50%) rotate(45deg);
}

/* Secondary Circus Welt Obsidian & Brass Folio Panels (Nights, Gels, Custom, Result, About) */
.panel {
  flex: 1;
  min-height: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 65% 52% at 50% 35%, rgba(84, 24, 33, 0.22) 0%, transparent 72%),
    radial-gradient(ellipse 52% 45% at 24% 28%, rgba(255, 198, 114, 0.055) 0%, transparent 72%),
    #0b0607;
}

.folio-sheet {
  width: 100%;
  max-width: 600px;
  margin: auto 0;
  background: #100b09;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-image: url("art/ui/panel.webp") 26 28 26 28 fill / 12px 14px / 0 stretch;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
}

.folio-sheet-narrow {
  max-width: 500px;
}

.folio-header-band {
  padding-bottom: 2px;
}

.folio-header-band h2,
.card-box h2 {
  position: relative;
  margin: 0 0 4px;
  padding-bottom: 5px;
  font-family: var(--cmd-font);
  font-weight: 200;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0dcb2;
}

.folio-header-band p {
  margin: 0;
  font-family: var(--read-font);
  font-size: 11px;
  line-height: 1.24;
  color: var(--dim);
}

.card-box {
  background: rgba(18, 12, 11, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.3);
  border-radius: 2px;
  padding: 7px 9px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(243, 214, 152, 0.06);
}

.card-box h3 {
  margin: 0 0 4px;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.card-box p {
  margin: 2px 0;
  font-family: var(--read-font);
  font-size: 11.5px;
  line-height: 1.32;
}

.result-columns,
.result-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stamp-card { position: relative; }

.guilty-seal {
  display: inline-block;
  border: 1px solid rgba(194, 154, 91, 0.55);
  color: var(--gold);
  background: rgba(104, 24, 34, 0.38);
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 2px;
  margin-bottom: 3px;
}
.guilty-seal.is-ok {
  background: rgba(24, 62, 42, 0.55);
  border-color: rgba(114, 198, 146, 0.55);
  color: #cef2da;
}
.guilty-seal.is-fail {
  background: rgba(110, 22, 32, 0.52);
  border-color: rgba(225, 134, 120, 0.55);
  color: #f6cec6;
}

.meta-line {
  font-family: var(--cmd-font) !important;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--gold) !important;
}

.reward-card {
  display: flex;
  align-items: center;
  gap: 9px;
}
.res-reward-gel {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(243, 214, 152, 0.35));
}
.res-reward-gel[hidden] { display: none; }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 2px;
}

.panel-actions button {
  min-height: 28px;
  padding: 4px 12px;
}

.day-list { display: grid; grid-template-columns: 1fr; gap: 4px; }
.day-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 12, 11, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.3);
  border-radius: 2px;
  padding: 4px 7px;
  gap: 7px;
}
.day-item.is-cleared {
  border-color: rgba(114, 178, 134, 0.45);
  background: rgba(20, 34, 26, 0.85);
}
.day-item.is-locked { opacity: 0.55; }
.day-item.encore-item {
  border-color: var(--brass);
  background: linear-gradient(100deg, #33141a, #160e0d);
}
.encore-item .day-item-info { gap: 3px; }
.encore-item a {
  align-self: flex-start;
  color: var(--gold);
  font-family: var(--read-font);
  font-size: 12px;
}
.encore-item button { flex-shrink: 0; }

.day-seal {
  min-width: 26px;
  height: 20px;
  padding: 0 4px;
  border-radius: 2px;
  background: #17100e;
  border: 1px solid rgba(194, 154, 91, 0.48);
  color: var(--gold);
  font-family: var(--cmd-font);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.day-item.is-cleared .day-seal {
  background: #1a3326;
  border-color: rgba(128, 198, 148, 0.55);
  color: #dff4e6;
}
.day-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.day-item-info strong {
  font-family: var(--read-font);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-item-info small {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--dim);
}
.row-btn {
  flex-shrink: 0;
  font-size: 10px;
  min-height: 23px;
  padding: 2px 9px;
}
.row-btn.active-row-btn {
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.gel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.gel-slot {
  background: rgba(18, 12, 11, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.3);
  border-radius: 2px;
  padding: 6px 5px;
  text-align: center;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.gel-slot.earned {
  border-color: rgba(114, 178, 134, 0.45);
  background: radial-gradient(circle at 50% 30%, rgba(44, 88, 62, 0.25), rgba(18, 12, 11, 0.94));
}
.gel-slot.borrowed {
  border-color: rgba(226, 155, 44, 0.45);
}
.gel-slot strong {
  font-family: var(--read-font);
  font-weight: 400;
  font-size: 11px;
  color: var(--ivory);
}
.gel-slot span {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.gel-slot.earned span { color: #bfe6cc; }
.gel-slot.borrowed span { color: var(--gold); }
.gel-disc-img {
  width: 36px;
  height: 36px;
  padding: 3px;
  border-radius: 50%;
  border: 1px solid rgba(194, 154, 91, 0.28);
  background: radial-gradient(circle at 50% 45%, rgba(28, 20, 16, 0.9), rgba(8, 5, 5, 0.95));
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}
.gel-slot.earned .gel-disc-img { border-color: rgba(128, 198, 148, 0.6); }
.gel-slot.borrowed .gel-disc-img { filter: saturate(0.68) opacity(0.9); border-color: rgba(226, 155, 44, 0.55); }
.gel-slot.empty .gel-disc-img { filter: grayscale(0.85) opacity(0.45); }

.poll-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.poll-btn {
  min-height: 32px;
  font-family: var(--read-font);
  font-size: 11px;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  line-height: 1.2;
  padding: 4px 8px;
}
.poll-btn.chosen {
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  border-image: url("art/ui/selection.webp") 12 16 12 16 fill / 6px 8px / 0 stretch;
  color: var(--gold-bright);
  border-color: var(--gold);
}

.custom-beats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.beat-chip {
  min-height: 32px;
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: normal;
}
.beat-chip.chip-A, .beat-chip.chip-AS { border-color: rgba(226, 155, 44, 0.68); color: #fbd286; }
.beat-chip.chip-C, .beat-chip.chip-CS { border-color: rgba(185, 58, 62, 0.75); color: #f6b2ab; }
.beat-chip.chip-L, .beat-chip.chip-LS { border-color: rgba(73, 137, 188, 0.72); color: #a7d4f6; }
.beat-chip.chip-AC, .beat-chip.chip-CL, .beat-chip.chip-AL { border-color: rgba(243, 214, 152, 0.68); color: var(--gold-bright); }
.beat-chip.chip-D { border-color: rgba(168, 145, 106, 0.32); color: var(--dim); background: #0c0808; }

.input-row { display: flex; gap: 6px; }
.input-row input {
  flex: 1;
  min-width: 0;
  padding: 5px 9px;
  font-family: var(--num-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-radius: 2px;
  background: #0d0807;
  color: var(--ivory);
  caret-color: var(--gold);
}
.input-row input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(243, 214, 152, 0.35);
}
.status-note {
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 2px;
  background: rgba(104, 24, 34, 0.25);
  border: 1px solid rgba(201, 147, 75, 0.34);
  color: var(--error);
  font-family: var(--read-font);
  font-size: 11px;
}
.status-note[hidden] { display: none; }
#resActionStatus { color: var(--ivory); }
#resShareText {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--brass);
  border-radius: 2px;
  background: #0d0807;
  color: var(--ivory);
  font: 12px/1.4 var(--read-font);
}

.panel button.encore-action,
#btnShareResult[data-challenge="yes"],
#customCodeInput {
  min-height: 44px;
}

.about-crest {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  text-align: center;
  margin-bottom: 3px;
}
.about-card h2 { text-align: center; }
#aboutMusic { margin-top: 7px; }
#aboutMusic a { color: var(--brass); }
.ai-note-box {
  margin-top: 7px !important;
  padding: 7px 9px;
  background: rgba(11, 6, 7, 0.72);
  border: 1px solid rgba(194, 154, 91, 0.22);
  border-radius: 2px;
  color: var(--muted);
  font-size: 10.5px !important;
  line-height: 1.32 !important;
}

/* ============================================================================
 * DESKTOP PC 16:9 PAPER THEATRE GUITAR HERO STYLES (01 Split & 04 Workbench)
 * ============================================================================ */

.pc-play-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 68% 58% at 50% 45%, #1c100f 0%, #090506 100%);
  padding: 2px 4px;
  gap: 3px;
}

.pc-theatre-frame {
  position: relative;
  width: 820px;
  height: 461px;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
  contain: layout style paint;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  border-radius: 4px;
}

.pc-stage-opening {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  contain: strict;
}

#pcStageCanvas {
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform;
}

.pc-frame-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 3;
  pointer-events: none;
  transform: translateZ(0);
}

.pc-lens {
  position: absolute;
  z-index: 4;
  object-fit: fill;
  pointer-events: none;
  mix-blend-mode: screen;
}
.pc-lens[hidden] { display: none; }

.pc-plaque {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pc-plaque img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pc-plaque-text {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: clamp(8px, 0.96vw, 13.5px);
  color: #24160c;
  text-align: center;
  padding: 0 13%;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pc-plaque-text.good { color: #1b5c34; }
.pc-plaque-text.bad { color: #9c1f18; }
.pc-plaque-text.prism { color: #67268c; }

/* Desktop Widescreen Media Rules (>= 680px) */
@media (min-width: 680px) {
  #cabinet {
    width: 98vw;
    max-width: 1380px;
    height: 512px;
    max-height: 98vh;
  }

  .pc-layout-switch,
  .cover-pc-pick {
    display: inline-flex;
  }

  /* Desktop Folio Panels */
  .panel { padding: 14px 20px; }
  .folio-sheet {
    max-width: min(1020px, 94vw);
    padding: 16px 20px;
    gap: 10px;
    border-image-width: 15px 17px;
  }
  .folio-sheet-narrow {
    max-width: min(640px, 92vw);
    padding: 18px 24px;
  }
  .folio-header-band h2,
  .card-box h2 {
    font-size: 18px;
    padding-bottom: 6px;
    margin-bottom: 5px;
  }
  .folio-header-band p { font-size: 13px; }
  .card-box { padding: 11px 14px; }
  .card-box h3 { font-size: 13px; margin-bottom: 6px; }
  .card-box p { font-size: 13px; line-height: 1.38; }

  .result-columns {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
  .result-col { gap: 10px; }
  .result-col:last-child .card-box {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .poll-btn { min-height: 40px; font-size: 12.5px; padding: 6px 10px; }
  .panel-actions { gap: 10px; padding-top: 4px; }
  .panel-actions button { min-height: 34px; padding: 5px 16px; font-size: 12px; }

  .day-list { grid-template-columns: 1fr 1fr; gap: 7px; }
  .day-item { padding: 6px 10px; gap: 9px; }
  .day-seal { min-width: 30px; height: 24px; font-size: 10px; }
  .day-item-info strong { font-size: 13.5px; }
  .day-item-info small { font-size: 10.5px; }
  .day-list .day-item:last-child {
    grid-column: 1 / -1;
    border-color: rgba(194, 154, 91, 0.52);
    background: linear-gradient(180deg, rgba(64, 18, 25, 0.42) 0%, rgba(18, 12, 11, 0.92) 100%);
  }

  .gel-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .gel-slot { padding: 10px 8px; }
  .gel-disc-img { width: 42px; height: 42px; }
  .gel-slot strong { font-size: 12.5px; }

  .custom-beats { grid-template-columns: repeat(8, 1fr); gap: 6px; }
  .beat-chip { min-height: 40px; font-size: 11px; }
  .ai-note-box { font-size: 12px !important; line-height: 1.4 !important; padding: 10px 12px; }
}

@media (min-width: 680px) and (min-height: 580px) {
  body:not(.is-devvit) #cabinet {
    height: min(95vh, 804px);
  }
  .topbar { height: 38px; padding: 0 16px; }
  .brand { font-size: 14px; }
  .top-actions { gap: 5px; }
  .top-actions button:not(.pc-layout-switch button) { font-size: 11.5px; padding: 4px 8px; }
}

@media (max-width: 960px) and (min-width: 680px) {
  .pc-key-legend { display: none; }
}

/* 2. 2D Layered Paper Theatre Stage Screen */
.play-stage-shell {
  background: radial-gradient(ellipse 68% 58% at 50% 45%, #1c100f 0%, #090506 100%);
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding-bottom: 2px;
}

.landscape-prompt {
  width: min(90%, 440px);
  padding: 16px;
  text-align: center;
}

.landscape-prompt p:empty {
  display: none;
}

.landscape-prompt .panel-actions {
  margin-top: 8px;
}

.landscape-prompt .panel-actions button {
  min-height: 44px;
}

@media (orientation: landscape) and (max-height: 512px) {
  #cabinet { max-height: 100dvh; }
}

@media (orientation: landscape) and (max-width: 679px) {
  #cabinet { max-width: none; }
}

.pc-highway-canvas {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}

.pc-ctrl-btn {
  position: absolute;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  z-index: 6;
  overflow: visible;
}
.pc-ctrl-btn:hover:not(:disabled),
.pc-ctrl-btn:active:not(:disabled) {
  filter: none;
  transform: none;
}

/* Split (01): physical vertical slider handles gliding inside grooves */
.layout-split .pc-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-split .pc-ctrl-btn img {
  width: 96%;
  height: auto;
  object-fit: contain;
  transform: translateY(24%);
  transition: transform 0.08s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.layout-split .pc-ctrl-btn.active img {
  transform: translateY(-76%);
  filter: brightness(1.14);
}

.pc-key-letter {
  display: none;
}

.layout-split.pc-theatre-frame {
  container-type: inline-size;
}

.layout-split .pc-key-letter {
  position: absolute;
  display: grid;
  place-items: center;
  left: 52%;
  top: 85.3%;
  width: 39%;
  height: 24%;
  transform: translate(-50%, -50%);
  border-radius: 20%;
  background: linear-gradient(#efc38f, #f2cb9c 28%, #ebbd8b);
  box-shadow: 0 0 2px 1px #efc395;
  color: #291b12;
  font: bold 2.75cqw/1 Georgia, serif;
  pointer-events: none;
}

/* Workbench (04): illuminated backlit keycap overlays fading onto unlit base keys */
.layout-workbench .pc-ctrl-btn img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity 0.05s ease, transform 0.05s ease;
  will-change: opacity, transform;
}
.layout-workbench .pc-ctrl-btn.active img {
  opacity: 1;
  transform: translateY(1.5px);
}


.rhythm-pad {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.rhythm-pad:focus-visible {
  outline: 2px solid #fae6b5;
  outline-offset: -2px;
}

.pc-ctrl-btn.is-guided:not(.active)::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #ffedaf;
  border-radius: 4px;
  box-shadow: 0 0 6px #8d4e22;
  pointer-events: none;
}

@media (pointer: coarse) {
  .pc-ctrl-btn::before {
    content: "";
    position: absolute;
    inset: -5px -1px;
  }
}

.pc-instructions, .pc-song-progress {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.pc-instructions {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4px;
  color: #422414;
  font: 700 clamp(10px, 1.35vw, 17px)/1.15 var(--font-reading, Georgia), serif;
  white-space: pre-line;
  border: 1px solid #a67843;
  background: linear-gradient(140deg, #f3dabb, #e0b178);
  box-shadow: inset 0 0 0 3px #ae784219, inset 0 0 8px #84522770;
}

.layout-split .pc-instructions { left: 3.4%; top: 2.3%; width: 22%; height: 13%; }
.layout-workbench .pc-instructions { left: 19.5%; top: 12%; width: 20.9%; height: 17.7%; }

.pc-song-progress {
  display: flex;
  align-items: center;
  padding: 0 7%;
  background: url("art/sprites/pc01_plaque_l.webp") center / 100% 100% no-repeat;
}

.layout-split .pc-song-progress { left: 9.8%; top: 85.8%; width: 22%; height: 11.5%; }
.layout-workbench .pc-song-progress { left: 10%; top: 81.3%; width: 25%; height: 14.2%; }

.pc-song-progress span {
  flex: 1;
  height: 5px;
  background: linear-gradient(to right, #964128 var(--played, 0%), #b89466 var(--played, 0%));
  border: 1px solid #785032;
  box-shadow: inset 0 1px 1px #58331d55;
}
