#page-funtime {
  --ft-common: #a7b1c2;
  --ft-solid: #7fc7a3;
  --ft-rich: #5fa8ff;
  --ft-epic: #b46cff;
  --ft-legendary: #ffb627;
  --ft-luxury: #ff7ad9;
  --ft-mythic: #ff5fb4;
  --ft-live: #8ce7b4;
  --ft-warn: #ff8a94;
  --ft-surface: #121212;
  --ft-surface-2: #161616;
  --ft-line: rgba(255, 255, 255, 0.075);
  --ft-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

#page-funtime .ft-reveal { opacity: 0; transform: translateY(14px); }
#page-funtime.shown .ft-reveal {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-d), transform .8s var(--ease-d);
  transition-delay: calc(var(--d, 0) * 70ms);
}

.ft-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ft-head h1 { display: flex; align-items: center; gap: 14px; }
.ft-pro-chip {
  padding: 4px 10px; border-radius: 999px; font-family: var(--ft-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; color: #101010;
  background: linear-gradient(110deg, #f4f2ee 20%, #c9c1ff 45%, #8ce7b4 60%, #f4f2ee 80%);
  background-size: 250% 100%; animation: pro-sheen-bg 4.5s linear infinite;
}
.ft-live {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 30px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--ft-line); font-family: var(--ft-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.ft-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ft-live); flex: none; }
.ft-live i::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--ft-live);
  animation: ft-ping 1.8s var(--ease-d) infinite;
}
.ft-live.stale i, .ft-live.stale i::after { background: var(--ft-legendary); border-color: var(--ft-legendary); }
.ft-live.offline i { background: var(--ft-warn); }
.ft-live.offline i::after { display: none; }
@keyframes ft-ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

.ft-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.ft-stat {
  position: relative; overflow: hidden; isolation: isolate; padding: 20px 20px 18px; border-radius: 22px;
  border: 1px solid var(--ft-line); background: var(--ft-surface);
}
.ft-stat::before {
  content: ""; position: absolute; inset: -60% -20% auto auto; width: 180px; height: 180px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--ft-glow, rgba(176,166,255,0.22)), transparent);
  filter: blur(6px); transition: transform 1.2s var(--ease-d);
}
.ft-stat:hover::before { transform: translate(-18px, 14px) scale(1.15); }
.ft-stat:nth-child(2) { --ft-glow: rgba(140,231,180,0.18); }
.ft-stat:nth-child(3) { --ft-glow: rgba(95,168,255,0.2); }
.ft-stat:nth-child(4) { --ft-glow: rgba(255,182,39,0.16); }
.ft-stat small {
  display: block; font-family: var(--ft-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.ft-stat b {
  display: block; margin-top: 12px; font-size: 32px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ft-stat span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ft-seg {
  position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  border: 1px solid var(--ft-line); background: var(--ft-surface); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.ft-seg::-webkit-scrollbar { display: none; }
.ft-seg .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--text); z-index: 0;
  transition: transform .55s var(--spring-d), width .55s var(--spring-d);
}
.ft-seg button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: color .35s var(--ease-d);
}
.ft-seg button:hover { color: var(--text); }
.ft-seg button.active { color: #101010; }
.ft-seg button em {
  font-style: normal; font-family: var(--ft-mono); font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.07); color: inherit; transition: background .35s var(--ease-d);
}
.ft-seg button.active em { background: rgba(16,16,16,0.1); }

.ft-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.ft-search { position: relative; flex: 1 1 260px; min-width: 0; }
.ft-search svg { position: absolute; left: 15px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.ft-search input { margin: 0; padding-left: 42px; border-radius: 999px; }
.ft-sort { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--ft-line); }
.ft-sort button, .ft-chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: color .3s var(--ease-d), background .3s var(--ease-d), border-color .3s var(--ease-d);
}
.ft-sort button:hover, .ft-chip:hover { color: var(--text); }
.ft-sort button.active { background: rgba(255,255,255,0.09); color: var(--text); }

.ft-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; min-height: 36px; }
.ft-chips.hidden { display: none; }
.ft-chip { display: inline-flex; align-items: center; gap: 8px; border-color: var(--ft-line); }
.ft-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--text)); box-shadow: 0 0 10px var(--c, transparent); }
.ft-chip.active { color: var(--text); border-color: color-mix(in srgb, var(--c, #fff) 55%, transparent);
  background: color-mix(in srgb, var(--c, #fff) 12%, transparent); }

.ft-grid {
  position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px;
  min-height: 180px;
}

.ft-card {
  --c: var(--ft-common);
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px 16px; border-radius: 22px; border: 1px solid var(--ft-line); background: var(--ft-surface);
  transition: transform .5s var(--spring-d), border-color .4s var(--ease-d), background .4s var(--ease-d);
  will-change: transform;
}
.ft-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 18%, transparent), transparent 60%);
  transition: opacity .4s var(--ease-d);
}
.ft-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 70%, transparent), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; transition: opacity .4s var(--ease-d);
}
.ft-card:hover { transform: translateY(-3px); background: var(--ft-surface-2); }
.ft-card:hover::before, .ft-card:hover::after { opacity: 1; }
.ft-card.here { border-color: color-mix(in srgb, var(--ft-live) 45%, transparent); }
.ft-card.now { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.ft-card.now .ft-ico { animation: ft-breathe 2.4s ease-in-out infinite; }
@keyframes ft-breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 0%, transparent); }
  50% { box-shadow: 0 0 26px 2px color-mix(in srgb, var(--c) 40%, transparent); } }

.ft-card.enter { animation: ft-enter .7s var(--spring-d) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes ft-enter { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.ft-card.leave { position: absolute; pointer-events: none; animation: ft-leave .38s var(--ease-d) forwards; }
@keyframes ft-leave { to { opacity: 0; transform: scale(.94); filter: blur(4px); } }
.ft-card.flash .ft-time { animation: ft-flash .9s var(--ease-d); }
@keyframes ft-flash { 0% { color: var(--c); } 100% { color: var(--text); } }

.ft-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ft-ico {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 21px; line-height: 1;
  background: color-mix(in srgb, var(--c) 13%, #141414); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.ft-title { min-width: 0; flex: 1; }
.ft-title b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-title span { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-family: var(--ft-mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.ft-tag {
  flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.ft-badges { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.ft-new {
  padding: 3px 8px; border-radius: 999px; font-family: var(--ft-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .14em;
  color: #101010; background: var(--ft-live); animation: ft-new-in .6s var(--spring-d) both;
}
@keyframes ft-new-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.ft-flag { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 11px;
  color: var(--ft-warn); background: rgba(255,138,148,0.12); }

.ft-timer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ft-phase { font-size: 12.5px; color: var(--muted); line-height: 1.35; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-time { font-family: var(--ft-mono); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ft-active {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--c); white-space: nowrap;
}
.ft-active i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ft-blink 1.4s ease-in-out infinite; }
@keyframes ft-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.ft-bar { position: relative; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.ft-bar i {
  position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: inherit; transform-origin: left center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), var(--c));
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); transition: transform 1s linear;
}
.ft-card.now .ft-bar i { transform: scaleX(1) !important; animation: ft-sweep 1.6s linear infinite;
  background: linear-gradient(90deg, transparent, var(--c), transparent); background-size: 50% 100%; background-repeat: no-repeat; }
@keyframes ft-sweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }

.ft-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--ft-line); font-size: 12.5px; color: var(--muted); }
.ft-foot .sp { flex: 1; }
.ft-meta { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ft-meta svg { width: 14px; height: 14px; opacity: .7; }
.ft-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ft-line);
  background: transparent; color: var(--muted); font-family: var(--ft-mono); font-size: 11px; cursor: pointer; white-space: nowrap;
  transition: color .25s var(--ease-d), border-color .25s var(--ease-d), background .25s var(--ease-d), transform .35s var(--spring-d);
}
.ft-btn svg { width: 13px; height: 13px; }
.ft-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.04); }
.ft-btn:active { transform: scale(.94); }
.ft-btn.done { color: var(--ft-live); border-color: color-mix(in srgb, var(--ft-live) 45%, transparent); }
.ft-pin { width: 28px; padding: 0; justify-content: center; font-family: inherit; font-size: 13px; }
.ft-pin.on { color: var(--ft-legendary); border-color: color-mix(in srgb, var(--ft-legendary) 45%, transparent); }

.ft-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 60px 20px; border-radius: 22px; border: 1px dashed var(--ft-line); color: var(--muted); text-align: center;
}
.ft-empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.ft-skel { height: 176px; border-radius: 22px; border: 1px solid var(--ft-line);
  background: linear-gradient(100deg, var(--ft-surface) 30%, #1a1a1a 50%, var(--ft-surface) 70%); background-size: 250% 100%;
  animation: ft-skel 1.4s linear infinite; }
@keyframes ft-skel { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.ft-lock { position: relative; margin-top: 6px; border-radius: 28px; overflow: hidden; isolation: isolate; border: 1px solid var(--ft-line); }
.ft-lock-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 18px;
  filter: blur(5px) saturate(1.25); opacity: .85; transform: scale(1.03); pointer-events: none; user-select: none;
}
.ft-lock-grid .ft-card { min-height: 170px; }
.ft-lock-over {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(55% 65% at 50% 50%, rgba(10,10,10,0.62), rgba(10,10,10,0.35));
}
.ft-lock-card {
  max-width: 460px; text-align: center; padding: 34px 32px; border-radius: 26px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(18,18,18,0.82); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  animation: ft-enter .9s var(--spring-d) both;
}
.ft-lock-card h2 { margin: 14px 0 10px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.ft-lock-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.ft-lock-card p b { color: var(--text); font-variant-numeric: tabular-nums; }
.ft-lock-card .btn { width: auto; display: inline-flex; padding: 14px 26px; text-decoration: none; }
.ft-lock-ico {
  width: 54px; height: 54px; margin: 0 auto; display: grid; place-items: center; border-radius: 18px; color: #101010;
  background: linear-gradient(135deg, #f4f2ee, #c9c1ff 55%, #8ce7b4); box-shadow: 0 10px 40px rgba(176,166,255,0.35);
}
.ft-lock-ico svg { width: 24px; height: 24px; }

.ft-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; padding: 11px 18px; border-radius: 999px; background: var(--text); color: #101010;
  font-size: 13px; font-weight: 500; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: transform .5s var(--spring-d), opacity .3s var(--ease-d);
}
.ft-toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1100px) { .ft-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .ft-stats { gap: 8px; }
  .ft-stat { padding: 16px; border-radius: 18px; }
  .ft-stat b { font-size: 26px; }
  .ft-grid { grid-template-columns: minmax(0, 1fr); }
  .ft-sort { width: 100%; justify-content: space-between; }
  .ft-sort button { flex: 1; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #page-funtime *, #page-funtime *::before, #page-funtime *::after { animation: none !important; transition: none !important; }
  #page-funtime .ft-reveal { opacity: 1; transform: none; }
}
