:root {
  --bg: #0d0b13;
  --ink: #e8e4ee;
  --muted: #9b94a8;
  --line: rgba(232, 228, 238, 0.12);
  --accent: #d4f54e;
  --accent-soft: rgba(212, 245, 78, 0.1);
  --on-accent: #0d0b13;
  --purple: #7a1fd6;
  --purple-ink: #b489f0;
  --warn: #ee8c79;
  --dim: rgba(13, 11, 19, 0.86);
  --chart: 0.2;
  --display: "Song Myung", "Noto Serif KR", serif;
  --hanja: "Noto Serif KR", "Song Myung", serif;
  --ui:
    "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic",
    sans-serif;
  --navh: 60px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f0f0f0;
  --surface: #ffffff;
  --sheet: transparent;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #d6d6d6;
  --hair: rgba(17, 17, 17, 0.4);
  --accent: #7a1fd6;
  --accent-soft: #eee5fa;
  --on-accent: #ffffff;
  --purple: #7a1fd6;
  --purple-ink: #7a1fd6;
  --warn: #b0402e;
  --warn-soft: #f8e3de;
  --sun-soft: #fcf1d2;
  --sun-ink: #6b4d00;
  --dim: rgba(240, 240, 240, 0.86);
  --chart: 0.06;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navh) + 60px);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

.px {
  image-rendering: pixelated;
}

.sym {
  font-family:
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI Symbol", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  width: min(1400px, 140vmax);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  z-index: -1;
  pointer-events: none;
  background: var(--purple);
  opacity: var(--chart);
  -webkit-mask: url(../img/theme/starchart.webp) center / contain no-repeat;
  mask: url(../img/theme/starchart.webp) center / contain no-repeat;
}

.room {
  animation: roomIn 0.28s ease-out;
}

@keyframes roomIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.ty {
  background: var(--muted);
}

.ty[data-t="노말"] {
  background: #9fa19f;
}

.ty[data-t="불꽃"] {
  background: #e62829;
}

.ty[data-t="물"] {
  background: #2980ef;
}

.ty[data-t="풀"] {
  background: #3fa129;
}

.ty[data-t="전기"] {
  background: #fac000;
}

.ty[data-t="얼음"] {
  background: #3dcef3;
}

.ty[data-t="격투"] {
  background: #ff8000;
}

.ty[data-t="독"] {
  background: #9141cb;
}

.ty[data-t="땅"] {
  background: #915121;
}

.ty[data-t="비행"] {
  background: #81b9ef;
}

.ty[data-t="에스퍼"] {
  background: #ef4179;
}

.ty[data-t="벌레"] {
  background: #91a119;
}

.ty[data-t="바위"] {
  background: #afa981;
}

.ty[data-t="고스트"] {
  background: #704170;
}

.ty[data-t="드래곤"] {
  background: #5060e1;
}

.ty[data-t="악"] {
  background: #624d4e;
}

.ty[data-t="강철"] {
  background: #60a1b8;
}

.ty[data-t="페어리"] {
  background: #ef70ef;
}

.steps2 {
  position: sticky;
  top: var(--navh);
  z-index: 15;
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  padding: 12px 0;
  border-top: 0 solid transparent;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.steps2 a {
  color: var(--muted);
  text-decoration: none;
}

.steps2 a:hover {
  color: var(--ink);
}

.steps2 a {
  position: relative;
}

.steps2 a[aria-current="true"] {
  color: var(--accent);
  font-weight: 700;
}

.steps2 a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 18px;
  height: 2px;
  background: var(--purple);
}

.frow2 {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.fl {
  padding: 13px 14px 11px 0;
  border-right: 1px solid var(--line);
  font-size: 15px;
  min-height: 100%;
}

.fl small {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: 6px;
}

.fc {
  padding: 8px 0 8px 18px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.frow2.on .fl {
  color: var(--accent);
}

.frow2.bad .fl {
  color: var(--warn);
}

.fe {
  width: 100%;
  margin: 0;
  color: var(--warn);
  font-size: 13.5px;
}

.fi,
.fs {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
  min-width: 0;
  border-radius: 0;
}

.fi {
  flex: 1 1 220px;
}

.fi:focus,
.fs:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.fi::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.fs {
  padding-right: 4px;
}

.xok {
  color: var(--muted);
  font-size: 13.5px;
}

.tx {
  color: var(--accent);
  font-size: 14.5px;
  padding: 2px 0;
}

.tx:hover {
  text-decoration: underline;
}

.send {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 24px;
  margin: 34px 0 0;
  padding: 18px 0;
  border-top: 0 solid transparent;
  border-bottom: 0 solid transparent;
}

.go2 {
  font-family: var(--display);
  font-size: 26px;
  color: var(--accent);
  padding: 0;
}

.go2:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.draft {
  color: var(--muted);
  font-size: 13.5px;
}

.fh {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
}

.tx.danger {
  color: var(--warn);
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
}

.chk input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 21px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
}

.chk input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.chk input:checked {
  background: var(--accent);
}

.chk input:checked::after {
  transform: translateX(15px);
}

@media (max-width: 1100px) {
  .frow2 {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .frow2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .fl {
    border-right: 0;
    padding: 10px 0 0;
  }

  .fc {
    padding: 4px 0 10px;
  }

  .steps2 {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 18px;
  }

  .steps2 a {
    white-space: nowrap;
  }
}


.timer {
  position: absolute;
  right: max(28px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted);
}

.timer b {
  font-weight: 400;
  color: var(--ink);
}

.timer .ext {
  color: var(--accent);
  font-weight: 700;
  padding: 3px 0;
}

.timer .ext:disabled {
  opacity: 0.6;
  cursor: default;
}

.timer .fold {
  font-size: 16px;
  color: var(--muted);
  padding: 2px 4px;
}

.timer.folded .ext {
  display: none;
}

.timer.soon,
.timer.soon b {
  color: var(--warn);
}


body.msg {
  display: grid;
  place-items: center;
  min-height: 90vh;
  padding: 16px;
}

body.msg p {
  max-width: 28em;
  text-align: center;
}

.totop {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  padding: 6px 8px;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

.totop:hover {
  color: var(--ink);
}

@media (max-width: 1050px) {
  .timer .name {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --navh: 52px;
  }

  .timer {
    position: static;
    transform: none;
    margin-left: auto;
    padding-left: 12px;
  }

  .timer .ext {
    font-size: 13px;
  }
}

:root {
  --field-min: 0px;
}

@media (max-width: 760px) {
  :root {
    --field-min: 16px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .room {
    animation: none;
  }
}
