/*
 * POPER'S GAME v0.22.1 — presentation styles.
 *
 * Formatting-only release. Selectors, CSS properties, priorities and values
 * are unchanged. Shared classes apply to all pages, including Account.
 * Prefer maintaining grouped, readable declarations over compressed CSS.
 */

:root {
  color-scheme: dark;
  --gold: #f0e567;
  --muted: #bdbdb5;
  --line: #41433e;
}

* {
  box-sizing: border-box;
}

/*
 * v0.33.15 DEFAULT BACKGROUND — Practice Room 617.
 * The originals are stored under /assets/venues/original/. All ordinary
 * site pages use the free practice-room photograph at first load; the
 * Play page displays whichever background the Venue Pass system permits.
 * Match the approved Practice Room 617 settings: top black 100%, bottom black 0%. The editable display.json takes over after the venue renderer loads.
 * Change the path in BOTH historic body declarations if the image moves.
 */
body {
  margin: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 1.00), rgba(0, 0, 0, 0.00)),
    url("/assets/venues/optimized/practiceRoom-desktop.webp") center bottom / cover no-repeat fixed;
  font:
    16px/1.55 system-ui,
    sans-serif;
  color: #f7f6ee;
}

header {
  max-width: 1240px;
  margin: auto;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  font:
    28px Georgia,
    serif;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand small {
  display: block;
  font: 9px system-ui;
  letter-spacing: 1.5px;
  margin-top: 7px;
}

.badge {
  font-size: 12px;
  color: var(--gold);
  border: 1px solid #777343;
  padding: 8px 12px;
  border-radius: 30px;
}

main {
  max-width: 1180px;
  margin: auto;
  padding: 36px 24px;
}

.intro {
  margin-bottom: 32px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
}

h1 {
  font:
    clamp(32px, 5vw, 54px) / 1.15 Georgia,
    serif;
  margin: 12px 0;
}

h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 0 0 22px;
}

h2 span {
  font-size: 12px;
  color: var(--gold);
  margin-right: 12px;
}

.intro > p:last-child {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
}

section {
  padding: 26px;
  background: #232720ee;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: block;
  font-size: 13px;
  color: #dfdfd5;
  margin-bottom: 18px;
}

select,
input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: #161a14;
  border: 1px solid #5b5e52;
  border-radius: 7px;
  color: white;
  font: 16px system-ui;
}

input[type="range"] {
  display: block;
  width: 100%;
  accent-color: var(--gold);
  margin-top: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}

output {
  float: right;
  color: var(--gold);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.staff {
  background: #f7f4e9;
  color: #161914;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.staff svg {
  display: block;
  width: 100%;
  height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 1px solid var(--gold);
  border-radius: 7px;
  padding: 12px 18px;
  background: var(--gold);
  color: #23261b;
  font: 600 14px system-ui;
  cursor: pointer;
  min-height: 44px;
}

.secondary {
  background: transparent;
  color: #edeccf;
  border-color: #747767;
}

button:hover {
  filter: brightness(1.12);
}

:focus-visible {
  outline: 3px solid #a8d9ff;
  outline-offset: 4px;
}

.beats {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.beats span {
  display: grid;
  place-items: center;
  flex: 1;
  border: 1px solid #696b60;
  border-radius: 6px;
  height: 44px;
}

.beats .active {
  background: var(--gold);
  color: #20251c;
}

#cue {
  color: var(--gold);
  font:
    24px Georgia,
    serif;
}

#message {
  font-size: 14px;
  min-height: 24px;
}

.error {
  color: #ffb4a9 !important;
}

footer {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

aside {
  min-width: 0;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }

  header {
    padding: 18px;
    flex-wrap: wrap;
  }

  main {
    padding: 24px 16px;
  }

  .brand {
    font-size: 23px;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 20px;
  }

  .badge {
    font-size: 10px;
  }
}

/* 0.3: match the supplied site's auditorium, white type, neutral controls and blue buttons. */
:root {
  --gold: #fff;
  --muted: #ccc;
  --line: #777;
  color-scheme: dark;
}

/*
 * v0.33.15 — Repeat the Practice Room 617 default here because this
 * second historic body rule overrides the first. Changing only the first
 * selector would leave the obsolete Sydney image in place.
 */
body {
  background:
    linear-gradient(rgba(0, 0, 0, 1.00), rgba(0, 0, 0, 0.00)),
    url("/assets/venues/optimized/practiceRoom-desktop.webp") center bottom / cover no-repeat fixed;
  font-family: Roboto, Arial, sans-serif;
  font-weight: 300;
  color: #fff;
}

header {
  border: 0;
  max-width: 960px;
  padding-top: 35px;
}

.brand {
  font:
    38px Roboto,
    Arial,
    sans-serif;
  flex-direction: row-reverse;
  justify-content: space-between;
  width: 100%;
}

.brand img {
  width: 110px;
  height: 90px;
}

.brand small {
  display: none;
}

.badge {
  display: none;
}

main {
  max-width: 960px;
  padding-top: 0;
}

.intro {
  text-align: center;
  font-size: 20px;
}

.layout {
  display: block;
}

section {
  /*
   * The brighter Sydney photograph is attractive, but needs a more opaque
   * panel behind its light-coloured text. Change the PANEL BACKGROUND ONLY:
   * `opacity: .75` on the section would also fade its headings and controls.
   */
  background: rgba(0, 0, 0, 0.75);
  border: 0;
  border-radius: 0;
  padding: 24px;
}

.eyebrow {
  color: #ccc;
}

h2 {
  font-weight: 400;
}

h2 span {
  color: #bbb;
}

nav {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 24px 0;
}

nav button {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #fff;
  min-width: 130px;
}

nav button[aria-pressed="true"] {
  background: #fff;
  color: #111;
}

.staff {
  background: #f2f0e9 url("assets/paper.jpg");
  border-radius: 0;
}

button {
  background: #3cadd4;
  color: #fff;
  border: 0;
  border-radius: 30px;
  font-weight: 400;
}

.secondary {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #fff;
  color: #fff;
}

select,
input[type="number"] {
  background: rgba(144, 144, 144, 0.075);
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #fff;
}

select option {
  background: #252525;
  color: #fff;
}

input[type="range"],
input[type="checkbox"] {
  accent-color: #3cadd4;
}

.beats .active {
  background: #e41b17;
  color: #fff;
}

#cue {
  color: #fff;
  font-family: Roboto, Arial, sans-serif;
}

.preview {
  max-width: 100%;
}

#soundStatus {
  font-size: 13px;
}

aside .staff {
  max-width: 650px;
  margin: 20px auto;
}

@media (max-width: 600px) {
  .brand {
    font-size: 30px;
  }

  .brand img {
    width: 75px;
    height: 70px;
  }

  header {
    padding: 20px;
  }

  .intro {
    font-size: 16px;
  }
}

/* 0.4: musical prefixes stay alongside their editable fields. */
.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.inline-field > span {
  white-space: nowrap;
  display: flex;
  align-items: center;
  font-size: 19px;
}

.inline-field input,
.inline-field select {
  margin-top: 0;
  min-width: 0;
  flex: 1;
}

.crotchet {
  width: 18px;
  height: 30px;
  display: inline-block;
}

/* 0.6: notation-based range pickers, preserving original colours and textures. */
.note-picker {
  min-width: 0;
}

.note-picker h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 1rem 0 0.6rem;
}

.note-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.6rem 0;
}

.note-stepper button {
  min-width: 48px;
  min-height: 48px;
  font-size: 1.4rem;
  padding: 0.3rem 0.8rem;
}

.note-stepper [role="spinbutton"] {
  min-width: 64px;
  text-align: center;
  padding: 0.5rem;
  border-radius: 4px;
}

.note-stepper [role="spinbutton"]:focus-visible {
  outline: 2px solid #3cadd4;
  outline-offset: 3px;
}

#mixedOptions {
  max-width: 340px;
}

.split-staves {
  display: flex;
}

.split-staves > div {
  width: 50%;
  min-width: 0;
}

[hidden] {
  display: none !important;
}

/* 0.9: home/about and larger mobile notation. */
nav {
  flex-wrap: wrap;
  gap: 8px;
}

nav button {
  min-width: 90px;
}

.landing {
  text-align: center;
  padding: 50px 20px;
}

.landing h1,
#aboutPanel h1 {
  font-family: Roboto, Arial, sans-serif;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 600px;
  margin: 35px auto;
}

.home-links a,
.home-links > span {
  padding: 24px 12px;
  border: 1px solid #fff;
  color: white;
  text-decoration: none;
  font-size: 22px;
  background: rgba(0, 0, 0, 0.75);
}

.home-links small {
  display: block;
  font-size: 12px;
}

.home-links > span {
  opacity: 0.45;
}

.page-link {
  color: #74d3f3;
}

#aboutPanel {
  max-width: 760px;
  margin: auto;
}

#aboutPanel h2 {
  margin-top: 30px;
}

.listening {
  margin-top: 24px;
}

meter {
  display: block;
  width: 100%;
  height: 22px;
}

#audioStatus {
  font-size: 14px;
}

#heard {
  font-size: 20px;
}

@media (max-width: 600px) {
  main {
    padding-left: 10px;
    padding-right: 10px;
  }

  section {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .split-staves {
    display: block;
  }

  .split-staves > div {
    width: 100%;
  }

  #mixedOptions {
    max-width: none;
  }

  nav button {
    min-width: 70px;
    padding: 12px;
  }

  .home-links {
    gap: 12px;
  }

  .home-links a,
  .home-links > span {
    font-size: 19px;
  }
}

/* 0.10: links between standalone pages. */
nav a {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid white;
  color: white;
  text-decoration: none;
  background: #0009;
  min-height: 44px;
}

nav a[aria-current="page"] {
  background: white;
  color: #111;
}

@media (max-width: 600px) {
  nav a {
    padding: 12px;
  }
}

/* 0.11: stable centred score with horizontal movement only. */
#noteStaff {
  max-width: 760px;
  margin: 20px auto;
}

#noteStaff svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  #noteStaff {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }
}

/* 0.12: full container width, review scroll and mechanical scoreboard styling. */
#playPanel {
  display: block;
  width: 100%;
}

#playPanel .preview {
  width: 100%;
}

#playPanel #noteStaff {
  width: 100%;
  max-width: none;
  margin: 20px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #666 #e5e1d8;
}

#noteStaff svg {
  max-width: none;
  height: auto;
}

.tempo-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 22px auto;
  padding: 16px;
  max-width: 470px;
  border: 3px solid #8b8578;
  background: #252522;
  box-shadow:
    inset 0 0 0 2px #080808,
    0 3px 10px #0008;
  border-radius: 5px;
  text-align: center;
}

.scoreboard > div {
  min-width: 0;
  flex: 1;
}

.score-label {
  display: block;
  font:
    12px/1.6 Arial,
    sans-serif;
  letter-spacing: 2px;
  color: #e7dec2;
}

.scoreboard output {
  float: none;
  display: block;
  color: #f9eed1;
  font:
    bold clamp(30px, 7vw, 52px) / 1.3 "Courier New",
    monospace;
  letter-spacing: 4px;
  background: linear-gradient(#111 49%, #514d42 50%, #191919 52%);
  border: 1px solid #080808;
  border-radius: 3px;
  text-shadow: 0 1px #000;
}

#attemptStatus {
  text-align: center;
  min-height: 28px;
}

.listening {
  border-top: 1px solid #777;
  padding-top: 12px;
}

.listening summary {
  cursor: pointer;
  margin-bottom: 12px;
}

.log-table {
  overflow-x: auto;
  margin-top: 24px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #555;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #ffffff0b;
}

.result-correct {
  color: #91e5a8;
}

.result-incorrect {
  color: #ff9a9a;
}

/* 0.13: CD-player transport above the score, notebook log and notation review. */
.transport-row {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 -8px;
}

button.transport {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 13px;
  border-radius: 50%;
  background: linear-gradient(#2c9c59, #156937);
  border: 2px solid #80bd91;
  box-shadow:
    0 3px 0 #073e20,
    0 5px 12px #0008;
  color: #fff;
}

.transport svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.transport .stop-symbol {
  display: none;
}

button.transport.is-playing {
  background: linear-gradient(#e04b47, #ad2426);
  border-color: #f5958e;
  box-shadow:
    0 3px 0 #671316,
    0 5px 12px #0008;
}

.transport.is-playing .play-symbol {
  display: none;
}

.transport.is-playing .stop-symbol {
  display: block;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

button.transport[aria-busy="true"] {
  opacity: 0.65;
}

.notebook {
  color: #243345;
  background: #fff1ad;
  border: 1px solid #c8b768;
  box-shadow: 0 5px 15px #0005;
  padding: 18px 16px 20px 38px;
  background-image: linear-gradient(
    to right,
    transparent 25px,
    #de8085 25px,
    #de8085 27px,
    transparent 27px
  );
}

.notebook table {
  color: #243345;
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 24px;
  min-width: 630px;
}

.notebook th,
.notebook td {
  border-bottom: 1px solid #8fb6c4;
  padding: 12px 10px;
  line-height: 24px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 23px,
    #8fb6c455 23px,
    #8fb6c455 24px
  );
}

.notebook th {
  font-size: 13px;
  color: #3c4850;
  background: #f4df8b;
}

.notebook tbody tr:nth-child(even) {
  background: transparent;
}

.notebook .result-correct,
.log-note-card .result-correct {
  color: #176b35;
}

.notebook .result-incorrect,
.log-note-card .result-incorrect {
  color: #ad2026;
}

.notation-review {
  margin: 26px 0;
}

.notation-review > summary {
  cursor: pointer;
  font-size: 20px;
  padding: 10px 0;
}

.log-staves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.log-note-card {
  background: #f2f0e9 url("assets/paper.jpg");
  color: #263020;
  padding: 14px;
  min-width: 0;
}

.log-note-card h3 {
  font:
    600 14px Arial,
    sans-serif;
  margin: 0 0 12px;
}

.log-note-card p {
  font:
    13px/1.5 Arial,
    sans-serif;
  margin: 8px 0 0;
}

.log-note-drawing svg {
  display: block;
  width: 100%;
  height: auto;
}

.staff-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.staff-pages span {
  font-size: 13px;
  text-align: center;
}

@media (max-width: 600px) {
  .log-staves {
    grid-template-columns: 1fr;
  }

  .notebook {
    padding-left: 30px;
    padding-right: 8px;
  }

  .staff-pages button {
    padding: 10px 14px;
  }

  .transport-row {
    margin-top: 8px;
  }
}

/* 0.14: keep the transport beside the practice summary at every screen width. */
.practice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.practice-summary {
  flex: 1;
  min-width: 0;
}

.practice-summary .eyebrow {
  margin-top: 0;
}

.practice-summary #summaryDetail {
  margin-bottom: 0;
}

.practice-heading .transport-row {
  flex: 0 0 auto;
  margin: 0;
}

.practice-heading .transport {
  flex: none;
}

@media (max-width: 600px) {
  .practice-heading {
    gap: 12px;
  }

  .practice-summary h2 {
    line-height: 1.35;
    margin-bottom: 12px;
  }

  .practice-summary #summaryDetail {
    font-size: 14px;
  }

  .practice-heading .transport {
    width: 52px;
    height: 52px;
    padding: 10px;
  }
}

/* 0.15: more legible handwritten notebook, aligned to the yellow ruled paper. */
.notebook table {
  font-family:
    "Bradley Hand", "Segoe Print", "Chalkboard SE", "Marker Felt",
    "Comic Sans MS", cursive;
  font-size: 18px;
  line-height: 30px;
  letter-spacing: 0.1px;
}

.notebook th,
.notebook td {
  font-size: 18px;
  line-height: 30px;
  padding: 13px 12px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 29px,
    #8fb6c47a 29px,
    #8fb6c47a 30px
  );
}

.notebook th {
  font-weight: 700;
  background: #f4df8b;
  font-size: 17px;
}

/* One uninterrupted music staff: scroll horizontally rather than paginating cards. */
.log-staves {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f2f0e9 url("assets/paper.jpg");
  color: #263020;
  padding: 8px 6px 4px;
  scrollbar-color: #918b79 #e9e5d8;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.log-staves svg {
  display: block;
  max-width: none;
  height: auto;
}

.log-staves .empty-score {
  margin: 20px;
  font-size: 15px;
}

@media (max-width: 600px) {
  .notebook table {
    font-size: 17px;
  }

  .notebook th,
  .notebook td {
    font-size: 17px;
  }
}

/* v0.20 notebook — rule UNDER the lettering, not through its middle.
   Font size and handwriting family from v0.17 are preserved. */
.notebook {
  background-image: linear-gradient(
    to right,
    transparent 25px,
    #de8085 25px,
    #de8085 27px,
    transparent 27px
  );
}

.notebook th,
.notebook td {
  background-image: none;
  background-color: transparent;
  border-bottom: 1px solid #7faac5b5;
  padding: 10px 12px 14px;
  line-height: 1.65;
}

.notebook th {
  background-color: #f4df8b;
}

.log-staves {
  min-height: 210px;
}

.log-staves svg {
  flex: none;
  max-width: none;
  height: auto;
}

/* v0.21 — larger play summary and About copy; preserved typography elsewhere. */
#playPanel .practice-summary #summary {
  font-size: 31.35px;
  line-height: 1.26;
  overflow-wrap: break-word;
}

#playPanel .practice-summary #summaryDetail {
  font-size: 24px;
  line-height: 1.45;
}

#aboutPanel p {
  font-size: 20px;
  line-height: 1.6;
}

@media (max-width: 600px) {
  #playPanel .practice-summary #summary {
    font-size: 31.35px;
    line-height: 1.22;
  }

  #playPanel .practice-summary #summaryDetail {
    font-size: 21px;
    line-height: 1.45;
  }

  #playPanel .practice-heading {
    align-items: flex-start;
  }
}

/* 0.23: increase notebook lettering about 15%, including smaller mobile text.
 * Ruling remains a cell bottom border, so wrapped text cannot overlap a paper line. */
.notebook table,
.notebook td {
  font-size: 21px;
}
.notebook th {
  font-size: 20px;
}
@media (max-width: 600px) {
  .notebook table,
  .notebook th,
  .notebook td {
    font-size: 20px;
  }
}
/* Keep destructive actions visually distinct without competing with navigation. */
.log-actions {
  margin: 16px 0;
}
button.danger {
  border-color: #e7a2a2;
  color: #ffd2d2;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 0.24: expanded log and multilingual controls. Keep native text wrapping for CJK. */
.notation-review {
  display: block;
}
[data-preferences] select {
  max-width: 100%;
}
html:lang(ja) .notebook table,
html:lang(ko) .notebook table,
html:lang(zh-CN) .notebook table {
  font-family: system-ui, sans-serif;
}
[data-preferences] [role="status"] {
  min-height: 1.6em;
}

/* ============================================================================
 * v0.33.3 — MIRRORED SITE HEADER, SHARED ACROSS ALL PUBLIC PAGES
 *
 * Left: navigation toggle, then language selector. Right: game name, then icon.
 * The same composition and the same menu are used at EVERY viewport width.
 * Keeping visual DOM order avoids confusing keyboard and screen-reader users.
 *
 * Unlike prior versions, desktop navigation is not a second horizontal row.
 * All links, including Account, appear inside the one collapsible menu.
 * ============================================================================ */
.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;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: 960px;
  min-height: 76px;
  padding: 10px 20px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

/* Both controls stay together, explicitly left-aligned. */
.site-header .site-actions {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

/* Unlike v0.33.2, the icon is to the RIGHT of the app name. */
.site-header .brand {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 400;
  color: inherit;
  text-decoration: none;
}

.site-header .brand img {
  display: block;
  flex: 0 0 auto;
  width: 62px;
  height: 56px;
  object-fit: contain;
}

.site-header .brand-title {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
}

.site-header .language-quick {
  margin: 0;
  min-width: 0;
}

.site-header .language-quick select {
  display: block;
  width: 135px;
  max-width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 24px 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.site-header .language-quick select:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* The hamburger is available at ALL screen widths. */
.site-header .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.site-header .nav-toggle:focus-visible,
.site-header .language-quick select:focus-visible,
.site-header .site-navigation a:focus-visible,
.site-header .brand:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.site-header .menu-icon {
  font-size: 19px;
  line-height: 1;
}

/* The menu is a popover BELOW the controls on both desktop and mobile. */
.site-header .site-navigation {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 20px;
  right: auto;
  z-index: 20;
  width: min(370px, calc(100% - 40px));
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: #18201e;
  box-shadow: 0 12px 25px #000a;
}

.site-header .site-navigation.is-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
}

/*
 * v0.33.13 — menu organisation.
 * The first three rows contain Home/Settings, Play/Practice Log, Rules/About.
 * Account is last and spans both columns. Order in the DOM matches this grid.
 */
.site-header .site-navigation a[href="/account/"] {
  grid-column: 1 / -1;
}

.site-header .site-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.site-header .site-navigation a:hover,
.site-header .site-navigation a:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
}

.site-header .site-navigation a[aria-current="page"] {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.site-header .language-status {
  position: absolute;
  top: 100%;
  right: 12px;
  max-width: min(330px, 90vw);
  padding: 7px 10px;
  border-radius: 6px;
  background: #18211e;
  box-shadow: 0 2px 12px #0008;
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.site-header .language-status:empty {
  display: none;
}

@media (max-width: 700px) {
  .site-header {
    min-height: 66px;
    gap: 8px;
    padding: 7px 11px;
  }

  .site-header .site-actions {
    gap: 7px;
  }

  .site-header .brand {
    gap: 7px;
    font-size: clamp(15px, 4.2vw, 21px);
  }

  .site-header .brand img {
    width: 46px;
    height: 48px;
  }

  .site-header .language-quick select {
    width: 112px;
    min-height: 40px;
    font-size: 12px;
  }

  .site-header .menu-text {
    display: none;
  }

  .site-header .nav-toggle {
    padding: 8px 10px;
  }

  .site-header .site-navigation {
    left: 8px;
    width: calc(100% - 16px);
  }

  /* Preserve the existing compact vertical rhythm on secondary pages. */
  main {
    padding-top: 12px;
  }
}

@media (max-width: 350px) {
  /* Narrow phones: preserve the menu, language control and home logo first.
   * On wider phones, the name is visible on EVERY page, not only Home. */
  .site-header .brand-title {
    display: none;
  }

  .site-header .brand img {
    width: 40px;
    height: 44px;
  }

  .site-header .language-quick select {
    width: 105px;
  }

  .site-header .site-actions {
    gap: 5px;
  }

  .site-header .nav-toggle {
    padding: 8px 9px;
  }
}


/* ================================================================
 * v0.27 — iPhone practice heading and contextual post-stop navigation
 *
 * Each line remains on one line; play.js fits font sizes using actual
 * translated content, available width and current device dimensions.
 * These rules do not change desktop typography or the game score layout.
 * ================================================================ */

.post-session-actions {
  text-align: center;
  margin: 6px auto 24px;
}

/* The hidden attribute must override the ordinary <p> display rules. */
.post-session-actions[hidden] {
  display: none !important;
}

.post-session-log {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 25px;
  border-radius: 8px;
  border: 1px solid #eadbb3;
  background: #f6e6b7;
  color: #29251a;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 5px #0003;
}

.post-session-log:hover,
.post-session-log:focus-visible {
  background: #fff0c7;
  text-decoration: underline;
}

@media (max-width: 600px) {
  /* The two text lines use separate dynamic font sizes for actual fit. */
  #playPanel .practice-summary #summary,
  #playPanel .practice-summary #summaryDetail {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    max-width: 100%;
  }

  #playPanel .practice-summary #summary {
    margin-bottom: 5px;
  }

  /* Provide more space to text while retaining a touch-sized transport. */
  #playPanel .practice-heading {
    gap: 8px;
  }

  .post-session-log {
    width: min(100%, 300px);
  }
}

/* ============================================================
 * v0.30 — TEACHER'S RED HANDWRITTEN SESSION SCORE
 * Keep the annotation above (and outside) the horizontally scrolling staff.
 * It must not hide notes, move with the scroll, or affect score calculation.
 * ============================================================ */
.notation-review { position: relative; }
.teacher-grade {
  position: absolute;
  top: 10px;
  left: 14px;
  z-index: 3;
  width: clamp(108px, 18vw, 168px);
  height: auto;
  transform: rotate(-8deg);
  pointer-events: none;
}
.teacher-grade[hidden] { display: none; }
.teacher-grade svg { display: block; width: 100%; height: auto; }
.teacher-grade text {
  fill: #b52630;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 43px;
  font-weight: 700;
  letter-spacing: -1px;
}
/* Keep the score mark floating on top of the left edge of the notation.
 * This intentionally overlaps only the clef/start margin, preserving readability
 * while reducing wasted vertical space above the practice log music. */
.notation-review .log-staves { padding-top: 0; }

/* ============================================================================
 * v0.31/v0.33.3 — Landing navigation and accessible account access
 *
 * The five landing-page actions are unchanged. Account is now in the same
 * hamburger menu on desktop and mobile; no second header Account button.
 * ============================================================================ */
.home-links .home-play {
  grid-column: 1 / -1;
  font-weight: 700;
  border-color: var(--gold);
}

.home-links a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

#rulesPanel,
#privacyPanel {
  max-width: 760px;
  margin: 0 auto;
}
#rulesPanel li,
#privacyPanel p {
  font-size: 1.25rem;
  line-height: 1.65;
}
#rulesPanel li + li {
  margin-top: 0.95em;
}
#rulesPanel h2 {
  margin-top: 1.7em;
}

.usage-notice {
  max-width: 650px;
  margin: 14px auto 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.usage-notice a,
.analytics-disclosure a {
  color: #a7e4ff;
}

/* v0.31: compact, keyboard-accessible privacy link in shared footer. */
footer a { color: #b8dff1; text-underline-offset: 3px; }
footer a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ================================================================
 * v0.33 — optional unobtrusive landing streak and achievement toast.
 * No changes to the staff/transport/mobile musical layout.
 * ================================================================ */
.home-streak { display: block; margin: 14px 0 2px; padding: 9px 12px;
  border: 1px solid #bda777; background: rgba(15,26,26,.74);
  color: #f3e0ae; text-align: center; text-decoration: none; border-radius: 5px; }
.home-streak[hidden], .achievement-toast[hidden] { display: none !important; }
.achievement-toast { color: #e8d49c; text-align: center; padding: 10px 13px;
  border: 1px solid #bda777; background: #162a29;
  border-radius: 6px; margin: 10px 0; }

/* ========================================================================
 * v0.33.7 — Optional Facebook scorecard sharing controls
 *
 * The public link appears only after the owner has explicitly published a
 * selected scorecard. The direct Facebook anchor looks like the adjacent
 * action buttons, but retains its native, keyboard-accessible link semantics.
 * ======================================================================== */
/* ========================================================================
 * v0.33.12 — Compact public scorecard management
 *
 * <details> hides secondary URL/caption/revocation tools until requested.
 * The principal Share on Facebook button above remains the primary action.
 * We deliberately keep the ability to revoke a live public link.
 * ======================================================================== */
.scorecard-public-link {
  margin-top: 10px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.75);
}

.scorecard-public-link[hidden] {
  display: none !important;
}

.scorecard-public-link > summary {
  display: list-item;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f6f5ee;
  cursor: pointer;
}

.scorecard-public-link > summary:hover {
  background: rgba(255, 255, 255, 0.07);
}

.scorecard-public-link > summary:focus-visible {
  outline: 3px solid #a8d9ff;
  outline-offset: 3px;
}

/* Only the expandable content receives normal in-panel spacing. */
.scorecard-public-link > .scorecard-public-link-body {
  padding: 2px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.scorecard-public-link .actions {
  align-items: center;
}

.scorecard-public-link a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 12px 18px;
  min-height: 44px;
  border: 1px solid #747767;
  border-radius: 7px;
  color: #edeccf;
  text-decoration: none;
  font: 600 14px system-ui, sans-serif;
}

.scorecard-public-link a.secondary:hover,
.scorecard-public-link a.secondary:focus-visible {
  border-color: var(--gold);
  text-decoration: underline;
}


/* ================================================================
 * v0.33.8 — Facebook scorecard caption editor.
 *
 * The player can revise/copy suggested wording before posting. Facebook
 * deliberately receives only the share URL, never an app-written message.
 * The field is full-width and wraps on the smallest screens.
 * ================================================================ */
.scorecard-caption-controls {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}
.scorecard-caption-controls label {
  font-weight: 700;
}
.scorecard-caption-controls textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 6rem;
  padding: 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid #b9a887;
  background: #faf3df;
  color: #25382d;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}
.scorecard-caption-controls button {
  justify-self: start;
}

/*
 * MOBILE SAFARI BACKGROUND FALLBACK
 *
 * iOS browsers may not honour `background-attachment: fixed` on the body.
 * Keep the composition anchored to the bottom on narrow viewports while
 * allowing the image to scroll normally if the browser requires it.
 * The gradient and image brightness remain the same as on desktop.
 */
@media (max-width: 767px) {
  body {
    background-attachment: scroll;
    background-position: center top, center bottom;
  }
}

/* v0.33.14 — small navigation route to the venue collection. */
.venue-settings-link {
  margin-top: 20px;
}
.venue-settings-link p {
  margin: 8px 0 14px;
}
a.venue-choose-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
}
.venue-account-link a {
  display: inline-flex;
  padding: 9px 15px;
  border: 1px solid #bda777;
  border-radius: 7px;
  color: #fff;
  background: rgba(12, 28, 31, .72);
  text-decoration: none;
}
.venue-account-link a:hover,
.venue-account-link a:focus-visible,
a.venue-choose-link:focus-visible {
  outline: 2px solid #aad7ed;
  outline-offset: 2px;
}


/* v0.33.14.4 — use the optimised mobile practice-room background on narrower screens. */
@media (max-width: 900px) {
  body {
    background:
      linear-gradient(rgba(0, 0, 0, 1.00), rgba(0, 0, 0, 0.00)),
      url("/assets/venues/optimized/practiceRoom-mobile.webp") center bottom / cover no-repeat fixed;
  }
}


/* ============================================================================
 * v0.33.14.6 — Practice Log Facebook sharing confirmation
 *
 * The browser's native <dialog> is in the top layer. This avoids clipping by
 * the venue background and navigation; it is keyboard and screen-reader aware.
 * Scoping prevents accidental effects on Account or other forms.
 * ============================================================================ */
.facebook-share-dialog {
  box-sizing: border-box;
  width: min(94vw, 550px);
  max-height: min(88dvh, 750px);
  overflow: auto;
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 12px;
  background: #13232a;
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.75);
  color: #fff;
}

.facebook-share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.facebook-share-dialog h2 {
  margin: 0 0 14px;
  color: #fff;
}

.facebook-share-dialog #facebookShareStatus {
  padding: 10px 12px;
  border-left: 3px solid #b5d6b5;
  background: rgba(0, 0, 0, 0.3);
  line-height: 1.5;
}

.facebook-share-dialog label,
.facebook-share-dialog textarea {
  display: block;
  width: 100%;
}

.facebook-share-dialog textarea {
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px;
  min-height: 118px;
  resize: vertical;
  background: #f7f7f3;
  color: #1a2428;
  border: 1px solid #8b9ca4;
  border-radius: 6px;
  font: inherit;
}

.facebook-share-dialog .facebook-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.facebook-share-dialog .facebook-share-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #87959a;
  border-radius: 7px;
  background: #225778;
  color: #fff;
  text-decoration: none;
}

.facebook-share-dialog .facebook-share-actions button {
  min-height: 44px;
}

.facebook-share-dialog__preview {
  margin: 14px 0 18px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(8, 14, 18, 0.55);
  text-align: center;
}
.facebook-share-dialog__preview[hidden] { display: none !important; }
.facebook-share-dialog__preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #172a33;
}
.facebook-share-dialog__preview figcaption {
  margin-top: 8px;
  color: #d4d0c6;
  font-size: .83rem;
}

.facebook-share-dialog :is(a, button, textarea):focus-visible {
  outline: 3px solid #bde6ff;
  outline-offset: 2px;
}


/*
 * v0.33.14.13 — Homepage reverts to the ordinary shared header styling.
 * On exceptionally narrow screens, keep the established requirement that
 * Home shows the application name even when the target icon has no room.
 */
@media (max-width: 350px) {
  .landing-page .site-header .brand-title {
    display: inline-block;
  }

  .landing-page .site-header .brand img {
    display: none;
  }
}

/* ========================================================================
 * 0.34.1 — typography, paper, transport and install controls.
 * Keep musical glyphs, handwritten markings and mechanical score digits in
 * their original fonts. No changes to notation dimensions or game timing.
 * ======================================================================== */
body, button, input, select, textarea, #cue, .site-header, .score-label {
  font-family: "Source Sans 3", system-ui, Arial, sans-serif;
}
body { font-weight: 400; }
h1, h2, h3, h4, .brand, .site-header .brand, .site-header .brand-title {
  font-family: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 600;
}
/* A single large, low-contrast field avoids the former visible tile grid. */
.staff, .log-note-card, .log-staves {
  background-color: #f4f2eb;
  background-image: url('/assets/music-paper.webp');
  background-size: cover;
  background-repeat: no-repeat;
}
/* Match the warm ivory/gold scoreboard while retaining red as the Stop cue. */
button.transport:not(.is-playing) {
  background: linear-gradient(#f9eed1, #b9a16c);
  border-color: #e7dec2;
  color: #252522;
  box-shadow: 0 3px 0 #746347, 0 5px 12px #0008;
}
button.transport:focus-visible, .pg-install-button:focus-visible, .pg-home-install:focus-visible {
  outline: 2px solid #f9eed1;
  outline-offset: 4px;
}
.site-header .site-navigation .pg-install-button {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 44px;
  border: 1px solid #b9a16c;
  border-radius: 5px;
  background: #252522;
  color: #f9eed1;
  text-align: left;
  padding: 9px 11px;
}
.pg-home-install { display: block; margin: 16px auto 0; background: #e7dec2; color: #252522; }
.pg-home-install[hidden], .pg-install-button[hidden] { display: none; }
.pg-install-dialog {
  width: min(92vw, 480px); max-height: 85vh; overflow: auto;
  padding: 24px; background: #18201e; color: #f9eed1;
  border: 1px solid #b9a16c; border-radius: 12px;
}
.pg-install-dialog::backdrop { background: #000a; }
.pg-install-dialog button { background: #e7dec2; color: #252522; }
/* Override the more-specific historic landing headings and text treatments. */
.landing h1, #aboutPanel h1, .log-note-card h3 {
  font-family: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 600;
}
.log-note-card p, .scorecard-public-link a.secondary {
  font-family: "Source Sans 3", system-ui, Arial, sans-serif;
}

/* v0.34.2 — voluntary support. Use existing warm counter-gold palette;
   never overlay the notation, block practice or change transport dimensions. */
.pg-support-home,
.pg-support-panel,
.pg-support-invitation {
  color: #f7f6ee;
  background: #202725;
  border: 1px solid #a99b7b;
  border-radius: 12px;
  padding: clamp(14px, 3vw, 26px);
  text-align: center;
  overflow-wrap: anywhere;
}
.pg-support-home { max-width: 600px; margin: 28px auto 16px; }
.pg-support-panel { max-width: 650px; margin: 30px auto; }
.pg-support-page main { padding-inline: 16px; }
.pg-support-invitation { margin: 14px 0 0; width: 100%; }
.pg-support-home h2, .pg-support-invitation h2 { font-size: 1.35rem; }
.pg-support-panel h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.pg-support-home h2, .pg-support-panel h1, .pg-support-invitation h2 { color: #e7dec2; margin: 0 0 12px; }
.pg-support-kicker, .pg-support-small { color: #c8c8bd; font-size: .95rem; }
.pg-support-amounts { padding: 14px 0; border-block: 1px solid #56594e; }
a.pg-support-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 7px;
  color: #252522;
  background: #e7dec2;
  border: 1px solid #b9a16c;
  text-decoration: none;
  font-weight: 600;
  white-space: normal;
}
a.pg-support-button:hover { background: #f9eed1; }
a.pg-support-button:focus-visible, .pg-support-dismissals button:focus-visible { outline: 2px solid #f9eed1; outline-offset: 3px; }
.pg-support-dismissals { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.pg-support-dismissals button { background: transparent; border: 1px solid #a99b7b; color: #e7dec2; border-radius: 6px; padding: 8px 12px; min-height: 44px; font: inherit; cursor: pointer; }
.pg-support-preference { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
.pg-support-preference input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: #e7dec2; }
.pg-support-panel hr { border: 0; border-top: 1px solid #56594e; margin: 22px 0; }
.site-header .site-navigation a[href="/support/"] { color: #e7dec2; }

/* Optional private recognition is not a musical trophy or a public share card. */
#pg-supporter-badge[hidden], #pg-supporter-control[hidden] { display: none !important; }
#pg-supporter-badge { border: 1px solid #b9a16c; padding: 14px; margin: 12px 0; }
#pg-supporter-badge h3 { color: #e7dec2; margin: 0 0 6px; }
#pg-supporter-control { margin: 12px 0; }
