:root {
  --bg: #f6d4e2;
  --text: #2a141c;
  --muted: #5a3340;
  --gold: #9d0f4a;
  --panel: #fff4f8;
  --line: rgba(157, 15, 74, 0.18);
  --bad: #c0172b;
  --good: #177a38;
  --width: 44rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 12% -8%, #ffe6f0, transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
  letter-spacing: -0.01em;
}

.page {
  width: min(var(--width), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.5rem 0 6rem;
}

.discord-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem 1rem;
  margin: 0;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
}

.discord-banner[hidden] {
  display: none;
}

.discord-banner.is-ok {
  background: #e7f6ea;
  color: #177a38;
}

.discord-banner.is-warn {
  background: #fff1e6;
  color: #9a4b00;
}

.discord-banner a {
  color: inherit;
  font-weight: 800;
}

.hero {
  margin-bottom: 3.2rem;
}

.avatar {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin-bottom: 1.35rem;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff4f8, 0 8px 20px rgba(157, 15, 74, 0.18);
}

h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  width: fit-content;
  margin: 0 0 0.4rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 244, 248, 0.72);
  box-shadow: 0 1px 0 rgba(157, 15, 74, 0.08);
}

.tab {
  margin: 0;
  padding: 0.45rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: #fff;
  color: var(--gold);
  box-shadow: 0 2px 10px rgba(157, 15, 74, 0.12);
}

.panel[hidden] {
  display: none;
}

#panel-rules .hello {
  margin-top: 1.4rem;
}

#rules-title {
  margin-top: 2.4rem;
}

h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hello,
.lede,
.hero p {
  margin: 0.15rem 0;
}

.lede {
  margin-top: 1.1rem;
  color: var(--muted);
}

.mark {
  color: var(--gold);
  font-weight: 700;
}

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rules > li {
  position: relative;
  margin: 0 0 1.7rem;
  padding-left: 2.1rem;
  counter-increment: rule;
}

.rules > li::before {
  content: counter(rule) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-weight: 800;
}

.rules p {
  margin: 0 0 0.45rem;
}

.example {
  margin: 0.7rem 0 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--panel);
}

.example p {
  margin: 0.15rem 0;
}

.label {
  display: inline-block;
  min-width: 3.2rem;
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.sep {
  margin: 0 0.35rem;
  color: #9a6074;
}

.good,
.bad {
  margin-left: 0.15rem;
  font-weight: 800;
}

.good {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

.sub {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.sub > li {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.35rem;
  margin: 0.55rem 0;
  color: var(--muted);
}

.sub .num {
  color: var(--gold);
  font-weight: 800;
}

.warn {
  margin-top: 2.4rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(192, 23, 43, 0.28);
  border-radius: 0.8rem;
  background: #ffe4ea;
}

.warn p {
  margin: 0.2rem 0;
}

.warn strong {
  color: var(--bad);
  font-weight: 800;
}

.schedule-intro {
  margin: 1.4rem 0 1rem;
}

.schedule-status {
  margin: 0 0 1rem;
  color: var(--muted);
}

.schedule-list {
  display: grid;
  gap: 1rem;
}

.schedule-card {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--panel);
}

.schedule-label {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.schedule-empty {
  margin: 0;
  color: var(--muted);
}

.schedule-date {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 700;
}

.schedule-text {
  white-space: pre-wrap;
}

.schedule-images {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.schedule-images img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.7rem;
}

.schedule-link {
  margin-top: 1.4rem;
}

.schedule-link a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.schedule-link a:hover {
  text-decoration: underline;
}

.read-check {
  margin-top: 2.2rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--panel);
}

.read-check-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.read-check-label input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold);
}

.read-check-label input:disabled {
  cursor: not-allowed;
}

.read-check-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(42, 20, 28, 0.42);
}

.modal[hidden],
.modal-step[hidden] {
  display: none;
}

.modal-card {
  width: min(28rem, 100%);
  max-height: min(90vh, 42rem);
  overflow: auto;
  padding: 1.4rem 1.3rem 1.25rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(42, 20, 28, 0.18);
}

.modal-card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.25rem;
}

.modal-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.65;
  word-break: keep-all;
}

.modal-copy strong {
  color: var(--gold);
  word-break: break-word;
}

.oauth-notice {
  margin: 0 0 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  background: #fff6f9;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  word-break: keep-all;
}

.oauth-notice[hidden] {
  display: none;
}

.oauth-notice p {
  margin: 0;
}

.oauth-notice-title {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 800;
}

.oauth-notice ul {
  margin: 0.65rem 0;
  padding-left: 1.15rem;
}

.oauth-notice li + li {
  margin-top: 0.4rem;
}

.oauth-notice li strong {
  display: block;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.modal-actions-col {
  flex-direction: column;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-yes {
  flex: 1;
  background: var(--gold);
  color: #fff;
}

.btn-no {
  flex: 1;
  background: #f3e4ea;
  color: var(--text);
}

.nick-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.nick-input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fffafc;
  color: var(--text);
  font: inherit;
}

.nick-input:focus {
  outline: 2px solid rgba(157, 15, 74, 0.35);
  border-color: var(--gold);
}

.nick-error {
  margin: 0.45rem 0 0;
  color: var(--bad);
  font-size: 0.92rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .page {
    width: min(var(--width), calc(100% - 1.6rem));
    padding-top: 2.6rem;
  }

  body {
    font-size: 1rem;
  }

  .rules > li {
    padding-left: 1.8rem;
  }
}
