/* Generated using AppDeploy UI skill */
:root {
  --bg: #f5efe5;
  --paper: #fffdf8;
  --ink: #30251e;
  --muted: #776b62;
  --line: #e7ded2;
  --accent: #ad4a2b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo',
    'Malgun Gothic', sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #f0e7dc;
  color: var(--ink);
  padding: 8px 12px;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #65927b;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
#app {
  max-width: 1060px;
  margin: auto;
  padding: 0 24px 130px;
}
header,
.heading,
.selection,
.settings,
.board-heading,
.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
header {
  padding: 22px 0;
}
header b {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid #d9c8b7;
  background: #fff9ed;
  border-radius: 11px;
}
header button {
  background: transparent;
  font-size: 12px;
}
.intro {
  margin: 8px 0 26px;
}
.intro small {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.8px;
  margin: 12px 0;
}
h2 {
  font-size: 16px;
  margin: 0;
  letter-spacing: -0.4px;
}
p {
  line-height: 1.7;
}
.intro p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.intro strong {
  font-weight: 500;
}
main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
main > * {
  min-width: 0;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 32px #4b301208;
}
.setup {
  padding: 20px;
}
.heading button {
  color: var(--accent);
  background: transparent;
  font-size: 12px;
}
#chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
  max-height: 350px;
  overflow: auto;
}
.chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
}
.chip[aria-pressed='true'] {
  border-color: #bd8061;
  background: #f7eade;
  color: #693e29;
}
.chip:before {
  content: '○ ';
}
.chip[aria-pressed='true']:before {
  content: '✓ ';
  color: var(--accent);
}
.selection {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 11px;
}
.selection button {
  background: none;
  font-size: 10px;
  padding: 5px;
}
#count {
  color: var(--accent);
  font-weight: 700;
}
.hint,
.privacy {
  font-size: 11px;
  color: var(--muted);
}
.privacy {
  text-align: center;
}
.rule-card {
  padding: 18px 8px;
  font-size: 13px;
  color: var(--muted);
}
.rule-card b {
  color: var(--ink);
}
.rule-card small {
  font-size: 11px;
}
#play {
  overflow: hidden;
}
.settings {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.settings label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 13px;
}
.stepper button {
  width: 38px;
  min-height: 40px;
  padding: 0;
  font-size: 20px;
}
output {
  font-weight: 800;
}
select {
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: #f0e7dc;
  color: var(--ink);
  font-size: 12px;
  min-height: 44px;
}
.board-heading {
  margin: 20px 20px 0;
  scroll-margin-top: 8px;
}
.pill {
  border-radius: 30px;
  padding: 7px 10px;
  background: #e9eee7;
  color: #526850;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.delivery {
  margin: 12px 0 0;
  font-size: 11px;
  text-align: center;
  color: #526850;
}
#scroller {
  margin: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
#board {
  position: relative;
  background: radial-gradient(ellipse at top, #faead255, transparent 60%);
}
#ladder {
  display: block;
  width: 100%;
  height: 300px;
}
#people {
  position: relative;
  height: 118px;
}
.person {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  padding: 0;
  gap: 5px;
  min-height: 100px;
  max-width: 66px;
}
.person svg {
  width: 30px;
  height: 42px;
  flex-shrink: 0;
}
.person .name {
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.person .status {
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.person.received {
  color: #42735b;
}
.person.payer {
  color: var(--accent);
  font-weight: 800;
}
.person.payer svg {
  filter: drop-shadow(0 0 4px #d16f40);
}
.person:disabled {
  opacity: 1;
}
#countdown {
  position: absolute;
  top: 105px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 84px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 4px 0 var(--paper);
  pointer-events: none;
}
.board-footer {
  margin: 0 20px 15px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.board-footer p {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}
.board-footer button {
  font-size: 11px;
  white-space: nowrap;
}
.odds-panel {
  margin: 0 16px 18px;
  padding: 15px 16px;
  border: 1px solid #e6d4bd;
  border-radius: 15px;
  background: #f7ede0;
}
.odds-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#oddsTitle {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}
#oddsDetail {
  margin: 5px 0 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}
#oddsValue {
  color: var(--accent);
  font-size: clamp(23px, 4vw, 30px);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.odds-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid #e6d4bd;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.footer-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#footerOdds {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .footer-summary { text-align: center; }
  #footerOdds { font-size: 10px; }
}
.stats-card {
  grid-column: 2;
  padding: 18px;
}
.stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.stats-head h2 { margin: 0 0 5px; }
.stats-head p { margin: 0; color: var(--muted); font-size: 11px; }
#resetStats { min-height: 36px; font-size: 10px; color: var(--accent); white-space: nowrap; }
.stats-leader { margin-bottom: 12px; padding: 12px 14px; border-radius: 13px; background: #f7ede0; color: var(--accent); font-size: 12px; font-weight: 800; line-height: 1.6; }
.stats-table { display: grid; gap: 6px; }
.stats-row { display: grid; grid-template-columns: minmax(88px,1.4fr) .65fr .65fr .8fr .8fr; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 10px; background: #faf5ee; font-size: 11px; }
.stats-row.stats-header { background: transparent; color: var(--muted); font-size: 9px; padding-top: 0; }
.stats-row .stats-name { font-weight: 750; overflow-wrap: anywhere; }
.stats-rate { font-variant-numeric: tabular-nums; text-align: right; }
.stats-delta.high { color: #b13b2a; font-weight: 800; }
.stats-delta.low { color: #42735b; font-weight: 700; }
.stats-note { margin: 11px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
#history {
  grid-column: 2;
}
#history h2 {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.record {
  background: #eee5d8;
  border-radius: 12px;
  padding: 12px;
  margin: 7px 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f5efe5f2;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 15px 24px max(15px, env(safe-area-inset-bottom));
  z-index: 10;
}
footer > div {
  max-width: 1012px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#rule {
  font-size: 12px;
  line-height: 1.6;
}
.primary {
  background: var(--accent);
  color: var(--paper);
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
  min-height: 53px;
  padding: 10px 24px;
}
.primary:hover:not(:disabled) {
  background: #85351f;
}
#start {
  min-width: 320px;
}
progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  border: 0;
  accent-color: var(--accent);
}
progress::-webkit-progress-bar {
  background: transparent;
}
progress::-webkit-progress-value {
  background: var(--accent);
}
dialog {
  width: min(470px, calc(100% - 28px));
  max-height: 88dvh;
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}
dialog::backdrop {
  background: #2c211972;
  backdrop-filter: blur(3px);
}
dialog p,
dialog label {
  font-size: 12px;
  color: var(--muted);
}
dialog .primary {
  width: 100%;
}
dialog .heading button {
  font-size: 16px;
}
dialog small {
  font-size: 10px;
  color: var(--muted);
}
textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #e3d5c4;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.6;
  background: #f5eee4;
  color: var(--ink);
  margin: 10px 0;
}
#nameError {
  color: #a3271e;
}
#resultDialog {
  text-align: center;
}
.shuffle-comparison {
  margin: 14px 0;
  padding: 13px;
  border: 1px dashed #d9bfa2;
  border-radius: 13px;
  background: #faf4ea;
  text-align: left;
}
.shuffle-comparison h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
}
.shuffle-comparison dl {
  display: grid;
  gap: 6px;
  margin: 0;
}
.shuffle-comparison dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--paper);
}
.shuffle-comparison dt {
  color: var(--muted);
  font-size: 11px;
}
.shuffle-comparison dd {
  margin: 0;
  text-align: right;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.shuffle-comparison p {
  margin: 9px 0 0;
  font-size: 10px;
}

#resultTitle {
  color: var(--accent);
  font-size: 27px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.result-art {
  margin: 15px auto;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  font-size: 49px;
  border-radius: 50%;
  background: #f1dfc5;
}
.summary {
  background: #f4ebdf;
  padding: 12px;
  border-radius: 12px;
}
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.result-actions button {
  flex: 1;
}
#copyText {
  min-height: 100px;
}
#toast {
  position: fixed;
  bottom: 115px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b302a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  max-width: 90%;
  font-size: 12px;
  z-index: 20;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 760px) {
  #app {
    max-width: 620px;
    padding: 0 16px 155px;
  }
  header {
    padding: 15px 0;
  }
  header b {
    font-size: 14px;
  }
  header button {
    font-size: 11px;
    padding: 7px;
  }
  h1 {
    font-size: 27px;
    letter-spacing: -1.4px;
  }
  .intro {
    margin: 5px 0 20px;
  }
  .intro p {
    font-size: 12px;
  }
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .setup {
    padding: 12px 16px;
  }
  #chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    max-height: 222px;
  }
  .chip {
    font-size: 11px;
    padding: 8px 5px;
  }
  .hint,
  .rule-card {
    display: none;
  }
  .settings {
    padding: 15px;
  }
  .board-heading {
    margin: 16px 15px 0;
  }
  .board-heading h2 {
    font-size: 14px;
  }
  .stats-card,
  #history {
    grid-column: 1;
  }
  .stats-card { padding: 14px; }
  .stats-row { grid-template-columns: minmax(72px,1.3fr) .55fr .55fr .78fr .78fr; gap: 4px; padding: 8px 6px; font-size: 10px; }
  .stats-row.stats-header { font-size: 8px; }
  .stats-note { font-size: 9px; }
  footer {
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  }
  footer > div {
    flex-direction: column-reverse;
    gap: 7px;
  }
  #start {
    width: 100%;
    min-width: 0;
  }
  #rule {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
