@font-face {
  font-family: Exhibit;
  src: local("Noto Sans Arabic"), local("Tahoma");
  font-display: swap;
}
:root {
  --ink: #20252d;
  --muted: #69717c;
  --wine: #751c3a;
  --rose: #f5eaf0;
  --gold: #bc8d3e;
  --line: #e6e8ec;
  --paper: #f7f8fa;
  --good: #19765c;
  --radius: 24px;
  font-family: Exhibit, Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  border-radius: 14px;
  background: var(--wine);
  color: #fff;
  padding: 14px 23px;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
}
button:hover {
  filter: brightness(1.08);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
a {
  color: var(--wine);
  text-decoration: none;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid #ced3da;
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--ink);
  min-height: 48px;
}
textarea {
  resize: vertical;
  min-height: 130px;
}
label {
  display: block;
  font-weight: 600;
  margin: 20px 0 10px;
}
label input,
label textarea,
label select {
  margin-top: 9px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.4;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
h2 {
  font-size: 1.65rem;
  line-height: 1.5;
}
h3 {
  font-size: 1.2rem;
}
p {
  line-height: 1.9;
  color: var(--muted);
}
small {
  font-size: 0.875rem;
  color: var(--muted);
}
.shell {
  max-width: 1250px;
  margin: auto;
  padding: 0 32px;
}
.topbar {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
}
.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--wine);
  color: #fff;
  font-size: 1.4rem;
}
.brand b {
  display: block;
  font-size: 1.05rem;
}
.brand small {
  font-size: 0.75rem;
  letter-spacing: 2px;
}
.nav-actions,
.actions,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}
.quiet {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}
.danger {
  background: #fff1f1;
  color: #a72836;
}
.success {
  color: var(--good);
}
.eyebrow {
  color: var(--wine);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 20px;
}
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 60px;
  padding: 65px 0 45px;
  align-items: center;
}
.hero p {
  max-width: 620px;
}
.hero-art {
  height: 240px;
  position: relative;
  border-radius: 32px;
  background: var(--wine);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-art:before,
.hero-art:after {
  content: "";
  position: absolute;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  width: 260px;
  height: 260px;
  transform: translate(90px, -80px);
}
.hero-art:after {
  transform: translate(-100px, 100px);
}
.hero-symbol {
  color: white;
  font-size: 7rem;
  line-height: 1;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 30px;
  background: var(--rose);
  color: var(--wine);
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 700;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.experience {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 275px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  color: var(--ink);
}
.experience:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px #1725310a;
}
.icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
  background: var(--rose);
  color: var(--wine);
}
.experience:nth-child(2) .icon {
  background: #e6f2ef;
  color: #26705e;
}
.experience:nth-child(3) .icon {
  background: #eef0fb;
  color: #515dac;
}
.experience:nth-child(4) .icon {
  background: #fff2d9;
  color: #8c6526;
}
.experience p {
  font-size: 0.94rem;
  margin-bottom: 20px;
}
.experience .link-label {
  margin-top: auto;
  font-weight: 700;
  color: var(--wine);
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 35px 0;
  margin-top: 35px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.notice {
  border: 1px solid #e7d4a8;
  background: #fff9eb;
  color: #705318;
  border-radius: 14px;
  padding: 12px 18px;
  line-height: 1.8;
  font-size: 0.9rem;
  margin: 22px 0;
}
.narrow {
  max-width: 660px;
  margin: 44px auto;
  padding: 0 20px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: 0 10px 30px #1d233105;
}
.panel-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 26px;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.9;
  font-weight: 400;
}
.check input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 5px;
  flex-shrink: 0;
  accent-color: var(--wine);
}
.full {
  width: 100%;
}
.counter {
  text-align: end;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}
.error {
  color: #a72836;
  line-height: 1.8;
  min-height: 24px;
}
.hint {
  font-size: 0.9rem;
}
.center {
  text-align: center;
}
.success-mark {
  margin: 12px auto 24px;
  width: 80px;
  height: 80px;
  background: #e7f5ed;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--good);
  font-size: 2.5rem;
}
.loading {
  padding: 100px 25px;
  text-align: center;
}
.kiosk {
  max-width: 1050px;
  margin: 36px auto;
  padding-bottom: 30px;
}
.kiosk-start {
  padding: 60px 35px;
  text-align: center;
}
.kiosk-start .icon {
  margin: 0 auto 25px;
  width: 85px;
  height: 85px;
  font-size: 2.5rem;
}
.kiosk-start p {
  max-width: 560px;
  margin: 0 auto 28px;
}
.kiosk-start button {
  font-size: 1.4rem;
  min-width: 260px;
  padding: 20px 35px;
}
.stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 26px 0;
}
.stats span {
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
}
.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.progress {
  height: 7px;
  border-radius: 10px;
  background: #edeff3;
  overflow: hidden;
  margin-bottom: 35px;
}
.progress div {
  height: 100%;
  background: var(--wine);
  transition: width 0.3s;
}
.question {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.7;
  margin: 20px 0 30px;
}
.options {
  display: grid;
  gap: 14px;
}
.option {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: start;
  background: white;
  border: 2px solid var(--line);
  color: var(--ink);
  padding: 20px;
  font-size: 1.2rem;
  min-height: 80px;
}
.option span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 1rem;
}
.option.correct {
  border-color: #268164;
  background: #eaf8f1;
  opacity: 1;
}
.option.wrong {
  border-color: #b34c58;
  background: #fff0f0;
  opacity: 1;
}
.explanation {
  padding: 24px;
  border-radius: 16px;
  background: #f0f6f4;
  margin-top: 25px;
}
.explanation p {
  color: var(--ink);
}
.score {
  font-size: 6rem;
  color: var(--wine);
  font-weight: 700;
  line-height: 1.3;
}
.score small {
  font-size: 2rem;
}
.idle-warning {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  z-index: 20;
  background: #252a33;
  color: white;
  border-radius: 30px;
  box-shadow: 0 5px 20px #0002;
  text-align: center;
}
.wall {
  min-height: 100vh;
  background: #891739;
  color: #fff;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 45px;
  position: relative;
  overflow: hidden;
}
.wall:before {
  content: "";
  position: absolute;
  border: 1px solid #ffffff17;
  border-radius: 50%;
  width: 650px;
  height: 650px;
  left: -280px;
  top: -350px;
  pointer-events: none;
}
.wall-main {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}
.wall-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.wall .eyebrow {
  color: #e7bdbb;
}
.wall .quiet {
  color: white;
}
.wall-message {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}
.wall-message blockquote {
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  line-height: 1.7;
  text-align: center;
  margin: 20px 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.wall-bottom {
  color: #dec8d1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.wall-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 25px;
}
.qr-card {
  background: white;
  color: var(--ink);
  padding: 27px;
  border-radius: 28px;
  text-align: center;
}
.qr-card h2 {
  margin-bottom: 12px;
}
.qr-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}
#qr {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  margin: 20px 0;
}
#qr img {
  max-width: 100%;
  height: auto;
}
.wall-aside .notice {
  background: #ffffff10;
  color: #f1d7df;
  border-color: #ffffff20;
}
.wall-aside small {
  color: #d5b9c4;
}
.recorder {
  text-align: center;
  padding: 25px 0;
}
.mic {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--wine);
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  margin: 0 auto 20px;
}
.mic.recording {
  animation: pulse 1.2s infinite;
  background: #a31c45;
  color: white;
}
.time {
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 15px;
}
.audio-preview {
  width: 100%;
  margin: 20px 0;
}
audio {
  max-width: 100%;
}
.private-note {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f0f3f9;
  padding: 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #505d74;
}
.puzzle-area {
  padding: 30px 0;
}
.slots,
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: center;
  min-height: 115px;
  padding: 20px;
  border-radius: 20px;
}
.slots {
  background: #f5f6fa;
  border: 2px dashed #cbd0da;
  margin-bottom: 28px;
}
.slots:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.tile {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  padding: 20px 25px;
  color: #34343d;
  background: #f9dfb1;
  box-shadow: 0 4px 0 #00000012;
  user-select: none;
  touch-action: none;
  border: 2px solid transparent;
  min-height: 75px;
}
.tile[data-color="1"] {
  background: #d9e9f7;
}
.tile[data-color="2"] {
  background: #e7def7;
}
.tile[data-color="3"] {
  background: #d6eee5;
}
.tile[data-color="4"] {
  background: #f6dce5;
}
.tile.dragging {
  opacity: 0.5;
  border-color: var(--wine);
}
.puzzle-feedback {
  text-align: center;
  min-height: 50px;
  font-size: 1.3rem;
  font-weight: 700;
}
.admin {
  padding: 35px 0;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}
.stat strong {
  font-size: 2rem;
  display: block;
  color: var(--wine);
}
.tabs {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding: 12px 0;
  margin-bottom: 20px;
}
.tabs button {
  white-space: nowrap;
  background: white;
  color: var(--muted);
  border: 1px solid var(--line);
}
.tabs button.active {
  background: var(--wine);
  color: white;
}
.record-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.record-card p {
  white-space: pre-wrap;
  color: var(--ink);
}
.record-card .row {
  justify-content: space-between;
}
.record-card small {
  direction: ltr;
  display: inline-block;
}
.badge {
  border-radius: 20px;
  background: var(--paper);
  padding: 5px 12px;
  font-size: 0.8rem;
}
.record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.record-actions button,
.record-actions a {
  font-size: 0.875rem;
  min-height: 40px;
  padding: 10px 14px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.editor-grid > div {
  min-width: 0;
}
details {
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  margin: 12px 0;
  padding: 18px;
}
summary {
  font-weight: 700;
  cursor: pointer;
  line-height: 1.7;
}
details textarea {
  min-height: 85px;
}
.sticky-save {
  position: sticky;
  bottom: 0;
  background: #ffffffed;
  backdrop-filter: blur(8px);
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #20252d;
  color: white;
  border-radius: 14px;
  padding: 14px 24px;
  z-index: 100;
  display: none;
  max-width: 90vw;
  box-shadow: 0 8px 25px #0002;
}
.page-error {
  max-width: 650px;
  margin: 80px auto;
  padding: 25px;
}
.wordmark {
  font-family: Arial, sans-serif;
  letter-spacing: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.help-link {
  font-size: 0.9rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 14px #a31c4515;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (min-width: 1500px) {
  .kiosk {
    max-width: 1200px;
  }
  .kiosk .panel {
    padding: 50px;
  }
  .option {
    min-height: 100px;
    font-size: 1.6rem;
  }
  .kiosk-start {
    padding: 100px 40px;
  }
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    gap: 25px;
  }
  .hero-art {
    height: 200px;
  }
  .wall {
    grid-template-columns: 1fr 230px;
    padding: 25px;
    gap: 25px;
  }
  #qr {
    min-height: 170px;
  }
  .qr-card {
    padding: 18px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .shell {
    padding: 0 18px;
  }
  .topbar {
    min-height: 85px;
  }
  .brand small {
    font-size: 0.65rem;
  }
  .brand-icon {
    width: 34px;
    height: 34px;
  }
  .topbar .ghost {
    padding: 9px 12px;
  }
  .hero {
    display: block;
    padding: 35px 0 25px;
  }
  .hero-art {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .experience {
    min-height: 210px;
  }
  .experience .icon {
    margin-bottom: 17px;
  }
  .panel {
    padding: 24px;
  }
  .narrow {
    padding: 0;
    margin: 25px auto;
  }
  .kiosk {
    margin-top: 25px;
  }
  .kiosk-start {
    padding: 35px 20px;
  }
  .kiosk-start button {
    min-width: 0;
    width: 100%;
  }
  .wall {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .wall-message {
    min-height: 260px;
  }
  .wall-aside {
    max-width: 300px;
    margin: auto;
  }
  .wall-bottom {
    font-size: 0.85rem;
  }
  .admin-stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat span {
    font-size: 0.8rem;
  }
  .tile {
    padding: 16px;
    font-size: 1.35rem;
  }
  .slots,
  .tiles {
    gap: 10px;
    padding: 15px;
  }
  .option {
    font-size: 1.1rem;
    padding: 15px;
  }
  .footer {
    font-size: 0.8rem;
  }
  .sticky-save {
    flex-wrap: wrap;
  }
  .nav-actions {
    gap: 4px;
  }
}
.tile:disabled {
  opacity: 1;
}
.counter {
  direction: ltr;
}

/* Twenty-five equally sized messages, filled right-to-left across five rows. */
.wall-stream {
  height: 100vh;
  height: 100dvh;
  min-height: 640px;
  padding: clamp(18px, 2vw, 38px);
  gap: 18px 26px;
  direction: rtl;
  grid-template-columns: minmax(0, 1fr) clamp(210px, 17vw, 290px);
  grid-template-rows: auto minmax(0, 1fr);
}
.wall-stream .wall-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, 4fr) minmax(130px, 1fr);
  gap: 18px;
  min-width: 0;
}
.wall-head h1 {
  margin: 0;
  font-size: clamp(25px, 2.4vw, 46px);
  line-height: 1.5;
  text-align: center;
  color: white;
}
.wall-brand-logo { display: block; width: clamp(130px, 11vw, 210px); height: auto; max-width: 100%; }
.wall-head .quiet { justify-self: end; }
.wall-stream .wall-main { min-height: 0; gap: 12px; grid-column: 1; grid-row: 2; }
.wall-stream .wall-aside { grid-column: 2; grid-row: 2; min-width: 0; }
.wall-board {
  flex: 1;
  min-height: 0;
  display: grid;
  direction: rtl;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 0.85vw, 16px);
}
.wall-board[hidden], .wall-welcome[hidden] { display: none; }
.wall-slot { min-width: 0; min-height: 0; transform-origin: center; }
.wall-tweet {
  height: 100%; min-width: 0;
  padding: clamp(8px, 0.85vw, 16px);
  border: 1px solid #ffffff70;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff10, #47051c38);
  color: white;
  box-shadow: inset 0 1px 5px #ffffff17, 0 4px 12px #37091a25;
  display: flex; flex-direction: column; overflow: hidden;
}
.wall-slot.is-latest .wall-tweet { border-color: #ffffffbd; }
.tweet-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }
.tweet-avatar { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; color: white; }
.tweet-avatar svg { width: 85%; height: 85%; display: block; }
.tweet-author { min-width: 0; flex: 1; }
.tweet-name { display: block; font-size: clamp(12px, 0.95vw, 18px); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tweet-text { color: inherit; font-size: 20px; line-height: 1.4; margin: 8px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; overflow: hidden; flex: 0 0 auto; }
.tweet-time { display: block; flex-shrink: 0; margin-top: auto; padding-top: 6px; font-size: clamp(9px, 0.65vw, 12px); line-height: 1.4; color: #f1dce4; }
.wall-stream .wall-bottom { flex: 0 0 auto; font-size: 12px; gap: 12px; }
.wall-welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.wall-welcome h2 { font-size: clamp(32px, 4vw, 68px); color: white; }
.wall-welcome p { color: #efd7e1; font-size: 24px; }
.wall-explainer { color: #efd7e1; text-align: center; font-size: 14px; line-height: 1.9; }
.wall-stream .qr-card { padding: 20px; }
.wall-stream .qr-card h2 { font-size: clamp(20px, 1.5vw, 28px); }
.wall-stream #qr { min-height: 0; }
.wall-stream #qr img, .wall-stream #qr canvas { max-width: 100%; height: auto; }
@media (max-height: 850px) {
  .wall-stream { gap: 12px 18px; }
  .wall-brand-logo { width: 140px; }
  .wall-head h1 { font-size: 28px; }
  .wall-tweet { border-radius: 12px; padding: 8px; }
  .tweet-avatar { width: 18px; height: 18px; }
  .tweet-text { margin-top: 5px; }
  .tweet-time { font-size: 9px; padding-top: 3px; }
}
/* Keep the exhibition's 5x5 layout on small preview screens too. */
@media (max-width: 950px) {
  body:has(.wall-stream) { overflow-x: auto; }
  .wall-stream { min-width: 1100px; }
}
