/* ================================================================
   MYD SERVER — Main CSS
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --bg1: #e8f4f8;
  --bg2: #d4eaf3;
  --bg3: #c5e3ed;
  --blue: #5ba4cf;
  --cyan: #3dc8e8;
  --green: #5ddb9e;
  --sakura: #f0c8d4;
  --sakura2: #f0a8ba;
  --text: #1a3a4a;
  --muted: #4a7a8e;
  --card: rgba(255, 255, 255, 0.82);
  --card-hover: rgba(255, 255, 255, 0.92);
  --border: rgba(100, 180, 210, 0.3);
  --border2: rgba(60, 200, 230, 0.4);
  --header-bg: rgba(255, 255, 255, 0.88);
  --footer-bg: rgba(255, 255, 255, 0.4);
  --input-bg: rgba(255, 255, 255, 0.7);
  --orb-opacity: 0.45;
  --shadow: rgba(100, 180, 210, 0.1);
  --shadow-lg: rgba(60, 200, 230, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
}

body.dark {
  --bg1: #0d1a2d;
  --bg2: #132a45;
  --bg3: #0f1f35;
  --blue: #5cc0ff;
  --cyan: #1ae8ff;
  --green: #4dffa0;
  --sakura: #ffc2d0;
  --sakura2: #ff9db5;
  --text: #e4f2ff;
  --muted: #85b8d8;
  --card: rgba(18, 42, 68, 0.78);
  --card-hover: rgba(18, 42, 68, 0.92);
  --border: rgba(92, 192, 255, 0.22);
  --border2: rgba(26, 232, 255, 0.35);
  --header-bg: rgba(13, 26, 45, 0.9);
  --footer-bg: rgba(13, 26, 45, 0.5);
  --input-bg: rgba(13, 26, 45, 0.7);
  --orb-opacity: 0.25;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 200, 255, 0.1);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 30%, var(--bg3) 60%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.5s, color 0.5s;
  line-height: 1.6;
}

/* ── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.3;
}

.font-pixel {
  font-family: 'Press Start 2P', monospace;
}

.grad-text {
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-text-sakura {
  background: linear-gradient(90deg, var(--sakura), var(--sakura2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--muted); }
.text-cyan  { color: var(--cyan); }
.text-green { color: var(--green); }

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
}

section.section-sm {
  padding: 3rem 1.5rem;
}

/* ── Background Orbs ───────────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: var(--orb-opacity);
  transition: opacity 0.5s;
}

.bg-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(150, 210, 240, 0.5), transparent);
  top: 5%; left: -100px;
  animation: floatOrb1 18s ease-in-out infinite;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(180, 230, 210, 0.45), transparent);
  top: 40%; right: -80px;
  animation: floatOrb2 22s ease-in-out infinite;
}
.bg-orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(200, 220, 240, 0.5), transparent);
  bottom: 10%; left: 20%;
  animation: floatOrb3 20s ease-in-out infinite;
}
.bg-orb-4 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255, 200, 212, 0.3), transparent);
  top: 60%; left: 50%;
  animation: floatOrb4 16s ease-in-out infinite;
}
.bg-orb-5 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(140, 210, 230, 0.4), transparent);
  top: 20%; right: 20%;
  animation: floatOrb5 24s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, 30px) scale(1.15); }
  66% { transform: translate(40px, -20px) scale(0.85); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 20px) scale(0.9); }
  66% { transform: translate(-50px, -30px) scale(1.1); }
}
@keyframes floatOrb4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -40px) scale(1.2); }
}
@keyframes floatOrb5 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(35px, 25px) scale(1.1); }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan), var(--green));
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(60, 200, 230, 0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--card);
  color: var(--cyan);
  border: 1.5px solid var(--border2);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  box-shadow: 0 4px 20px var(--shadow-lg);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border2);
  color: var(--cyan);
}

.btn-danger {
  background: linear-gradient(135deg, #e8445a, #ff6b6b);
  color: #fff;
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 68, 90, 0.35);
}

.btn-pixel {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.btn-lg {
  padding: 1.1rem 2.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 32px var(--shadow-lg);
}

.card-glass {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ── Glassmorphism panel ───────────────────────────────────────── */
.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
body.dark .glass-panel {
  background: rgba(255, 255, 255, 0.03);
}

/* ── Section titles ────────────────────────────────────────────── */
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(12px, 2vw, 18px);
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.section-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-cyan {
  background: rgba(60, 200, 230, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(60, 200, 230, 0.25);
}

.badge-green {
  background: rgba(93, 219, 158, 0.12);
  color: var(--green);
  border: 1px solid rgba(93, 219, 158, 0.25);
}

.badge-sakura {
  background: rgba(240, 200, 212, 0.15);
  color: var(--sakura2);
  border: 1px solid rgba(240, 168, 186, 0.35);
}

/* ── Online dot ────────────────────────────────────────────────── */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 1.5s infinite;
  margin-right: 6px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ── IP Box ────────────────────────────────────────────────────── */
.ip-box {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(12px);
}
.ip-box:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-lg);
}
.ip-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--text);
}
.copy-btn {
  background: rgba(60, 200, 230, 0.12);
  color: var(--cyan);
  border: 1px solid var(--border2);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.copy-btn:hover { background: rgba(60, 200, 230, 0.22); }
.copy-btn.copied {
  background: rgba(93, 219, 158, 0.2);
  color: var(--green);
  border-color: rgba(93, 219, 158, 0.4);
}

/* ── Divider ───────────────────────────────────────────────────── */
.sakura-divider {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.8rem;
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
  color: var(--sakura2);
}

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(60, 200, 230, 0.15);
}

.form-input.error,
.form-select.error {
  border-color: #e8445a;
  box-shadow: 0 0 0 3px rgba(232, 68, 90, 0.12);
}

.form-select { cursor: pointer; }

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  font-size: 0.78rem;
  color: #e8445a;
  margin-top: 0.3rem;
}

/* ── Alerts / Flash messages ───────────────────────────────────── */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-success {
  background: rgba(93, 219, 158, 0.12);
  border: 1px solid rgba(93, 219, 158, 0.3);
  color: var(--green);
}

.alert-error {
  background: rgba(232, 68, 90, 0.1);
  border: 1px solid rgba(232, 68, 90, 0.3);
  color: #e8445a;
}

.alert-info {
  background: rgba(60, 200, 230, 0.1);
  border: 1px solid var(--border2);
  color: var(--cyan);
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb {
  background: rgba(100, 180, 210, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 200, 230, 0.5);
}

/* ── Utility ───────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

/* ── Reveal animation ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Loading spinner ───────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Status badge ──────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-pending    { background: rgba(255, 200, 0, 0.12); color: #ffcc00; border: 1px solid rgba(255, 200, 0, 0.3); }
.status-confirming { background: rgba(60, 200, 230, 0.1); color: var(--cyan); border: 1px solid var(--border2); }
.status-paid       { background: rgba(93, 219, 158, 0.12); color: var(--green); border: 1px solid rgba(93, 219, 158, 0.3); }
.status-granted    { background: rgba(93, 219, 158, 0.2); color: var(--green); border: 1px solid rgba(93, 219, 158, 0.4); }
.status-closed     { background: rgba(120, 120, 120, 0.1); color: var(--muted); border: 1px solid var(--border); }
.status-failed     { background: rgba(232, 68, 90, 0.1); color: #e8445a; border: 1px solid rgba(232, 68, 90, 0.3); }
.status-expired    { background: rgba(120, 120, 120, 0.1); color: var(--muted); border: 1px solid var(--border); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  section { padding: 3rem 1rem; }
  .btn { padding: 0.75rem 1.5rem; }
  .ip-box { flex-direction: column; gap: 0.75rem; text-align: center; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .btn-lg { padding: 0.9rem 1.75rem; font-size: 0.9rem; }
}
