:root {
  --bg: #f3ece5;
  --paper: rgba(255, 250, 246, 0.9);
  --ink: #23191a;
  --muted: #7a6662;
  --line: rgba(87, 31, 36, 0.14);
  --accent: #8f2731;
  --accent-deep: #661922;
  --secondary: #b4474a;
  --danger: #6f1318;
  --shadow: 0 24px 60px rgba(74, 18, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  font-family: "IBM Plex Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 39, 49, 0.16), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(180, 71, 74, 0.14), transparent 24%),
    linear-gradient(160deg, #f8f1eb 0%, #ead8cd 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

code {
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  background: rgba(143, 39, 49, 0.08);
  font-family: inherit;
  font-size: 0.92em;
}

.site-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(248, 241, 235, 0.8);
  border-bottom: 1px solid rgba(111, 19, 24, 0.08);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
}

.site-nav a:hover {
  background: rgba(143, 39, 49, 0.08);
}

.nav-button,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
}

.nav-button,
.primary-link {
  color: #fff;
  background: var(--accent);
}

.secondary-link {
  color: var(--ink);
  background: rgba(143, 39, 49, 0.08);
}

.disabled-link {
  opacity: 0.8;
  cursor: default;
}

.home-shell {
  padding: 38px 0 56px;
}

.home-shell-photo {
  position: relative;
  isolation: isolate;
  margin-bottom: 24px;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.home-shell-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--home-team-photo);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: -2;
}

.home-shell-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 241, 235, 0.18), rgba(248, 241, 235, 0.78)),
    linear-gradient(90deg, rgba(143, 39, 49, 0.22), transparent 55%);
  z-index: -1;
}

.home-hero,
.story-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.home-hero {
  align-items: stretch;
  margin-bottom: 24px;
}

.home-hero-stacked {
  grid-template-columns: 1fr;
}

.home-photo-message {
  display: grid;
  gap: 10px;
  min-height: 520px;
  align-content: end;
  padding: 52px 32px;
  color: #fff9f4;
}

.home-photo-kicker {
  color: rgba(255, 245, 239, 0.82);
}

.home-photo-message h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.home-photo-message p {
  max-width: 38rem;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(255, 244, 238, 0.9);
}

.hero-copy-block,
.logo-card,
.info-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-copy-block {
  padding: 34px;
}

.hero-copy-block h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.home-lead {
  max-width: 42rem;
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.7;
  color: #4c3d3d;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.refresh-note {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.logo-card {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.logo-card-centered {
  justify-items: center;
  text-align: center;
}

.team-logo {
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: block;
}

.logo-note,
.section-note,
.match-date {
  color: var(--muted);
}

.content-section {
  margin-top: 28px;
}

.form-shell {
  padding: 38px 0 56px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.route-card {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.info-panel h2,
.info-panel h3 {
  margin: 0;
}

.info-panel {
  padding: 24px;
}

.highlight-panel {
  background:
    radial-gradient(circle at top right, rgba(143, 39, 49, 0.1), transparent 40%),
    rgba(255, 252, 247, 0.92);
}

.officer-grid,
.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.role-chip {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(143, 39, 49, 0.09);
  font-size: 0.88rem;
  font-weight: 700;
}

.officer-card,
.match-card {
  display: grid;
  gap: 12px;
}

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-link {
  width: fit-content;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-guide {
  margin-bottom: 18px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.member-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.member-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 244, 0.9);
}

.member-body {
  display: grid;
  gap: 12px;
}

.member-body p {
  margin: 0;
  color: #4c3d3d;
}

.member-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.member-meta-row h2 {
  margin: 0;
}

.member-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.player-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.member-empty {
  text-align: center;
}

.editor-form {
  display: grid;
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.admin-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 220px);
}

.admin-login-card {
  width: min(520px, 100%);
}

.admin-error {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(111, 19, 24, 0.08);
  color: var(--danger);
  font-weight: 700;
}

.admin-preview {
  display: grid;
  gap: 16px;
  align-content: start;
}

.admin-preview-thumb {
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 247, 242, 0.92);
}

.editor-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.editor-form input,
.editor-form select,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
}

.detail-panel {
  display: grid;
  gap: 16px;
}

.detail-copy {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: #40494f;
}

.comment-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px 18px;
}

.comment-card p {
  margin: 10px 0 0;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.compact-form {
  align-content: start;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.draft-shell {
  padding-top: 26px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow,
.panel-kicker,
.stat-label,
.player-meta {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--muted);
}

.hero h1,
.panel h2 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.96;
  margin-bottom: 12px;
}

.hero-copy {
  max-width: 46rem;
  margin: 0;
  font-size: 1.02rem;
  color: #4c3d3d;
}

.hero-stats,
.teams-grid {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px 20px;
}

.stat-card strong {
  display: block;
  font-size: 1.3rem;
  margin-top: 8px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(0, 1.35fr);
  gap: 20px;
}

.panel {
  padding: 22px;
}

.panel-header,
.team-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.player-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}

.player-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 249, 245, 0.9);
}

button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
}

.button-secondary {
  background: var(--secondary);
}

.button-danger {
  background: var(--danger);
}

.button-ghost {
  color: var(--ink);
  background: rgba(143, 39, 49, 0.08);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.player-list,
.team-roster {
  display: grid;
  gap: 12px;
}

.player-card,
.roster-item,
.empty-state,
.empty-team {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 249, 245, 0.85);
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.player-card-stacked {
  align-items: flex-start;
}

.player-name {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
}

.member-pool-list {
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding-right: 4px;
}

.draft-subsection {
  margin-top: 10px;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.teams-grid {
  grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.team-panel {
  min-height: 360px;
  overflow: hidden;
}

.team-0 {
  border-top: 6px solid #8f2731;
}

.team-1 {
  border-top: 6px solid #b4474a;
}

.team-2 {
  border-top: 6px solid #5f1720;
}

.roster-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(143, 39, 49, 0.08);
  font-weight: 700;
}

.roster-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 252, 249, 0.96), rgba(252, 242, 236, 0.92));
  box-shadow: 0 14px 28px rgba(95, 23, 32, 0.08);
}

.roster-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.roster-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.roster-title {
  display: block;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.roster-detail {
  color: #6d5353;
  font-size: 0.95rem;
  font-weight: 600;
}

.empty-state,
.empty-team {
  padding: 22px 18px;
  color: var(--muted);
}

.button-team {
  min-width: 64px;
}

.team-button-0 {
  background: #8f2731;
}

.team-button-1 {
  background: #b4474a;
}

.team-button-2 {
  background: #5f1720;
}

.button-small {
  padding: 9px 12px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.empty-state p,
.empty-team p {
  margin: 0 0 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1024px) {
  .home-hero,
  .comment-layout,
  .story-grid,
  .route-grid,
  .admin-grid,
  .member-grid,
  .hero,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .officer-grid,
  .match-grid,
  .teams-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .page-shell {
    width: min(100% - 20px, 1200px);
  }

  .page-shell {
    padding-top: 20px;
  }

  .member-card,
  .admin-item,
  .nav-row,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .hero-stats,
  .player-form {
    grid-template-columns: 1fr;
  }

  .player-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .roster-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .roster-item form,
  .roster-item button {
    width: 100%;
  }

  .home-shell-photo::before,
  .home-shell-photo::after {
    border-radius: 28px;
  }

  .home-shell {
    padding-top: 20px;
  }

  .home-photo-message {
    min-height: 360px;
    padding: 34px 16px;
  }

  .home-photo-message p {
    font-size: 0.96rem;
  }
}
