@font-face{font-family:"Black Han Sans";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/black-han-sans-400.ttf") format("truetype")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/ibm-plex-mono-400.ttf") format("truetype")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/ibm-plex-mono-600.ttf") format("truetype")}
@font-face{font-family:"IBM Plex Sans KR";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/ibm-plex-sans-kr-400.ttf") format("truetype")}
@font-face{font-family:"IBM Plex Sans KR";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/ibm-plex-sans-kr-600.ttf") format("truetype")}
@font-face{font-family:"IBM Plex Sans KR";font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/ibm-plex-sans-kr-700.ttf") format("truetype")}

:root {
  color-scheme: light;
  --paper: #f1e8d6;
  --paper2: #fbf6ec;
  --card: #fdfaf3;
  --ink: #231d16;
  --ink2: #5c5347;
  --muted: #8a8073;
  --line: #d7cab1;
  --line2: #e6dcc7;
  --accent: #d8442c;
  --accent-deep: #b3331e;
  --accent-wash: #f7e0d9;
  --bad: #c0392b;
  --bad-wash: #f7e0db;
  --sh-rgb: 35, 29, 22;
  --shadow: 6px 6px 0 rgba(var(--sh-rgb), .13);
  --shadow-sm: 3px 3px 0 rgba(var(--sh-rgb), .16);
  --disp: "Black Han Sans", "IBM Plex Sans KR", system-ui, sans-serif;
  --sans: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* 기존 선택자와의 호환용 별칭 */
  --fg: var(--ink);
  --border: var(--line);
  --bg: var(--paper);
  --surface: var(--card);
  --pin-bg: var(--accent-wash);
  --pin-border: var(--accent);
  --button-bg: var(--paper2);
  --primary-fg: #fff;
  --error: var(--bad);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15120e;
  --paper2: #211b15;
  --card: #1b1611;
  --ink: #f1e7d5;
  --ink2: #cabda6;
  --muted: #90836e;
  --line: #39301f;
  --line2: #2b2318;
  --accent: #f4593c;
  --accent-deep: #c23d28;
  --accent-wash: #3a201a;
  --bad: #ff6f5e;
  --bad-wash: #2c1714;
  --sh-rgb: 0, 0, 0;
  --primary-fg: #fff;
}

* { box-sizing: border-box; }
html {
  min-width: 280px;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -.005em;
}
button, input, textarea { font: inherit; color: inherit; }

#app {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px 16px 72px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 4px 18px;
  border-bottom: 2px solid var(--ink);
}
.site-header h1 {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  margin: 0;
  font-family: var(--disp);
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}
.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notice-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.notice-card::before,
.notice-card::after {
  position: absolute;
  top: 49px;
  width: 12px;
  height: 20px;
  content: "";
  background: var(--paper);
}
.notice-card::before {
  left: -1px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
}
.notice-card::after {
  right: -1px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
}
.notice-card.pinned {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.notice-card.pinned::before,
.notice-card.pinned::after { border-color: var(--accent); }
.notice-card h2 {
  margin: 0 -18px 14px;
  padding: 0 30px 13px;
  border-bottom: 1px dashed var(--line);
  font-size: 1.08rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.notice-body {
  margin: 0 0 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.notice-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
}
.empty-state {
  margin: 18px 0;
  border: 1px dashed var(--line);
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.admin-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.admin-panel h2,
.admin-panel h3 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.admin-panel form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.admin-panel label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
}
.admin-panel input[type="text"],
.admin-panel input[type="password"],
.admin-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: var(--paper2);
  color: var(--ink);
}
.admin-panel textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.65;
}

button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--paper2);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--paper); }
button.primary {
  border-color: var(--accent-deep);
  background: var(--accent);
  color: var(--primary-fg);
}
button.primary:hover { background: var(--accent-deep); }
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 17px;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--ink);
  background: var(--paper2);
}
.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.notice-actions button:last-child {
  border-color: var(--bad);
  color: var(--bad);
}
.site-footer {
  margin-top: 36px;
  text-align: center;
}
.admin-toggle {
  min-height: auto;
  border: 0;
  padding: 6px;
  background: none;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-error {
  min-height: 1.1em;
  color: var(--bad);
  font-size: .82rem;
}

@media (max-width: 360px) {
  #app { padding: 10px 10px 56px; }
  .site-header { gap: 8px; padding: 10px 2px 14px; }
  .site-header h1 {
    min-width: 0;
    font-size: 1.65rem;
    white-space: nowrap;
  }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .theme-toggle { flex-basis: 36px; width: 36px; height: 36px; min-height: 36px; }
  .notice-card { padding: 15px; box-shadow: 4px 4px 0 rgba(var(--sh-rgb), .13); }
  .notice-card h2 { margin-inline: -15px; padding-inline: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 주황 코트 시각 체계 */
:root {
  --paper: #f3f0e8;
  --paper2: #fffaf1;
  --card: #fffdf8;
  --ink: #172238;
  --ink2: #465168;
  --muted: #737b89;
  --line: #cbd0d8;
  --line2: #e5e2da;
  --accent: #f26a21;
  --accent-deep: #cf4d0c;
  --accent-wash: #fde3d2;
  --sh-rgb: 23, 34, 56;
  --court-line: rgba(23, 34, 56, .055);
  --sport-white: #fffaf1;
  --sport-navy: #172238;
  --sport-navy-deep: #0d1525;
}
:root[data-theme="dark"] {
  --paper: #0d1421;
  --paper2: #172133;
  --card: #111b2b;
  --ink: #f5f1e8;
  --ink2: #c1c7d2;
  --muted: #8d97a8;
  --line: #344158;
  --line2: #263247;
  --accent: #ff7a2f;
  --accent-deep: #e65713;
  --accent-wash: #3a2419;
  --sh-rgb: 0, 0, 0;
  --court-line: rgba(255, 255, 255, .045);
  --sport-white: #fffaf1;
  --sport-navy: #111b2b;
  --sport-navy-deep: #080d17;
}
body {
  background-image:
    linear-gradient(var(--court-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--court-line) 1px, transparent 1px);
  background-size: 48px 48px;
}
.site-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 20px 18px;
  border: 0;
  border-bottom: 7px solid var(--accent);
  border-radius: 16px 16px 8px 8px;
  color: var(--sport-white);
  background: linear-gradient(118deg, var(--sport-navy-deep), var(--sport-navy));
  box-shadow: 0 12px 28px rgba(var(--sh-rgb), .18);
}
.site-header::before {
  position: absolute;
  right: -38px;
  bottom: -76px;
  width: 170px;
  height: 170px;
  border: 27px solid var(--accent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.site-header::after {
  position: absolute;
  top: -30px;
  right: 98px;
  width: 27px;
  height: 145px;
  content: "";
  background: var(--accent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.site-header h1,
.site-header .theme-toggle { position: relative; z-index: 1; }
.site-header .theme-toggle { border-color: var(--sport-white); color: var(--sport-white); }
.site-header .theme-toggle:hover { background: var(--sport-white); color: var(--sport-navy); }
.notice-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--sport-navy);
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(var(--sh-rgb), .11);
}
.notice-card::before,
.notice-card::after { content: none; }
.notice-card.pinned {
  border-color: var(--accent);
  border-top-color: var(--accent);
}
.notice-card h2 {
  position: relative;
  padding-right: 74px;
  border-bottom-style: solid;
}
.notice-card h2::after {
  position: absolute;
  top: 5px;
  right: 24px;
  width: 36px;
  height: 7px;
  border-radius: 999px;
  content: "";
  background: var(--accent);
}
.admin-panel {
  border: 1px solid var(--line);
  border-top: 4px solid var(--sport-navy);
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(var(--sh-rgb), .11);
}
.admin-panel input[type="text"],
.admin-panel input[type="password"],
.admin-panel textarea,
button,
.theme-toggle {
  border-radius: 8px;
}
button { box-shadow: none; }
button:active { transform: translateY(1px); box-shadow: none; }
.primary-button { box-shadow: inset 0 -3px 0 rgba(var(--sh-rgb), .16); }
.notice-meta { letter-spacing: .02em; }

@media (max-width: 520px) {
  .site-header {
    padding: 17px 12px;
    border-bottom-width: 6px;
    border-radius: 12px 12px 7px 7px;
  }
  .site-header::before { right: -62px; bottom: -94px; }
  .site-header::after { right: 70px; width: 20px; }
  .notice-card { box-shadow: 0 7px 17px rgba(var(--sh-rgb), .1); }
  .notice-card h2 { padding-right: 27px; }
  .notice-card h2::after { display: none; }
  .admin-panel input[type="text"],
  .admin-panel input[type="password"],
  .admin-panel textarea { font-size: 16px; }
}
