@charset "UTF-8";
:root {
  --paper: #f5f3ec;
  --ink: #292e27;
  --muted: #7b8075;
  --line: #dedfd4;
  --green: #435c3f;
  --ratio: 1450/1524;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid #6c915f;
  outline-offset: 4px;
}
button:not(:disabled) {
  transition:
    background 0.15s,
    color 0.15s;
}
img {
  display: block;
}
[hidden] {
  display: none !important;
}
.site-header {
  max-width: 1370px;
  margin: 0 auto;
  height: 84px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  margin: 0;
  font:
    600 26px Georgia,
    serif;
  letter-spacing: -1px;
}
.portrait-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 480px;
  gap: 8px;
}
.portrait-selection {
  margin-top: 16px;
}
.portrait-selection-label {
  font-weight: 600;
}
.portrait-option {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  text-align: left;
}
.portrait-option img {
  width: 32px;
  height: 42px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 2px;
}
.portrait-option.active {
  background: #e9eddf;
  border-color: #9bab89;
}
.portrait-option:hover {
  background: #ebeee3;
}
main {
  max-width: 1490px;
  margin: auto;
  padding: 23px 32px;
}
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 305px;
  gap: 22px;
  align-items: start;
}
.panel-heading {
  height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
h2 {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
}
.count-pill {
  font-size: 10px;
  color: var(--muted);
}
.picture-frame {
  /* Keep the image area proportional; exclude the decorative border. */
  box-sizing: content-box;
  aspect-ratio: var(--ratio);
  background: #b19867;
  border: 5px solid #fffef9;
  box-shadow: 0 0 0 1px #d8d7ca;
  position: relative;
  overflow: hidden;
}
.picture-frame > img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.picture-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: default;
}
.canvas-frame {
  box-shadow: 0 0 0 1px #a5b19a;
}
.canvas-frame.drop-active {
  box-shadow: 0 0 0 3px #739160;
}
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #f1eddeec;
  font-size: 13px;
  color: var(--green);
}
.canvas-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 47px;
  padding: 8px 0;
}
.button-group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.icon-button {
  font-size: 23px;
  line-height: 1;
  width: 30px;
  height: 31px;
  border-radius: 4px;
}
.icon-button:hover:not(:disabled),
.text-button:hover:not(:disabled) {
  background: #e7eadd;
}
.text-button {
  font-size: 11px;
  padding: 8px;
  border-radius: 4px;
}
.toolbar-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
  margin: 0 7px;
}
.library {
  padding-left: 17px;
  border-left: 1px solid var(--line);
  min-height: 0;
}
.library-heading {
  height: 30px;
}
.food-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  overflow: visible;
  padding: 1px 5px 4px 1px;
  scrollbar-width: thin;
  scrollbar-color: #c3ccba transparent;
  align-content: start;
}
.food-card {
  min-width: 0;
  border: 1px solid #e1e3d7;
  border-radius: 5px;
  background: #fafaf5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 5px 6px;
  user-select: none;
  touch-action: pan-y;
}
.food-card img {
  width: 100%;
  height: 55px;
  object-fit: contain;
  pointer-events: none;
}
.food-card span {
  font-size: 10px;
  color: #69725c;
  text-align: center;
  overflow-wrap: anywhere;
}
.food-card:hover {
  background: #edf1e5;
  border-color: #b4c1a4;
}
.food-card:active {
  background: #e2e9d8;
}
.edit-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #eeefe5;
  border: 1px solid #dddfd2;
  border-radius: 5px;
  padding: 13px 16px;
  margin-top: 7px;
}
.selection-info {
  min-width: 92px;
}
.selection-info strong {
  font-size: 11px;
  font-weight: 500;
}
fieldset {
  flex-wrap: wrap;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 24px;
  flex: 1;
  align-items: center;
  min-width: 0;
}
fieldset:disabled {
  opacity: 0.45;
}
.range-control {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 150px;
  white-space: nowrap;
}
.range-control input {
  min-width: 50px;
  width: 100%;
  accent-color: var(--green);
  height: 3px;
  cursor: pointer;
}
.range-control output {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  width: 37px;
  text-align: right;
  flex-shrink: 0;
  color: #657357;
}
.selection-actions {
  flex-wrap: wrap;
  max-width: 100%;
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.selection-actions button {
  font-size: 11px;
  border: 1px solid #d5dacb;
  border-radius: 4px;
  padding: 7px 9px;
  background: #f7f8ef;
}
.selection-actions button:hover:not(:disabled) {
  background: #dce5d0;
}
.selection-actions button[aria-pressed="true"] {
  background: #dce5d0;
  border-color: #91a37e;
}
.selection-actions .delete-button {
  color: #9b6254;
  margin-left: 5px;
}
.layers-row {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 13px;
  min-height: 29px;
}
.layers-row > span {
  font-size: 10px;
  color: #929a83;
  white-space: nowrap;
}
.layer-list {
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  align-items: center;
  min-height: 28px;
  flex: 1;
}
.layer-chip {
  border: 1px solid #dee2d3;
  border-radius: 20px;
  background: #f9f9f3;
  font-size: 10px;
  padding: 5px 10px;
  white-space: nowrap;
}
.layer-chip.active {
  background: #e1e9d6;
  border-color: #91a37e;
}
.delete-handle,
.flip-handle {
  position: absolute;
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fcf8ee;
  color: #a04838;
  border: 1px solid #ac5844;
  box-shadow: 0 1px 5px #30231735;
  transform: translate(-50%, -50%);
  font:
    22px/20px Arial,
    sans-serif;
  padding: 0;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}
.flip-handle {
  color: var(--green);
  border-color: #48633c;
  font-size: 19px;
  line-height: 1;
}
.flip-handle:hover,
.flip-handle[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
.delete-handle:hover {
  background: #a04838;
  color: #fff;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #293e2a;
  color: #fff;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: 0.2s;
  z-index: 100;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.drag-ghost {
  position: fixed;
  width: 85px;
  height: 85px;
  pointer-events: none;
  z-index: 90;
  filter: drop-shadow(0 4px 8px #0003);
  transform: translate(-50%, -50%);
}
.drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 1000px) {
  .site-header {
    padding: 0 22px;
  }
  main {
    padding: 20px 22px;
  }
  .studio {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 235px;
  }
  .library {
    padding-left: 11px;
  }
  .food-card img {
    height: 45px;
  }
  .food-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  fieldset {
    gap: 15px;
  }
  .selection-info {
    min-width: 70px;
  }
  .edit-strip {
    gap: 12px;
  }
  .selection-actions button {
    padding: 7px;
  }
  .range-control {
    gap: 7px;
  }
}
@media (max-width: 750px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px;
    gap: 12px;
  }
  .food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .food-card {
    flex-direction: column;
    padding: 5px;
    gap: 5px;
  }
  .food-card img {
    width: 37px;
    height: 37px;
  }
  .edit-strip {
    align-items: flex-start;
    flex-direction: column;
  }
  fieldset {
    width: 100%;
    flex-wrap: wrap;
  }
  .range-control {
    flex: 1;
    min-width: 160px;
  }
  .selection-actions {
    width: 100%;
  }
  .selection-info {
    min-width: 0;
  }
  .site-header {
    height: 76px;
  }
}
@media (max-width: 560px) {
  .site-header {
    height: 74px;
    padding: 0 14px;
    gap: 12px;
  }
  .brand {
    font-size: 21px;
  }
  main {
    padding: 18px 14px;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .library {
    grid-column: 1/-1;
    padding: 13px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    margin-top: 3px;
  }
  .library-heading {
    height: 26px;
  }
  .food-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78px;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 7px;
  }
  .food-card {
    flex-direction: column;
    gap: 4px;
    padding: 6px 3px;
    touch-action: auto;
  }
  .food-card img {
    width: 100%;
    height: 46px;
  }
  .picture-frame {
    border-width: 3px;
  }
  .panel-heading {
    height: 26px;
  }
  h2 {
    font-size: 11px;
  }
  .count-pill {
    font-size: 9px;
  }
  .icon-button {
    width: 24px;
    font-size: 20px;
  }
  .text-button {
    font-size: 10px;
    padding: 5px;
  }
  .toolbar-divider {
    margin: 0 2px;
  }
  .range-control {
    min-width: 100%;
  }
  .selection-actions button {
    flex: 1;
  }
  .edit-strip {
    margin-top: 15px;
  }
  .layers-row {
    gap: 8px;
  }
  .layers-row > span {
    font-size: 9px;
  }
  .delete-handle,
  .flip-handle {
    width: 26px;
    height: 26px;
  }
}

.task-instructions {
  max-width: 960px;
  margin-bottom: 24px;
  line-height: 1.5;
}
.task-instructions h2 {
  font-size: 18px;
  font-weight: 600;
}
.task-instructions p {
  margin: 8px 0;
  font-size: 13px;
}
.collection-notice {
  color: var(--green);
  font-weight: 600;
}
#portraitName {
  font-size: 11px;
  color: var(--muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.language-switch {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px;
}
.language-switch button {
  font-size: 11px;
  border-radius: 3px;
  padding: 6px 8px;
}
.language-switch button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
@media (max-width: 750px) {
  .site-header {
    height: auto;
    min-height: 84px;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .header-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
}

