/* CarbonMC stats – laid out like the Lithium theme on carbonmc.net (dark mode, &6 gold) */

:root {
  --primary: #ffaa00;           /* Minecraft &6 */
  --primary-dark: #cc8800;
  --background-page: #100f10;
  --background-primary: #1b1b1b;
  --background-secondary: #242424;
  --background-dark: #1b1b1b;
  --text-primary: rgba(255, 255, 255, 0.75);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --divider: rgba(255, 255, 255, 0.05);
  --success: #27ae60;
  --danger: #e74c3c;
  --shadow-soft: 0 4px 8px 0 rgba(0, 0, 0, 0.25);
  --radius: 0.5rem;
  --header-height: 300px;
  --font: Montserrat, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background-page);
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  height: 44px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius);
  transition: opacity 0.2s ease;
}

.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-block { display: flex; width: 100%; }

/* --- User bar (Log In / Register) --------------------------------------------------------- */
.user-bar { background: var(--background-dark); padding: 0.35rem 0; }

.user-bar-inner {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
}

.user-bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 34px;
  padding: 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}

.user-bar a:hover { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.75); }
.user-bar i { font-size: 0.85em; }

/* --- Header ------------------------------------------------------------------------------- */
.header {
  position: relative;
  margin-bottom: 2rem;
  background: url("img/banner.jpg") no-repeat center center / cover, var(--background-dark);
}

/* Darkens the top behind the nav and fades the banner into the page */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25), transparent 150px),
    linear-gradient(transparent 0, rgba(0, 0, 0, 0.18) 30%, var(--background-page) 100%);
  pointer-events: none;
}

.navbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}

.nav {
  flex: 1;
  display: flex;
  align-items: center;
}

.nav-left { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.9rem;
  font-size: 1.115rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active { color: #fff; }

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 12px;
  height: 3px;
  margin-left: -6px;
  background: #fff;
  border-radius: 4px;
}

.nav-link .fa-caret-down { font-size: 0.75em; }

.nav-store {
  display: inline-flex;
  align-items: center;
  height: 44px;
  margin: 0 0.9rem;
  padding: 0 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  background: #fff;
  border-radius: 35px;
  transition: opacity 0.2s ease;
}

.nav-store:hover { opacity: 0.9; }

.nav-more { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0.9rem;
  min-width: 180px;
  padding: 0.5rem;
  background: var(--background-primary);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dropdown-header {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dropdown a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  border-radius: var(--radius);
}

.dropdown a:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }

.menu-toggle {
  display: none;
  margin-left: auto;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.75);
}

.menu-toggle:hover { color: #fff; }

/* Off-canvas menu for small screens */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 300px;
  height: 100%;
  padding: 1rem;
  overflow-y: auto;
  background: var(--background-primary);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius);
}

.mobile-menu ul { margin-top: 1rem; }

.mobile-menu li a {
  display: block;
  margin-top: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius);
}

.mobile-menu li a:hover { background: rgba(255, 255, 255, 0.04); }
.mobile-menu li a.current { color: #fff; background: rgba(255, 255, 255, 0.04); }
.mobile-menu li a.highlight { color: var(--primary); }
.mobile-menu li i { width: 1.25em; margin-right: 0.5rem; text-align: center; }
.mobile-menu .divider { margin: 0.75rem 0; border-top: 1px solid var(--divider); }

/* Logo in the middle, IP on the left, Discord on the right */
.header-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
}

.header-logo { margin-bottom: 1rem; animation: logo-float 5s ease-in-out infinite; }

.header-logo img {
  display: block;
  width: auto;
  height: 200px;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.header-status {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: -1.5rem;
  text-align: left;
  line-height: 1.4;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.header-status:hover { opacity: 0.75; }
.header-status-left { left: 16px; }
.header-status-left:hover { transform: translateX(10px); }
.header-status-right { right: 16px; flex-direction: row-reverse; text-align: right; }
.header-status-right:hover { transform: translateX(-10px); }

.header-status-icon { font-size: 3rem; color: rgba(255, 255, 255, 0.75); }

.header-status-content { display: flex; flex-direction: column; }

.header-status-title {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
}

.header-status-description { font-size: 1rem; font-weight: 300; color: rgba(255, 255, 255, 0.85); }

/* --- Cards -------------------------------------------------------------------------------- */
.main { flex: 1; }

.card {
  padding: 1.5rem;
  background: var(--background-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.announcement {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.announcement-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius);
}

.announcement-content { flex: 1; min-width: 0; }

.announcement-title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); }

.announcement-description { font-size: 0.9rem; font-weight: 300; color: var(--text-secondary); }

.search {
  display: flex;
  gap: 0.5rem;
  max-width: 520px;
  margin-top: 0.85rem;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 1rem;
  font: 400 1rem var(--font);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
}

.search input:focus { border-color: var(--primary); }
.search input::placeholder { color: rgba(255, 255, 255, 0.3); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  align-items: start;
}

.status { font-size: 0.975rem; }
.status.error { color: #ff6b6b; }

/* Sidebar cards with the gold header pill, like ONLINE STAFF on the home page */
.card-side { padding: 1rem 1.25rem; }
.card-side + .card-side { margin-top: 1.5rem; }

.card-side-header {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius);
}

.side-text { font-size: 0.95rem; }
.side-text strong { color: #fff; font-weight: 600; }
.side-link { display: inline-block; margin-top: 0.35rem; font-weight: 600; color: var(--primary); }
.side-link:hover { text-decoration: underline; }

.recent-list li + li { margin-top: 0.5rem; }

.recent-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}

.recent-link img { width: 32px; height: 32px; border-radius: var(--radius); image-rendering: pixelated; }
.recent-link:hover { color: var(--primary); }

/* --- Player ------------------------------------------------------------------------------- */
.player-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.5rem;
}

.skin {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius);
}

.skin img {
  display: block;
  width: 120px;
  height: auto;
  image-rendering: pixelated;
}

.player-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--primary);
  overflow-wrap: anywhere;
}

/* Chat-style [52] tag in the level's own Minecraft color */
.level-tag {
  font-size: 0.8em;
  font-weight: 800;
  color: var(--level-color, #aaa);
}

/* Rank prefix (%luckperms_prefix%), each run in its own in-game color */
.rank-prefix { font-size: 0.8em; font-weight: 800; white-space: pre; }
.rank-prefix .b { font-weight: 800; }
.rank-prefix .i { font-style: italic; }
.rank-prefix .u { text-decoration: underline; }
.rank-prefix .s { text-decoration: line-through; }
.rank-prefix .u.s { text-decoration: underline line-through; }

.level { margin-bottom: 1.25rem; }

.xp-bar {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
  max-width: 420px;
  height: 10px;
}

.xp-bar span { background: rgba(255, 255, 255, 0.08); }
.xp-bar span:first-child { border-radius: 3px 0 0 3px; }
.xp-bar span:last-child { border-radius: 0 3px 3px 0; }
.xp-bar span.on { background: var(--primary); }

.xp-text { margin-top: 0.4rem; font-size: 0.9rem; font-weight: 300; color: var(--text-secondary); }
.xp-text strong { font-weight: 500; color: var(--text-primary); }

.totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.total {
  padding: 0.65rem 0.75rem;
  background: var(--background-secondary);
  border-radius: var(--radius);
}

.total dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.total dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.game { padding: 1rem 1.25rem; }

.game h3 {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius);
}

.game dl { margin: 0; }

.game-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0.45rem 0.25rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--divider);
}

.game-row:last-child { border-bottom: 0; }
.game-row dt { font-weight: 300; }
.game-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }

.game-empty { font-size: 0.95rem; color: var(--text-secondary); }

.unplayed { margin-top: 1rem; font-size: 0.9rem; color: var(--text-secondary); }
.unplayed strong { margin-right: 0.4rem; font-weight: 600; color: var(--text-primary); }

/* --- Footer ------------------------------------------------------------------------------- */
.footer {
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.7);
  background: var(--background-dark);
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 4fr 3fr 3fr;
  gap: 1.5rem;
  padding-top: 3.25rem;
  padding-bottom: 2.5rem;
}

.footer-logo { text-align: center; }

.footer-logo img {
  width: 150px;
  height: auto;
  filter: grayscale(1);
  transition: filter 0.5s ease;
}

.footer-logo img:hover { filter: grayscale(0); }

.footer-title { margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600; color: rgba(255, 255, 255, 0.8); }

.footer-section p { font-size: 0.975rem; font-weight: 300; line-height: 1.8; color: rgba(255, 255, 255, 0.6); }

.footer-links a {
  display: block;
  margin: 0 -0.75rem;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  transition: background 0.25s ease, color 0.25s ease, padding 0.25s ease;
}

.footer-links a:hover { padding-left: 1rem; color: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.04); }

.footer-store { padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, 0.04); }
.footer-store .btn { margin-top: 1.5rem; height: 48px; font-size: 1.1rem; text-transform: none; }

.footer-extra { border-top: 1px solid rgba(255, 255, 255, 0.04); }

.footer-extra .container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: 0.975rem;
  font-weight: 500;
}

/* --- Smaller screens ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .layout-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .card-side + .card-side { margin-top: 0; }
  .footer-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-logo { display: none; }
}

@media (max-width: 991px) {
  .nav, .nav-store { display: none; }
  .navbar { min-height: 64px; }
  .menu-toggle { display: block; }

  /* Like the theme on mobile: just the logo, with IP and Discord stacked under it */
  .header-body { flex-direction: column; height: auto; padding-bottom: 2rem; }
  .header-logo { order: -1; }
  .header-logo img { height: 150px; }
  .header-status { position: static; margin: 0.5rem 0 0; }
  .header-status:hover { transform: none; }
  .header-status-right { flex-direction: row; text-align: left; }
  .header-status-icon { font-size: 2rem; width: 2.5rem; text-align: center; }
  .header-status-content { min-width: 220px; }

  .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .games { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .layout-side { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-store { padding-left: 0; border-left: 0; }
}

@media (max-width: 560px) {
  .announcement-icon { display: none; }
  .player-card { grid-template-columns: 1fr; }
  .skin img { width: 100px; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .total:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .search .btn { padding: 0 1rem; }
}
