:root {
  --ink: #24150c;
  --ink-soft: #5b3a22;
  --parchment: #f4e3b9;
  --parchment-light: #fff2cc;
  --wood: #43260f;
  --wood-dark: #211207;
  --brass: #d69b22;
  --brass-light: #ffd45b;
  --crimson: #9f2816;
  --green: #2f6d32;
  --green-light: #78a345;
  --blue: #1763a8;
  --cream: #fff4cf;
  --shadow: rgba(18, 8, 2, 0.48);
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: Consolas, "Courier New", monospace;
  --text-xs: 10px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 18px;
  --text-xl: 24px;
  font-family: var(--font-ui);
}

/* Desktop reference lock: keep live content aligned to the raster UI plate. */
@media (min-width: 901px) {
  .view-button {
    color: transparent;
    text-shadow: none;
  }

  .view-button:hover,
  .view-button.active {
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 220, 89, 0.42);
  }

  .profile-portrait img {
    opacity: 0;
  }

  .leaderboard h2 {
    color: transparent;
    text-shadow: none;
  }

  .leaderboard-tabs {
    display: none;
  }

  .leader-list {
    grid-template-rows: repeat(5, 1fr);
    gap: 0;
    height: 520px;
    padding: 0 11px;
  }

  .leader-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 32px 7px 112px;
    border: 0;
    background: transparent;
  }

  .leader-rank,
  .leader-avatar {
    display: none;
  }

  .leader-copy strong {
    font-family: var(--font-display);
    font-size: 15px;
  }

  .leader-copy .leader-role {
    font-size: var(--text-xs);
  }

  .leader-copy .leader-points {
    font-size: 13px;
  }
}

@media (min-width: 901px) {
  .view-button,
  .summary-card span,
  .reward-title,
  .board-column h1,
  .leaderboard h2,
  .quick-add-panel h2,
  .task-title-button,
  .task-update-button,
  .quick-add-form button,
  .leader-copy strong {
    font-family: var(--font-display);
  }

  .view-switch {
    top: 91px;
    left: 59px;
    width: 230px;
    gap: 7px;
  }

  .view-button {
    height: 44px;
    font-size: var(--text-lg);
  }

  .profile-portrait {
    top: 198px;
    left: 113px;
    width: 121px;
    height: 118px;
  }

  .summary-card {
    left: 119px;
    width: 143px;
    height: 78px;
  }

  .summary-card span {
    font-size: var(--text-lg);
  }

  .summary-card strong {
    font-size: 27px;
  }

  .reward-summary {
    top: 601px;
    left: 96px;
    width: 174px;
  }

  .reward-title {
    margin-bottom: 7px;
    font-size: 16px;
  }

  .reward-summary p {
    margin: 6px 0;
    font-size: var(--text-md);
  }

  .task-board {
    top: 185px;
    height: 574px;
  }

  .board-column {
    padding: 69px 18px 18px;
  }

  .board-column h1 {
    width: 272px;
    padding: 9px 12px 10px;
    font-size: var(--text-xl);
  }

  .task-stack {
    height: 458px;
    gap: 11px;
  }

  .task-card {
    padding: 10px 13px 9px 18px;
  }

  .task-status-label,
  .priority-label {
    font-size: var(--text-xs);
  }

  .task-points {
    font-size: var(--text-sm);
  }

  .task-title-button {
    font-size: var(--text-lg);
  }

  .task-date,
  .task-owner {
    font-size: var(--text-sm);
  }

  .task-update-button {
    min-width: 78px;
    min-height: 31px;
    font-size: 13px;
  }

  .leaderboard {
    top: 149px;
    left: 1225px;
    width: 284px;
  }

  .leaderboard h2 {
    height: 70px;
    padding-top: 24px;
    font-size: var(--text-xl);
  }

  .leaderboard-tabs {
    display: none;
  }

  .leader-list {
    height: 520px;
    gap: 0;
    padding: 0 11px;
  }

  .leader-row {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 9px 36px 7px 109px;
    border: 0;
    background: transparent;
  }

  .leader-rank,
  .leader-avatar {
    display: none;
  }

  .leader-copy strong {
    font-size: 15px;
  }

  .leader-copy .leader-role {
    font-size: var(--text-xs);
  }

  .leader-copy .leader-points {
    font-size: 13px;
  }

  .quick-add-panel h2 {
    font-size: var(--text-xl);
  }

  .quick-add-form input,
  .quick-add-form select,
  .quick-add-form button {
    font-family: var(--font-ui);
    font-size: var(--text-md);
  }

  .quick-add-form button {
    font-family: var(--font-display);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: #140c06;
  overflow: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #57b9ff;
  outline-offset: 2px;
}

.scene-shell {
  position: relative;
  width: 1536px;
  height: 1024px;
  margin: 0 auto;
  overflow: hidden;
  background: #35200e url("/assets/mrt-noticeboard-backdrop.png?v=20260810-reference") center / 1536px 1024px no-repeat;
  image-rendering: pixelated;
}

.manager-panel,
.task-board,
.leaderboard,
.quick-add-panel {
  position: absolute;
}

.manager-panel {
  inset: 0 auto auto 0;
  width: 320px;
  height: 800px;
}

.view-switch {
  position: absolute;
  top: 92px;
  left: 61px;
  display: grid;
  width: 226px;
  gap: 8px;
}

.view-button {
  width: 100%;
  height: 44px;
  padding: 0 8px;
  border: 0;
  color: #efe0ad;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #173a21;
}

.view-button:hover,
.view-button.active {
  color: #fffbd6;
  text-shadow: 2px 2px 0 #173a21, 0 0 8px rgba(255, 220, 89, 0.55);
}

.profile-portrait {
  position: absolute;
  top: 196px;
  left: 114px;
  width: 120px;
  height: 119px;
  padding: 4px;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.profile-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scale(1.25);
  transform-origin: center 55%;
}

.avatar-picker {
  position: absolute;
  z-index: 4;
  top: 205px;
  left: 238px;
  gap: 6px;
  padding: 6px;
  border: 3px solid #261206;
  background: #ead7a3;
  box-shadow: 4px 5px 0 var(--shadow);
}

.avatar-picker:not([hidden]) {
  display: grid;
}

.avatar-picker button {
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 2px solid #8d5a19;
  background: #1b5390;
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.summary-card {
  position: absolute;
  left: 77px;
  display: grid;
  width: 196px;
  height: 78px;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: #f7e6bc;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #160b05;
}

.summary-card span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 900;
}

.summary-card strong {
  font-size: 28px;
  line-height: 1;
}

.summary-pending {
  top: 327px;
  color: #ffd453;
}

.summary-overdue {
  top: 419px;
  color: #ff8d61;
}

.summary-completed {
  top: 510px;
  color: #b7e89f;
}

.reward-summary {
  position: absolute;
  top: 610px;
  left: 78px;
  width: 198px;
  color: #f4d58a;
  text-align: center;
  text-shadow: 2px 2px 0 #150904;
}

.reward-title {
  display: block;
  margin-bottom: 9px;
  color: #ffe7a3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-summary p {
  margin: 7px 0;
  font-size: 14px;
  text-transform: uppercase;
}

.reward-summary strong {
  color: #ffd24c;
  font-size: 19px;
}

.task-board {
  top: 174px;
  left: 367px;
  display: grid;
  grid-template-columns: 384px 384px;
  gap: 24px;
  width: 792px;
  height: 590px;
}

.board-column {
  position: relative;
  min-width: 0;
  padding: 72px 18px 18px;
}

.board-column h1 {
  position: absolute;
  top: 0;
  left: 50%;
  width: 260px;
  margin: 0;
  padding: 10px 12px;
  transform: translateX(-50%);
  border: 3px solid #4a2509;
  color: #2a1609;
  background: #e6a72e;
  box-shadow: inset 0 0 0 3px #f8cc55, 0 5px 0 rgba(63, 27, 5, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #ffe8a0;
}

.board-overdue h1 {
  color: #fff0d6;
  background: #a9311e;
  box-shadow: inset 0 0 0 3px #da5737, 0 5px 0 rgba(63, 27, 5, 0.72);
  text-shadow: 2px 2px 0 #5d170e;
}

.task-stack {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  height: 490px;
}

.task-card {
  display: grid;
  grid-template-rows: auto auto auto auto;
  min-height: 0;
  padding: 12px 14px 10px 18px;
  border: 2px solid #9a7040;
  border-left: 8px solid #d49a28;
  border-radius: 2px;
  background: rgba(255, 243, 208, 0.84);
  box-shadow: 3px 4px 0 rgba(78, 43, 16, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.board-overdue .task-card {
  border-left-color: #aa311d;
}

.task-card.is-sample {
  border-style: dashed;
  filter: saturate(0.82);
}

.task-card.is-sample .task-status-label {
  color: #855c2e;
}

.task-card-topline,
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-status-label,
.priority-label {
  color: #76502d;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-points {
  color: #2f7534;
  font-size: 13px;
  font-weight: 900;
}

.task-title-button {
  min-width: 0;
  padding: 3px 0;
  overflow: hidden;
  border: 0;
  color: #2a180e;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.12;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-button:hover {
  color: #8f2b18;
  text-decoration: underline;
}

.task-date,
.task-owner {
  margin: 2px 0 0;
  overflow: hidden;
  color: #5a3c23;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-update-button {
  min-width: 78px;
  min-height: 32px;
  padding: 4px 10px;
  border: 3px solid #4b2509;
  border-radius: 2px;
  color: #261307;
  background: #e9a52a;
  box-shadow: inset 0 0 0 2px #ffc953, 2px 3px 0 rgba(61, 27, 8, 0.45);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 900;
}

.board-overdue .task-update-button {
  color: #fff0da;
  background: #a93420;
  box-shadow: inset 0 0 0 2px #dc5f3f, 2px 3px 0 rgba(61, 27, 8, 0.45);
}

.task-update-button:hover {
  filter: brightness(1.12);
}

.empty-board-message {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 24px;
  color: #735234;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-align: center;
}

.leaderboard {
  top: 149px;
  left: 1226px;
  width: 283px;
  height: 610px;
}

.leaderboard h2 {
  height: 68px;
  margin: 0;
  padding: 23px 4px 0;
  color: #f1ddaa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #173c27;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
  height: 29px;
}

.leaderboard-tabs button {
  height: 24px;
  padding: 2px 10px;
  border: 1px solid #8b6322;
  border-radius: 2px;
  color: #c7b27e;
  background: rgba(27, 15, 7, 0.72);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-tabs button.active,
.leaderboard-tabs button:hover {
  color: #241407;
  background: #dfb344;
}

.leader-list {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 9px;
  height: 500px;
  padding: 0 12px;
}

.leader-row {
  display: grid;
  grid-template-columns: 30px 59px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 6px 5px 2px;
  border-bottom: 1px solid rgba(216, 160, 48, 0.32);
  color: #f4e5c4;
  background: rgba(31, 17, 7, 0.2);
}

.leader-rank {
  color: #f0bd45;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 900;
  text-align: center;
  text-shadow: 2px 2px 0 #1e0e05;
}

.leader-avatar {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 2px solid #9c6e1c;
  background: #164f84;
  box-shadow: inset 0 0 0 2px #1b3158;
}

.leader-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scale(1.22);
  transform-origin: center 58%;
}

.leader-copy {
  min-width: 0;
}

.leader-copy strong,
.leader-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-copy strong {
  color: #fff4d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.leader-copy .leader-role {
  margin-top: 2px;
  color: #bcaa87;
  font-size: 10px;
}

.leader-copy .leader-points {
  margin-top: 4px;
  color: #e5b647;
  font-size: 13px;
  font-weight: 900;
}

.quick-add-panel {
  top: 800px;
  left: 326px;
  width: 822px;
  height: 170px;
  padding: 18px 24px;
}

.quick-add-panel h2 {
  margin: 0 0 16px 8px;
  color: #3b210f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  text-transform: uppercase;
}

.quick-add-form {
  display: grid;
  grid-template-columns: minmax(270px, 1.6fr) minmax(160px, 0.9fr) 138px 118px;
  gap: 12px;
}

.quick-add-form input,
.quick-add-form select,
.quick-add-form button {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 2px solid #755127;
  border-radius: 2px;
  color: #321e10;
  background: rgba(255, 244, 213, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.quick-add-form input::placeholder {
  color: #8b6b47;
}

.quick-add-form button {
  border-color: #082f59;
  color: #fff5d9;
  background: #1764a9;
  box-shadow: inset 0 0 0 2px #318cd6, 3px 4px 0 rgba(43, 26, 11, 0.36);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

.quick-add-form button:hover {
  background: #257bc1;
}

.form-status {
  min-height: 18px;
  margin: 8px 8px 0;
  color: #5a351a;
  font-size: 11px;
  font-weight: 900;
}

.task-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 28px;
  overflow: auto;
  border: 5px solid #4a2509;
  border-radius: 2px;
  color: #2b190e;
  background: #f4e3b9;
  box-shadow: inset 0 0 0 4px #c5964a, 12px 14px 0 rgba(18, 8, 2, 0.48);
}

.task-dialog::backdrop {
  background: rgba(14, 7, 3, 0.78);
}

.dialog-close-form {
  display: flex;
  justify-content: flex-end;
  margin: -14px -14px 4px;
}

.dialog-close-form button,
.dialog-actions button {
  min-height: 36px;
  padding: 6px 12px;
  border: 2px solid #5b3213;
  color: #fff3d0;
  background: #8e2b1a;
  font-weight: 900;
}

.dialog-title {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.dialog-chip {
  padding: 4px 8px;
  border: 2px solid #755127;
  background: #e7c982;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dialog-section {
  padding: 12px 0;
  border-top: 2px solid rgba(117, 81, 39, 0.36);
}

.dialog-section h3 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.dialog-section p {
  margin: 3px 0;
  color: #5b3d25;
  font-size: 13px;
  line-height: 1.45;
}

.owner-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid rgba(117, 81, 39, 0.24);
}

.owner-status-row button {
  min-height: 30px;
  border: 2px solid #5b3213;
  color: #fff3d0;
  background: #3e7135;
  font-weight: 900;
}

.sample-notice {
  padding: 10px;
  border: 2px dashed #8a612f;
  color: #5b3d25;
  background: rgba(231, 201, 130, 0.42);
  font-size: 13px;
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions .complete-action {
  color: #eef9de;
  background: #3e7135;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  body {
    background: #2c190b;
  }

  .scene-shell {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 24px 14px 36px;
    overflow: visible;
    background: #42260f url("/assets/mrt-noticeboard-backdrop.png?v=20260810-reference") top center / auto 680px no-repeat;
  }

  .manager-panel,
  .task-board,
  .leaderboard,
  .quick-add-panel {
    position: static;
    width: 100%;
    height: auto;
  }

  .manager-panel {
    display: grid;
    grid-template-columns: 92px repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 122px;
    padding: 16px;
    border: 4px solid #1e0e05;
    background: rgba(42, 22, 8, 0.94);
  }

  .view-switch {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .view-button {
    height: 42px;
    border: 2px solid #b18128;
    background: #1f5e43;
  }

  .profile-portrait {
    position: static;
    grid-row: 2 / 4;
    width: 92px;
    height: 104px;
    border: 3px solid #bc8627;
    background: #174f85;
  }

  .avatar-picker {
    top: 226px;
    left: 116px;
  }

  .summary-card {
    position: static;
    width: auto;
    height: 68px;
    border: 2px solid #7c541a;
    background: rgba(40, 21, 8, 0.84);
  }

  .summary-card span {
    font-size: 12px;
  }

  .summary-card strong {
    font-size: 22px;
  }

  .reward-summary {
    position: static;
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: auto;
    padding-top: 4px;
  }

  .reward-title {
    grid-column: 1 / -1;
  }

  .task-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
  }

  .board-column {
    padding: 70px 12px 14px;
    border: 4px solid #512e11;
    background: #f3dfae;
  }

  .board-column h1 {
    top: 12px;
  }

  .task-stack {
    grid-template-rows: none;
    height: auto;
  }

  .task-card {
    min-height: 142px;
  }

  .leaderboard {
    margin-top: 16px;
    padding: 0 12px 16px;
    border: 4px solid #1e0e05;
    background: #211206;
  }

  .leaderboard h2 {
    height: auto;
    padding: 18px 0 10px;
    background: #1f5e43;
  }

  .leaderboard-tabs {
    padding-top: 7px;
  }

  .leader-list {
    height: auto;
    padding: 8px 0 0;
  }

  .leader-row {
    min-height: 76px;
  }

  .quick-add-panel {
    margin-top: 16px;
    padding: 20px;
    border: 4px solid #684219;
    background: #f3dfae;
  }

  .quick-add-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .manager-panel {
    grid-template-columns: 82px 1fr;
  }

  .summary-card {
    grid-column: 2;
  }

  .reward-summary {
    grid-column: 1 / -1;
  }

  .quick-add-panel h2,
  .board-column h1,
  .leaderboard h2 {
    font-size: 21px;
  }
}

/* Final desktop alignment must follow the base and mobile declarations. */
@media (min-width: 901px) {
  .view-button {
    color: transparent;
    text-shadow: none;
  }

  .view-button:hover,
  .view-button.active {
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 220, 89, 0.42);
  }

  .profile-portrait img {
    opacity: 0;
  }

  .leaderboard h2 {
    color: transparent;
    text-shadow: none;
  }

  .leaderboard-tabs,
  .leader-rank,
  .leader-avatar {
    display: none;
  }

  .leader-list {
    grid-template-rows: repeat(5, 1fr);
    gap: 0;
    height: 520px;
    padding: 0 11px;
  }

  .leader-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 32px 7px 112px;
    border: 0;
    background: transparent;
  }

  .leader-copy strong {
    font-family: var(--font-display);
    font-size: 15px;
  }

  .leader-copy .leader-role {
    font-size: var(--text-xs);
  }

  .leader-copy .leader-points {
    font-size: 13px;
  }
}
