/* mc.css — Minecraft server page (requires theme.css)
   Shared page chrome (.page-wrap, .bg-deco, .bg-orb base, .sparkle,
   .page-header, h1, p) lives in theme.css. Only per-page orb color
   palette + .page layout go here. */

.bg-orb { opacity: 0.22; }  /* mc orbs are a touch brighter than default */
.orb1 { --c: #b8d8f8; width: 500px; height: 500px; top: -150px; left: -150px; }
.orb2 { --c: #f0c8e8; width: 380px; height: 380px; bottom: -80px; right: -100px; }

/* ── Layout ── */
.page {
  max-width: 860px;
  margin: 0 auto;
  position: relative; z-index: 1;
}

/* ── Glass card ── */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--surface-hover);
  border-radius: 18px; padding: 22px 24px;
  position: relative; margin-bottom: 14px;
}

.section-label {
  font-size: 10px; letter-spacing: 3px; color: var(--text3);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(170,204,232,0.35); }

/* ── Header ── */
.card-header { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.server-icon-wrap { position: relative; flex-shrink: 0; }
.server-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: var(--accent-gradient);
  border: 2px solid var(--surface-hover);
  box-shadow: 0 4px 14px rgba(var(--blue-rgb), 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; animation: bob 3.5s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.av-star {
  position: absolute; font-size: 11px; color: var(--blue);
  --or: 44px; /* slightly wider orbit than the songs-page avatar */
  animation: av-orbit var(--od, 4s) linear infinite;
  top: 50%; left: 50%; transform-origin: 0 0;
}
/* av-orbit lives in theme.css */
.title-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-gradient);
  border-radius: 20px; padding: 2px 10px;
  font-size: 10px; letter-spacing: 1.5px; color: var(--blue2); margin-bottom: 7px; font-weight: 500;
}
.card-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 500; line-height: 1.2; letter-spacing: 1px;
}
.card-title .name {
  background: linear-gradient(135deg, var(--blue2) 20%, var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.card-sub { font-size: 12px; color: var(--text3); margin-top: 5px; letter-spacing: 0.5px; }

/* ── Status strip ── */
:root { --green: #5cb88a; --red: #e07070; }

.status-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.status-pill {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-muted); border: 1px solid var(--surface);
  border-radius: 14px; padding: 10px 14px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text3); flex-shrink: 0; animation: dpulse 2s ease-in-out infinite;
}
.dot.online { background: var(--green); }
.dot.offline { background: var(--red); }
@keyframes dpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.pill-label { font-size: 10px; letter-spacing: 1px; color: var(--text3); }
.pill-value { font-weight: 500; color: var(--text); font-size: 13px; }
.pill-value.online-val { color: var(--green); }
.pill-value.offline-val { color: var(--red); }
.loading { animation: shimmer 1.2s ease-in-out infinite; }
@keyframes shimmer { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
/* spin lives in theme.css */

.refresh-row { display: flex; justify-content: flex-end; }
.refresh-btn {
  display: flex; align-items: center; gap: 5px; padding: 5px 13px; border-radius: 20px;
  border: 1px solid var(--surface-hover); background: var(--surface);
  color: var(--text2); font-size: 11px; font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer; letter-spacing: 0.5px; transition: all 0.18s;
}
.refresh-btn:hover { border-color: var(--surface-strong); color: var(--text); background: var(--surface-strong); }
.refresh-btn:active { transform: scale(0.95); }

/* ── Node grid ── */
.node-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.node-card {
  background: var(--surface-muted); border: 1px solid var(--surface);
  border-radius: 14px; padding: 16px; position: relative; overflow: hidden;
}
.node-card::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 0 2px 2px 0;
}
.node-card.main::before { background: linear-gradient(180deg, var(--blue2), var(--blue)); }
.node-card.relay::before { background: linear-gradient(180deg, #c8382a, #e06060); }
.node-flag { font-size: 20px; margin-bottom: 6px; }
.node-badge {
  display: inline-block;
  font-size: 9px; font-weight: 600; letter-spacing: .3px;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(var(--blue-rgb), 0.15);
  color: var(--blue2);
  vertical-align: 2px;
}
.node-name { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 4px; }
.node-addr { font-size: 13px; font-weight: 500; color: var(--blue2); margin-bottom: 5px; word-break: break-all; }
.node-desc { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 12px; }

.copy-addr-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--surface-hover); background: var(--surface);
  color: var(--text2); font-size: 11px; font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer; transition: all 0.18s;
}
.copy-addr-btn:hover { border-color: var(--surface-strong); color: var(--text); }
.copy-addr-btn:active { transform: scale(0.95); }
.copy-addr-btn.copied { border-color: rgba(92,184,138,0.55); color: var(--green); }

/* ── Tabs ── */
.mc-tab-row {
  display: flex; gap: 4px; background: var(--surface-muted);
  border: 1px solid var(--surface-hover); border-radius: 12px; padding: 3px;
  width: fit-content; margin-bottom: 18px;
}
.mc-tab-btn {
  padding: 7px 22px; border-radius: 9px; border: none; background: none;
  font-size: 13px; font-family: 'Noto Sans SC', sans-serif; font-weight: 500;
  color: var(--text3); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.mc-tab-btn.active {
  background: linear-gradient(135deg, var(--blue2), var(--blue)); color: white;
  box-shadow: 0 2px 8px rgba(90,160,204,0.28);
}
.mc-tab-btn:not(.active):hover { color: var(--blue2); background: rgba(90,160,204,0.08); }
.mc-tab-content { display: none; }
.mc-tab-content.active { display: block; }

/* ── Info grid ── */
.info-grid { display: flex; flex-direction: column; }
.info-item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 0; border-bottom: 1px solid rgba(170,204,232,0.2);
}
.info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-item:first-child { padding-top: 0; }
.info-icon {
  font-size: 20px; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #d4eaff, #cce0f8);
  display: flex; align-items: center; justify-content: center;
}
.info-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.info-desc { font-size: 12px; color: var(--text2); line-height: 1.7; }
.info-desc a { color: var(--blue2); text-decoration: none; font-size: 11px; }

code {
  font-family: monospace; font-size: 11px;
  background: rgba(90,160,204,0.10);
  border: 1px solid rgba(90,160,204,0.2);
  border-radius: 5px; padding: 1px 6px; color: var(--blue2);
}

/* ── Server icon image (hidden until live fetch resolves) ── */
.mc-server-icon-img {
  width: 100%; height: 100%;
  border-radius: 14px;
  image-rendering: pixelated;
  object-fit: cover;
}

/* ── Info panes (motd, Java/基岩 row, architecture note) ── */
.mc-info-pane {
  margin-bottom: 14px;
  padding: 9px 13px;
  background: var(--surface-hover);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text3);
}
/* Hide entirely when the motd fetch returned nothing — avoids an empty
   14px-margin pane before the status strip. */
.mc-info-pane[hidden] { display: none; }
.mc-info-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 14px;
  color: var(--text2);
}
.mc-info-row strong { color: var(--blue2); }
.mc-info-row-icon { font-size: 15px; flex-shrink: 0; }
.mc-arch-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 18px; padding: 11px 14px;
  color: var(--text2); line-height: 1.8;
}
.mc-arch-note .mc-info-row-icon { font-size: 18px; margin-top: 1px; }
.mc-arch-note strong { color: var(--blue2); }

/* ── Paper / Forge variant cards ── */
.mc-variant-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 18px;
}
.mc-variant {
  padding: 10px 13px;
  border: 1.5px solid;
  border-radius: 12px;
  font-size: 12px; color: var(--text2); line-height: 1.6;
}
.mc-variant-title { font-weight: 500; }
.mc-variant-paper {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}
.mc-variant-paper .mc-variant-title { color: var(--ok); }
.mc-variant-forge {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}
.mc-variant-forge .mc-variant-title { color: var(--guard-2); }

/* ── BlueMap card ── */
.bluemap-card { padding: 0; overflow: hidden; }
.bluemap-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.bluemap-head-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.bluemap-head-icon { font-size: 16px; }
.bluemap-head-link {
  font-size: 11px; color: var(--blue2);
  text-decoration: none; opacity: 0.8;
}
.bluemap-frame-wrap {
  position: relative;
  height: clamp(300px, 50vw, 520px);
  background: var(--surface-muted);
}
.bluemap-frame-wrap iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.bluemap-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  color: var(--text3); font-size: 12px;
  pointer-events: none;
}
.bluemap-spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(var(--blue-rgb), 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Contact card ── */
.mc-contact {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 22px;
}
.mc-contact-icon { font-size: 24px; flex-shrink: 0; }
.mc-contact-text {
  font-size: 13px; color: var(--text2); line-height: 1.7;
}

/* ── Toast ── */
#mcToast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(40,100,160,0.88); backdrop-filter: blur(12px);
  color: #fff; padding: 10px 22px; border-radius: 30px;
  font-size: 13px; opacity: 0;
  transition: opacity 0.25s, transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; z-index: 9999; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(40,100,160,0.25);
}
#mcToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 700px) {
  .node-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .status-strip { grid-template-columns: 1fr 1fr; }
  .glass-card { padding: 18px 16px; }
  .card-header { gap: 12px; }
  .server-icon { width: 56px; height: 56px; font-size: 30px; }
  .card-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .node-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 375px) {
  .glass-card { padding: 16px 14px; }
  .status-strip { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; text-align: center; gap: 12px; }
}
