/* Minecraft-inspired theme */
/* Default = Dark theme (mainstream neutrals + blue accent) */
:root {
  --bg: #0f172a;           /* slate-900 */
  --bg-accent: #111827;     /* gray-900 */
  --text: #e5e7eb;          /* gray-200 */
  --muted: #94a3b8;         /* slate-400 */
  --primary: #3b82f6;       /* blue-500 */
  --accent: #2563eb;        /* blue-600 */
  --panel: #111827;         /* gray-900 */
  --border: rgba(148,163,184,0.25); /* slate-400 at 25% */
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-accent: #f8fafc;     /* slate-50 */
  --text: #0f172a;          /* slate-900 */
  --muted: #475569;         /* slate-600 */
  --primary: #2563eb;       /* blue-600 */
  --accent: #1d4ed8;        /* blue-700 */
  --panel: #ffffff;
  --border: rgba(15,23,42,0.10); /* slate-900 at 10% */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Minecraftia", "Press Start 2P", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

.mc-header {
  background: rgba(17, 24, 39, 0.85);       /* 어두운 모드: 조금 덜 투명 */
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;                             /* 다른 요소보다 위에 오도록 */
  backdrop-filter: blur(10px) saturate(1.1); /* 배경 흐림 + 채도 살짝 업 */
}
.mc-header .container { display: flex; align-items: center; justify-content: space-between; }
.mc-header .brand { color: var(--text); text-decoration: none; font-weight: 700; display: inline-flex; gap: 10px; align-items: center; }
.mc-header nav a { color: var(--muted); margin-left: 16px; text-decoration: none; }
.mc-header nav a:hover { color: var(--text); }
/* Light header */
[data-theme="light"] .mc-header { background: rgba(255,255,255,0.92); }
/* Theme toggle button */
.theme-btn { margin-left: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.theme-btn:hover { filter: brightness(1.08); }

.mc-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 24px 0; text-align: center; margin-top: 32px; }
[data-theme="light"] .mc-footer { background: rgba(255,255,255,.6); }

.hero { position: relative; text-align: center; padding: 56px 0 40px; overflow: hidden; }
.hero h1 { font-size: 32px; margin: 0 0 10px; text-shadow: 0 2px 0 rgba(0,0,0,0.5); }
.hero p { color: var(--muted); margin: 0; }
.hero .hero-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; }
.hero .grid-bg { display: none; }
.hero.hero-glow::after { display: none; }

/* Hero with image */
.hero.hero-split { text-align: left; }
.hero-wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: center; }
.hero-media { display: flex; justify-content: center; }
.hero-media img { width: 100%; max-width: 560px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 20px 40px rgba(0,0,0,0.35); }
@media (max-width: 900px) { .hero-wrap { grid-template-columns: 1fr; } .hero { text-align: center; } }

.adventure { padding: 24px 16px; }
.adventure-wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
.adventure-copy h2 { margin: 0 0 8px; }
.adventure-copy p { margin: 0 0 12px; color: var(--muted); }
.adventure-points { margin: 0 0 14px; padding-left: 18px; }
.adventure-points li { margin: 6px 0; }
.map-frame { border-radius: 16px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.35); }
.map-frame img { width: 100%; display: block; image-rendering: -webkit-optimize-contrast; }
.adventure .hint { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); margin-top: 8px; }
@media (max-width: 900px) { .adventure-wrap { grid-template-columns: 1fr; } }

/* Modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal.show { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); z-index: 1999; }
.modal-dialog { position: relative; width: min(760px, 92%); z-index: 2001; }
.modal-content { position: relative; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }

/* Modal card stack */
.card-stack { display: grid; gap: 14px; }
.card-item { border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.02); padding: 14px; }
.card-item.title-card { text-align: center; }
.card-item.title-card h2 { margin: 6px 0 10px; }
.card-item.media-card .map-frame { margin: 0; }
.card-item.body-card p { margin: 0; color: var(--muted); }
.card-item.points-card .adventure-points { margin: 0; padding-left: 18px; }
.card-item.points-card li { margin: 6px 0; }
.card-item.tip-card .hint { display: flex; }
.actions.center { justify-content: center; }

/* Constrain GIF size inside modal */
.modal .media-card .map-frame { max-width: 520px; margin: 0 auto; }
.modal .media-card .map-frame img { max-height: 300px; width: 100%; height: auto; object-fit: contain; }
@media (max-width: 480px) {
  .modal .media-card .map-frame { max-width: 100%; }
  .modal .media-card .map-frame img { max-height: 200px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.panel-spotlight { position: relative; }
.panel-spotlight::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(120deg, rgba(63,185,80,.7), rgba(46,160,67,.7), rgba(46,160,67,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.panel.center { text-align: center; }
.panel h2 { margin-top: 0; }

.info-list { margin: 0; padding-left: 18px; }
.info-list li { margin: 8px 0; }

.steps { margin: 0; padding-left: 18px; }
.steps li { margin: 8px 0; }

code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 6px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 14px; color: #00190a; background: var(--primary);
  border-radius: 8px; text-decoration: none; font-weight: 700; border: 2px solid #1f6f2a;
  box-shadow: 0 4px 0 #1b5a24; transition: transform .05s ease-in-out, background .2s;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1b5a24; }
.btn.btn-secondary { background: #2f81f7; border-color: #1b4fb3; box-shadow: 0 4px 0 #1b4fb3; color: #001028; }
.btn.btn-secondary:hover { background: #1f6feb; }
.btn.btn-mini { padding: 4px 8px; font-size: 12px; box-shadow: 0 3px 0 #1b5a24; }
.btn.copied { filter: hue-rotate(-20deg) saturate(1.2); }

/* Modern pill buttons for external/brand actions */
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 9999px; font-weight: 800; text-decoration: none;
  border: 1.5px solid var(--border); background: var(--panel); color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.20);
  transition: transform .06s ease, box-shadow .2s, filter .2s, background .2s;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn-pill {
  flex: 1 1 0;       /* 남은 공간 동일 분배 */
  min-width: 140px;  /* 최소 폭 */
  height: 44px;      /* 동일 높이 */
}
.btn-pill:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(0,0,0,0.28); }
.btn-pill:active { transform: translateY(1px); }
.btn-pill i { font-size: 16px; }

.btn-brand { background: var(--primary); color: #fff; border-color: rgba(0,0,0,0.15); box-shadow: 0 8px 20px rgba(37,99,235,0.35); }
.btn-brand:hover { background: var(--accent); }

.btn-discord { background: #5865F2; color: #fff; border-color: rgba(0,0,0,0.15); box-shadow: 0 8px 20px rgba(88,101,242,0.35); }
.btn-discord:hover { background: #4752C4; }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: rgba(148,163,184,0.12); }

.btn-mini { padding: 6px 10px; font-size: 12px; box-shadow: none; border-width: 1px; }

/* Theme toggle: make it obvious, high-contrast, accessible */
/* New segmented theme toggle with Font Awesome */
.theme-toggle {
  position: relative; display: inline-grid; grid-auto-flow: column; align-items: center;
  gap: 0; margin-left: 12px; padding: 4px; border-radius: 12px; background: var(--panel);
  border: 1.5px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.25); overflow: hidden;
}
.theme-option {
  box-sizing: border-box; position: relative; appearance: none; background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 8px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700;
}
.theme-option .label { font-size: 12px; display: none; }
@media (min-width: 640px) { .theme-option .label { display: inline; } }
.theme-option:hover { color: var(--text); }
.theme-option[aria-pressed="true"] { color: var(--text); }
.theme-option i.fa-sun { color: #fbbf24; }
.theme-option i.fa-moon { color: #60a5fa; }
.theme-slider {
  position: absolute; inset: 4px; width: calc(50% - 4px); border-radius: 8px; background: rgba(148,163,184,0.15);
  transform: translateX(0%); transition: transform .2s ease;
}
[data-theme="dark"] .theme-slider { transform: translateX(calc(100%)); }

@media (max-width: 520px) {
  .hero h1 { font-size: 22px; }
}

