:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b16;
}

* {
  box-sizing: border-box;
}

html,
body,
main {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  overflow: hidden;
  background: #080b16;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

main {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
}

picture,
#wallpaper {
  display: block;
  width: 100%;
  height: 100svh;
}

#wallpaper {
  object-fit: contain;
  background: #080b16;
}

.activity-panel {
  position: fixed;
  z-index: 2;
  top: clamp(16px, 3vw, 38px);
  right: clamp(16px, 3vw, 42px);
  display: flex;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100svh - 132px);
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 26px;
  background: linear-gradient(155deg, rgb(8 17 29 / 86%), rgb(7 10 19 / 74%));
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
  backdrop-filter: blur(22px) saturate(135%);
}

.activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
}

.eyebrow {
  display: flex;
  margin: 0 0 5px;
  align-items: center;
  gap: 8px;
  color: #ffd999;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pulse,
.state-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #73e6a1;
  box-shadow: 0 0 0 4px rgb(115 230 161 / 14%), 0 0 16px rgb(115 230 161 / 70%);
}

.activity-header h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.server-state {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: rgb(255 255 255 / 82%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.server-state.offline .state-dot,
.server-state.disconnected .state-dot {
  background: #ff897d;
  box-shadow: 0 0 0 4px rgb(255 137 125 / 12%);
}

.server-state.connecting .state-dot {
  background: #ffd999;
  box-shadow: 0 0 0 4px rgb(255 217 153 / 12%);
}

.online-summary {
  display: flex;
  min-height: 73px;
  align-items: center;
  gap: 17px;
  margin: 0 12px;
  padding: 12px 10px;
  border-top: 1px solid rgb(255 255 255 / 11%);
  border-bottom: 1px solid rgb(255 255 255 / 11%);
}

.online-summary > p:first-child {
  display: grid;
  min-width: 82px;
  margin: 0;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
}

.online-summary strong {
  color: #ffd999;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.online-summary span {
  max-width: 48px;
  color: rgb(255 255 255 / 62%);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
}

.online-players {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgb(255 255 255 / 78%);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.playtime-section {
  flex: 0 0 auto;
  padding: 8px 20px 9px;
  border-bottom: 1px solid rgb(255 255 255 / 11%);
}

.playtime-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.playtime-section h2 {
  margin: 0;
  color: rgb(255 255 255 / 88%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.playtime-section > header span {
  color: rgb(255 255 255 / 42%);
  font-size: 10px;
  font-weight: 650;
}

.playtime-list {
  display: grid;
  grid-auto-columns: minmax(142px, 1fr);
  grid-auto-flow: column;
  grid-template-rows: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0 0 3px;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scrollbar-color: rgb(255 217 153 / 45%) transparent;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.playtime-item {
  display: grid;
  min-width: 142px;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 11px;
  background: rgb(255 255 255 / 5%);
  scroll-snap-align: start;
}

.playtime-rank {
  grid-row: span 2;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #171107;
  border-radius: 7px;
  background: #ffd999;
  font-size: 10px;
  font-weight: 850;
}

.playtime-item strong,
.playtime-duration {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playtime-item strong {
  color: rgb(255 255 255 / 88%);
  font-size: 11px;
}

.playtime-duration {
  color: rgb(255 255 255 / 52%);
  font-size: 9px;
  font-weight: 650;
}

.playtime-empty {
  grid-column: 1 / -1;
  padding: 12px;
  color: rgb(255 255 255 / 50%);
  font-size: 11px;
  text-align: center;
}

.activity-list {
  display: flex;
  min-height: 120px;
  flex: 1 1 auto;
  margin: 0;
  padding: 8px 12px 14px;
  flex-direction: column;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgb(255 217 153 / 45%) transparent;
  scrollbar-width: thin;
}

.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 9px;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  animation: reveal 260ms ease both;
}

.activity-item:last-child {
  border-bottom: 0;
}

.event-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffd999;
  border: 1px solid rgb(255 217 153 / 24%);
  border-radius: 10px;
  background: rgb(255 217 153 / 10%);
  font-size: 15px;
  font-weight: 850;
}

.event-death .event-icon,
.event-player_leave .event-icon,
.event-server_stop .event-icon {
  color: #ff9b8e;
  border-color: rgb(255 155 142 / 24%);
  background: rgb(255 155 142 / 10%);
}

.event-player_join .event-icon,
.event-server_start .event-icon {
  color: #88eab0;
  border-color: rgb(136 234 176 / 24%);
  background: rgb(136 234 176 / 10%);
}

.event-command .event-icon {
  color: #a8c9ff;
  border-color: rgb(168 201 255 / 24%);
  background: rgb(168 201 255 / 10%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.event-copy {
  min-width: 0;
}

.event-copy p {
  margin: 0;
  overflow-wrap: anywhere;
  color: rgb(255 255 255 / 89%);
  font-size: 12px;
  font-weight: 610;
  line-height: 1.35;
}

.event-copy span,
.event-time {
  color: rgb(255 255 255 / 46%);
  font-size: 10px;
  font-weight: 650;
}

.event-time {
  align-self: start;
  padding-top: 2px;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 20px;
  color: rgb(255 255 255 / 55%);
  font-size: 12px;
  text-align: center;
}

.downloads {
  position: fixed;
  z-index: 3;
  left: clamp(16px, 3vw, 42px);
  bottom: max(18px, env(safe-area-inset-bottom));
  color: #fff;
}

.downloads summary {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(7 10 19 / 78%);
  box-shadow: 0 14px 42px rgb(0 0 0 / 34%);
  backdrop-filter: blur(16px);
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease, transform 160ms ease;
}

.downloads summary::-webkit-details-marker {
  display: none;
}

.downloads summary:hover,
.downloads[open] summary {
  background: rgb(18 23 34 / 92%);
  transform: translateY(-1px);
}

.downloads summary:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.download-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 20px;
}

.download-icon::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 8px;
  width: 2px;
  height: 11px;
  border-radius: 2px;
  background: #ffd999;
}

.download-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #ffd999;
  border-bottom: 2px solid #ffd999;
  transform: rotate(45deg);
}

.downloads summary::after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 15px;
  width: 16px;
  height: 5px;
  border: 2px solid #ffd999;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.download-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  display: grid;
  min-width: 205px;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 18px;
  background: rgb(7 10 19 / 90%);
  box-shadow: 0 18px 52px rgb(0 0 0 / 42%);
  backdrop-filter: blur(18px);
  animation: download-menu-in 160ms ease both;
}

.download-menu button,
.download-menu a {
  appearance: none;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #171107;
  border: 0;
  border-radius: 999px;
  background: #ffd999;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.download-menu button:hover,
.download-menu a:hover {
  background: #fff0ce;
  transform: translateY(-1px);
}

.download-menu button:focus-visible,
.download-menu a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@keyframes download-menu-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .activity-panel {
    width: min(370px, 46vw);
    max-height: calc(100svh - 24px);
    top: 12px;
    right: 12px;
  }

  .activity-header {
    padding: 16px 16px 12px;
  }

  .activity-header h1 {
    font-size: 22px;
  }

  .online-summary {
    min-height: 60px;
  }

  .activity-item {
    padding-block: 8px;
  }

  .downloads {
    left: 14px;
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  .activity-panel {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 46svh;
    border-radius: 22px;
  }

  .activity-header {
    padding: 16px 16px 12px;
  }

  .activity-header h1 {
    font-size: 22px;
  }

  .server-state {
    min-height: 28px;
  }

  .online-summary {
    min-height: 58px;
    padding-block: 8px;
  }

  .online-summary strong {
    font-size: 29px;
  }

  .activity-item {
    padding-block: 8px;
  }

  .downloads {
    left: 12px;
  }

  .download-menu button,
  .download-menu a {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-item {
    animation: none;
  }

  .downloads summary,
  .download-menu,
  .download-menu button,
  .download-menu a {
    animation: none;
    transition: none;
  }
}
