﻿/* =============================================
   Window Monitor ? Flygeon ????
   OKLCH ?? ? ????? ? ???? ? ???
   ============================================= */

:root {
  --hue: 250;
  --page-bg: oklch(0.14 0.01 var(--hue));
  --card-bg: oklch(0.18 0.01 var(--hue));
  --card-border: oklch(1 0 0 / 0.06);
  --card-hover-border: oklch(0.6 0.12 var(--hue) / 0.25);
  --divider: oklch(1 0 0 / 0.08);
  --text-primary: oklch(0.92 0 0);
  --text-secondary: oklch(0.65 0.01 var(--hue));
  --text-muted: oklch(0.45 0.01 var(--hue));
  --accent: oklch(0.62 0.18 var(--hue));
  --accent-glow: oklch(0.62 0.18 var(--hue) / 0.3);
  --green: oklch(0.6 0.18 160);
  --green-bg: oklch(0.6 0.18 160 / 0.08);
  --green-border: oklch(0.6 0.18 160 / 0.2);
  --red: oklch(0.55 0.2 25);
  --red-bg: oklch(0.55 0.2 25 / 0.08);
  --red-border: oklch(0.55 0.2 25 / 0.2);
  --radius: 18px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { width: 100%; max-width: 640px; }

/* ---- Header ---- */
.header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; background: var(--card-bg);
  padding: 16px 20px; border-radius: var(--radius);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  animation: headerSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.35s ease, background 0.35s ease;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }

/* ---- Status Dot ---- */
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 12px var(--green);
  flex-shrink: 0; position: relative; transition: all 0.5s ease;
}
.dot.off { background: var(--red); box-shadow: 0 0 12px var(--red); }
.dot::after {
  content: ''; position: absolute; top: -6px; left: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--green); opacity: 0;
  animation: dotPulse 2s ease-out infinite;
}
.dot.off::after { animation: none; opacity: 0; }

/* ---- Tag ---- */
.tag {
  font-size: 0.75rem; font-weight: 600;
  background: var(--green-bg); color: var(--green);
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--green-border);
  transition: all 0.4s ease;
}
.tag.off {
  background: var(--red-bg); color: var(--red);
  border-color: var(--red-border);
  animation: tagBlink 1s ease-in-out infinite;
}
.tag:not(.off) { animation: tagGlow 3s ease-in-out infinite; }

/* ---- Dashed Divider ---- */
.divider-dashed {
  border: none;
  border-top: 1px dashed var(--divider);
  margin: 8px 4px;
  transition: border-color 0.35s ease;
}

/* ---- Stack ---- */
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---- Card ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative; overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease, border-color 0.35s ease;
}
.card:nth-of-type(1) { animation: cardFadeUp 0.5s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both; }
.card:nth-of-type(2) { animation: cardFadeUp 0.5s 0.30s cubic-bezier(0.22, 1, 0.36, 1) both; }
.card:hover {
  transform: translateY(-2px);
  border-color: var(--card-hover-border);
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.25);
}
.card-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1.8px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

/* ---- Active Window ---- */
.active-content { transition: all 0.3s ease; }
.row { display: flex; align-items: center; gap: 14px; }
.icon-box {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: oklch(0.22 0.01 var(--hue));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; flex-shrink: 0;
  border: 1px solid var(--card-border);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.icon-box:active { transform: scale(0.93); }
.icon-box img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.info-box { flex: 1; min-width: 0; }
.window-title {
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  word-break: break-word; line-height: 1.4; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-secondary);
  background: oklch(1 0 0 / 0.04);
  padding: 4px 10px; border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease;
}
.elapsed-box {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--card-border);
  font-size: 0.78rem; color: var(--text-secondary);
}
.elapsed-box strong {
  color: var(--accent); font-weight: 600; margin-left: 2px;
  animation: timeGlow 2.5s ease-in-out infinite;
}

/* ---- Dead Overlay ---- */
.card.dead .active-content { opacity: 0.12; filter: blur(2px); pointer-events: none; }
.dead-overlay {
  display: none; position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  flex-direction: column; align-items: center; justify-content: center;
  z-index: 2; animation: deadFadeIn 0.5s ease both;
}
.card.dead .dead-overlay { display: flex; }
.dead-overlay .skull { font-size: 2rem; margin-bottom: 6px; }
.dead-overlay .msg { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Leaderboard ---- */
.leaderboard { display: flex; flex-direction: column; gap: 6px; }
.lb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: oklch(1 0 0 / 0.015);
  border: 1px solid oklch(1 0 0 / 0.03);
  animation: slideIn 0.25s ease-out both;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.lb-item:hover {
  background: oklch(1 0 0 / 0.04);
  border-color: oklch(1 0 0 / 0.06);
  transform: translateX(2px);
}
.lb-rank {
  width: 24px; text-align: center; font-size: 0.78rem;
  font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.lb-ico { font-size: 1rem; flex-shrink: 0; display: flex; align-items: center; }
.lb-ico img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }
.lb-name {
  width: 110px; font-size: 0.78rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.lb-bar-wrap {
  flex: 1; height: 6px; background: oklch(1 0 0 / 0.06);
  border-radius: 3px; overflow: hidden; position: relative;
}
.lb-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), oklch(0.7 0.15 var(--hue)));
  transition: width 0.6s ease;
}
.lb-stats {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; min-width: 105px; flex-shrink: 0;
}
.lb-time {
  font-size: 0.74rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums; text-align: right;
}
.lb-pct {
  font-size: 0.74rem; color: var(--accent); font-weight: 600;
  font-variant-numeric: tabular-nums; width: 40px; text-align: right;
}
.lb-empty { text-align: center; padding: 28px; color: var(--text-muted); font-size: 0.78rem; }

/* ---- Footer ---- */
.footer {
  text-align: center; margin-top: 28px;
  font-size: 0.68rem; color: var(--text-muted);
  transition: color 0.3s ease;
}
.footer a {
  color: var(--text-secondary); text-decoration: none;
  position: relative; transition: color 0.3s ease;
}
.footer a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width 0.3s ease;
}
.footer a:hover { color: var(--text-primary); }
.footer a:hover::after { width: 100%; }

/* ---- Page Loader ---- */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--page-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
  width: 44px; height: 44px; border-radius: 50%;
  position: relative; animation: ringSpin 1.2s linear infinite;
}
.loader-ring::before, .loader-ring::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid transparent;
}
.loader-ring::before {
  border-top-color: var(--accent);
  animation: ringPulse 1.5s ease-in-out infinite;
}
.loader-ring::after {
  inset: 5px; border-bottom-color: oklch(0.7 0.15 var(--hue));
  animation: ringPulse 1.5s ease-in-out 0.3s infinite;
}
.loader-label {
  font-size: 0.78rem; color: var(--text-muted);
  letter-spacing: 1px; animation: labelFade 2s ease-in-out infinite;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(1 0 0 / 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: oklch(1 0 0 / 0.18); }


/* ---- Card Pulse (window switch) ---- */
.card.pulse {
  animation: cardPulse 0.6s ease;
}
@keyframes cardPulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  40%  { box-shadow: 0 0 24px 4px var(--accent-glow); }
  100% { box-shadow: 0 0 0 0 var(--accent-glow); }
}
/* =============================================
   @keyframes
   ============================================= */

@keyframes slideIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes headerSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dotPulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes tagGlow {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.6 0.18 160 / 0); }
  50%      { box-shadow: 0 0 8px 2px oklch(0.6 0.18 160 / 0.15); }
}
@keyframes tagBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
@keyframes timeGlow {
  0%, 100% { color: var(--accent); text-shadow: 0 0 0 transparent; }
  50%      { color: oklch(0.75 0.12 var(--hue)); text-shadow: 0 0 6px var(--accent-glow); }
}
@keyframes deadFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes ringPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}
@keyframes labelFade {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

