:root {
  color-scheme: light;
  font-family: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #182923;
  background: #f3f5ef;
  font-synthesis: none;
  --ink: #182923;
  --muted: #52645c;
  --line: #dfe6df;
  --paper: #fff;
  --dark: #10221d;
  --mint: #d1ef97;
  --mint-ink: #203c2a;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #557c36; outline-offset: 3px; }

.page-width { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }

.site-header {
  background: var(--dark);
  border-bottom: 1px solid #253931;
  color: #f8faf3;
}

.site-header-inner { display: flex; align-items: center; min-height: 65px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -.085em;
  line-height: 1;
}

.wordmark > span:last-child { color: var(--mint); }

.die {
  --dots: #1b3326;
  display: inline-block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, var(--dots) 1.6px, transparent 2px),
    radial-gradient(circle at 70% 70%, var(--dots) 1.6px, transparent 2px),
    radial-gradient(circle at 50% 50%, var(--dots) 1.6px, transparent 2px), var(--mint);
}

.wordmark .die { margin-right: 10px; transform: rotate(-9deg); }

main { padding: 32px 0 40px; }
.intro { margin-bottom: 23px; }
.intro h1 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.3rem); line-height: 1.15; letter-spacing: -.075em; }
.intro p { margin: 12px 0 0; color: var(--muted); line-height: 1.6; word-break: keep-all; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
  gap: 19px;
  align-items: stretch;
}

.panel { min-width: 0; border-radius: 25px; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-header h2 { margin: 0; font-size: 1.23rem; font-weight: 780; letter-spacing: -.035em; }

.map-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 26px 27px 23px;
  color: #f5f8f1;
  background: radial-gradient(ellipse at 50% 44%, #20382f 0, #12251f 56%, #10221d 100%);
  border: 1px solid #213930;
}

.seat-count {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #516458;
  border-radius: 99px;
  color: #d7e4d8;
  font-size: .8125rem;
  line-height: 1.3;
}

.map-main { display: grid; align-content: center; gap: 31px; flex: 1; padding: 22px 0 30px; }

.map-status {
  min-height: 1.6em;
  margin: 0;
  color: #d1ecaa;
  font-size: .9rem;
  line-height: 1.6;
  text-align: center;
  overflow-wrap: anywhere;
}

.floor {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: 60px clamp(112px, 15vw, 170px) 60px;
  gap: 9px 7px;
  width: 100%;
  max-width: 610px;
  margin-inline: auto;
}

.table {
  position: relative;
  grid-area: 2 / 1 / 3 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  isolation: isolate;
  border: 1px solid #658477;
  border-radius: 30px;
  background: radial-gradient(ellipse at 45% 30%, #41695a, #2b5246 70%);
  box-shadow: 0 8px 0 -2px #0a1c16, 0 15px 26px -10px #091b15, inset 0 1px #739486aa;
}

.table::before {
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid #86a49466;
  border-radius: 23px;
  content: "";
  background: repeating-linear-gradient(128deg, #fff0 0 4px, #fff1 5px 5.5px, #fff0 6px 9px);
}

.table-half {
  display: grid;
  place-items: center;
  color: #e3eee4;
  font-size: clamp(.65rem, 1.15vw, .86rem);
  font-weight: 680;
  letter-spacing: .18em;
  white-space: nowrap;
}

.table-half + .table-half::before {
  position: absolute;
  inset: 9px auto 9px 50%;
  border-left: 1px solid #92afa080;
  content: "";
}

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 5px 3px;
  border: 1px solid #63796d;
  border-radius: 11px;
  font-variant-numeric: tabular-nums;
  color: #e4ede3;
  background: #283d33;
  box-shadow: inset 0 2px #ffffff20, 0 2px 6px #0b1b15a6;
  text-align: center;
  transition: background-color .16s, border-color .16s, color .16s;
}

.seat-top { border-radius: 13px 13px 7px 7px; }
.seat-bottom { border-radius: 7px 7px 13px 13px; box-shadow: inset 0 -2px #ffffff20, 0 2px 6px #0b1b15a6; }
.seat-before-join { margin-right: 4px; }
.seat-after-join { margin-left: 4px; }
.seat:focus-visible { outline-color: #deffae; }
.seat[aria-disabled="true"] { cursor: default; }
.seat-number { font-size: .8rem; line-height: 1.1; font-weight: 650; }
.seat-name { max-width: 100%; overflow: hidden; font-size: .9rem; font-weight: 750; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.seat-name:empty { display: none; }

.seat[data-kind="unassigned"] .seat-number { font-size: 1rem; color: #d3e1d5; }
.seat[data-kind="host"] { color: #382a16; border-color: #f0ca86; background: #f5cc88; }
.seat[data-kind="guest"] { color: #e8f5e9; border-color: #729182; background: #486b5b; }
.seat[data-kind="empty"] { color: #c2d1c7; border-style: dashed; border-color: #64786d; background: #20352c; }
.seat[data-kind="empty"] .seat-name { font-weight: 560; }
.is-picking .seat:hover, .seat[data-kind="host"]:hover { border-color: #dfefbd; background-color: #45614d; color: #f7faef; }
.seat[data-current-host] { outline: 2px solid #f4d7a1; outline-offset: 3px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 21px;
  padding-top: 19px;
  border-top: 1px solid #3c5147;
  color: #d5e1d6;
  font-size: .875rem;
}

.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend-host { background: #f5cc88; }
.legend-guest { background: #547967; border: 1px solid #729182; }
.legend-empty { border: 1px dashed #a4b6a7; }
.noscript { margin: 15px 0 0; color: #f5cc88; }

.settings {
  padding: 21px 25px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 8px 26px -20px #17332260;
}

.settings .panel-header { margin-bottom: 17px; }
.settings-group h3 { margin: 0; font-size: .935rem; font-weight: 760; }
.hosts-group { padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.host-list { display: grid; gap: 7px; margin-top: 9px; }
.host-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }

.settings input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe4db;
  border-radius: 8px;
  color: var(--ink);
  background: #f7f9f5;
  font-size: .93rem;
}

.settings input::placeholder { color: #5f7167; opacity: 1; }
.settings input:focus { border-color: #83a270; background: #fff; }

.choose-seat {
  min-width: 94px;
  padding: 0 8px;
  border: 1px solid #dde7da;
  border-radius: 8px;
  color: #375144;
  background: #f1f5ef;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.choose-seat:hover, .choose-seat[aria-pressed="true"] { color: #29462b; border-color: #acc887; background: #e7f3ce; }
.group-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.guest-count { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.guest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.field-note { margin: 9px 0 0; color: var(--muted); font-size: .81rem; line-height: 1.5; word-break: keep-all; }

.roll-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--mint-ink);
  background: var(--mint);
  font-size: .97rem;
  font-weight: 830;
}

.roll-button .die { --dots: #def2c5; width: 20px; height: 20px; border-radius: 5px; background-color: #2d4a37; }
.roll-button:hover { background: #bfe97a; }
.roll-button:disabled { color: #506258; background: #e8eee5; cursor: default; }
.roll-button:disabled .die { background-color: #607466; }

@media (max-width: 1020px) {
  .page-width { width: calc(100% - 50px); }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(296px, 34%); gap: 14px; }
  .map-panel, .settings { padding: 21px 17px; }
  .floor { gap: 8px 5px; }
  .seat-name { font-size: .76rem; }
}

@media (max-width: 760px) {
  .page-width { width: calc(100% - 32px); }
  .site-header-inner { min-height: 56px; }
  main { padding: 30px 0; }
  .intro { margin-bottom: 20px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel { border-radius: 18px; }
  .map-panel { min-height: 0; }
  .map-main { padding-top: 16px; gap: 20px; }
  .floor { grid-template-rows: 48px clamp(86px, 21vw, 132px) 48px; }
  .settings .panel-header { margin-bottom: 18px; }
  .settings input { height: 42px; font-size: 1rem; }
  .choose-seat { font-size: .875rem; }
  .roll-button { min-height: 48px; }
}

@media (max-width: 440px) {
  .page-width { width: calc(100% - 24px); }
  .map-panel, .settings { padding: 17px 11px; }
  .map-main { gap: 16px; padding-bottom: 20px; }
  .floor { gap: 6px 3px; }
  .table { border-radius: 20px; }
  .table::before { inset: 5px; border-radius: 15px; }
  .table-half + .table-half::before { inset-block: 6px; }
  .seat-before-join { margin-right: 1px; }
  .seat-after-join { margin-left: 1px; }
  .seat { padding-inline: 1px; }
  .seat-number { font-size: .7rem; }
  .seat-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: .72rem;
  }
  .legend { gap: 7px 12px; font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .seat { transition: none; }
}
