* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'MacMinecraft';
  image-rendering: pixelated;
  scrollbar-width: auto;
  scrollbar-color: #6b7280 #1f2327;
  -webkit-box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

*::-webkit-scrollbar {
  width: 14px;
  height: 14px;
  border-radius: 0 !important;
}

*::-webkit-scrollbar-track {
  background: #1f2327;
  border: 2px solid #111417;
  border-radius: 0 !important;
}

*::-webkit-scrollbar-thumb {
  background: #6b7280;
  border: 2px solid #3f4650;
  border-radius: 0 !important;
  background-clip: padding-box !important;
  -webkit-appearance: none;
}

*::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
  border-radius: 0 !important;
}

*::-webkit-scrollbar-corner {
  background: #1f2327;
  border-radius: 0 !important;
}

@font-face {
  font-family: 'MacMinecraft';
  src: url('assets/fonts/font.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'MacMinecraft';
  src: url('assets/fonts/font_bold.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'MacMinecraft';
  src: url('assets/fonts/font_italic.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'MacMinecraft';
  src: url('assets/fonts/font_bold_italic.woff2') format('woff2');
  font-weight: bold;
  font-style: italic;
}

:root {
  --global-message-main-offset: 20px;
}

body {
  background: #1a1a1a url("assets/images/background.png") repeat;
  color: #ffffff;
  -webkit-touch-callout: none;
  -webkit-app-region: drag;
}

p {
  color: rgba(255,255,255,0.75);
  font-size: 16px;
}

a {
  color: #3f8fff;
}

.hidden {
  display: none !important;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 1.6em;
  width: 1.4em;
  height: 1.4em;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  text-align: right;
  color: #ffffff;
  padding: 0px !important;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  padding: 6px 8px;
}
input[type="checkbox"]::before {
  content: " ";
}
input[type="checkbox"]:checked::before {
  content: "✔";
}

/* --- Top Bar --- */
.topbar {
  width: 100%;
  height: 60px;
  background: #1e150f url("assets/images/background_dirt.png") repeat;
  border-bottom: 4px solid #1a0f08;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  position: sticky;
  top: 0;
  z-index: 10;
}

.global-message-float {
  position: relative;
  margin: 8px;
  z-index: 2;
  padding: 12px 16px;
  border: 4px solid transparent;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.global-message-content {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  max-width: 100%;
}

.global-message-dismiss {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  margin: 0;
  padding: 0 !important;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.global-message-dismiss:hover {
  color: #fff;
  background: transparent;
}

.global-message-float {
  scrollbar-color: #8aa4c2 #1a2430;
}

.global-message-message {
  scrollbar-color: #8aa4c2 #1a2430;
}

.global-message-warning {
  scrollbar-color: #d6a24a #2b1f09;
}

.global-message-important {
  scrollbar-color: #d46b6b #2c0f0f;
}

.global-message-float::-webkit-scrollbar-track {
  background: #1a2430;
  border: 2px solid #111922;
  border-radius: 0 !important;
}

.global-message-warning::-webkit-scrollbar-track {
  background: #2b1f09;
  border: 2px solid #1d1406;
}

.global-message-important::-webkit-scrollbar-track {
  background: #2c0f0f;
  border: 2px solid #1f0a0a;
}

.global-message-float::-webkit-scrollbar-thumb {
  background: #8aa4c2;
  border: 2px solid #5d738d;
  border-radius: 0 !important;
  -webkit-appearance: none;
}

.global-message-warning::-webkit-scrollbar-thumb {
  background: #d6a24a;
  border: 2px solid #9a6400;
}

.global-message-important::-webkit-scrollbar-thumb {
  background: #d46b6b;
  border: 2px solid #8f1b1b;
}

.global-message-float::-webkit-scrollbar-thumb:hover {
  background: #b5c8dd;
  border-radius: 0 !important;
}

.global-message-warning::-webkit-scrollbar-thumb:hover {
  background: #e7b86d;
}

.global-message-important::-webkit-scrollbar-thumb:hover {
  background: #e08a8a;
}

.global-message-message {
  background: rgba(63, 143, 255, 0.25);
  color: #d7ebff;
  border-color: #1d5d96;
}

.global-message-warning {
  background: rgba(243, 182, 43, 0.25);
  color: #ffe6b0;
  border-color: #9a6400;
}

.global-message-important {
  background: rgba(226, 60, 60, 0.25);
  color: #ffd4d4;
  border-color: #8f1b1b;
}

.has-global-message main {
  padding-top: var(--global-message-main-offset);
}

/* Left side (logo + brand) */
.topbar .left {
  display: flex;
  align-items: center;
  justify-self: start;
}

.topbar .center {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  min-width: 0;
}

.logo {
  height: 30px;
  border-radius: 25%;
}

.logo, .logo-title {
  vertical-align: middle;
  width: auto;
  margin-right: 10px;
}

/* Right side (account links) */
.topbar .right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.topbar-user-search {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  max-width: none;
  width: min(500px, 100%);
}

.topbar-user-search-input {
  width: 100%;
  max-width: 330px;
  min-width: 120px;
  min-height: 38px;
  padding: 8px;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 13px;
}

.topbar-user-search-input:focus {
  outline: none;
  border-color: #555;
  background: #454a4d;
}

.topbar-search-btn {
  min-height: 38px;
  padding: 6px 12px;
}

.account-link {
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  background: #3d3d3d;
  border: 4px solid #2b2b2b;
  cursor: pointer;
  transition: all 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-link:hover {
  background: #4a4d4f;
}

/* Profile dropdown */
.profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid #555;
  object-fit: cover;
}

.profile-username {
  color: #ccc;
  font-size: 14px;
}

.dropdown-menu {
  position: absolute;
  top: 50px;
  right: 0;
  background: #1a1a1a;
  border: 4px solid #333;
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 1000;
}

.dropdown-menu.active {
  display: flex;
}

.dropdown-menu a {
  padding: 8px 12px;
  color: #ccc;
  text-decoration: none;
  border-bottom: 2px solid #333;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.dropdown-item .dropdown-icon {
  width: 16px;
  height: 16px;
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: #2a2a2a;
  color: #fff;
}

/* Main content spacing */
main {
  padding: 20px;
  padding-top: var(--global-message-main-offset);
  text-align: center;
}

h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #e5e7eb;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  color: #ccc;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Home container */
.home-container {
  max-width: 600px;
  margin: 0 auto;
}

/* Auth container */
.auth-container {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
  max-width: 400px;
  margin: 0 auto 20px;
}

.auth-container h1 {
  margin-bottom: 20px;
  text-align: center;
}

.auth-container a {
  color: #3f8fff;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-container a:hover {
  color: #60a5fa;
}

/* User card styling */
.user-card {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Settings page user-card exception - align left */
.settings-container .user-card {
  align-items: flex-start;
  text-align: left;
}

.settings-container .user-card .user-profile {
  justify-content: flex-start;
}

.user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.large-avatar {
  width: 100px;
  height: 100px;
  border: 2px solid #555;
}

.user-details {
  text-align: center;
}

.user-details h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.user-uuid {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.user-uuid code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border: 1px solid #555;
  font-family: 'Courier New', monospace;
  color: #9ca3af;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 20px auto 0;
}

form input,
form textarea {
  padding: 8px;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.1s;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: #555;
  background: #454a4d;
}

form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Buttons */
.btn,
button[type="submit"] {
  padding: 8px 14px;
  background: #3d3d3d;
  border: 4px solid #2b2b2b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e5e7eb;
}

.btn:hover,
button[type="submit"]:hover {
  background: #4a4d4f;
}

/* Consolidated button modifier classes: prefer using "btn" + modifier (e.g. class="btn primary") */
.btn.primary {
  background: #22c55e;
  border-color: #12883d;
  color: #022c10;
}
.btn.primary:hover {
  background: #2ee070;
}

.btn.important {
  background: #186a99;
  border-color: #10405f;
  color: #d0eeff;
}
.btn.important:hover {
  background: #2389c4;
}

.btn.mild {
  background: #cc9600;
  border-color: #6e5100;
  color: #fff8d7;
}
.btn.mild:hover {
  background: #c5a026;
}

.btn.danger {
  background: #c52222;
  border-color: #771313;
  color: #ffeaea;
}
.btn.danger:hover {
  background: #de4a4a;
}

/* Status messages */
#status {
  margin-top: 12px;
  padding: 8px;
  min-height: 20px;
  font-size: 13px;
}

#status:empty {
  display: none;
}

/* Upload styling */
input[type="file"] {
  padding: 8px;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  color: #ccc;
  cursor: pointer;
  transition: all 0.1s;
}

input[type="file"]:hover {
  background: #454a4d;
}

#preview {
  max-width: 200px;
  margin-top: 12px;
  border: 2px solid #555;
}

/* Settings page */
.settings-container {
  max-width: 700px;
  margin: 0 auto;
}

.settings-section {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 20px;
  margin: 20px 0;
}

.settings-section h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ccc;
  font-size: 18px;
}

#globalMessageInput {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 8px;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 14px;
}

#globalMessageEndpointType,
#globalMessageType {
  width: 100%;
  padding: 8px;
  background: #3c3f41;
  border: 4px solid #1a1c1d;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 14px;
}

#globalMessageEndpointType:focus,
#globalMessageType:focus {
  outline: none;
  border-color: #555;
  background: #454a4d;
}

#globalMessageInput:focus {
  outline: none;
  border-color: #555;
  background: #454a4d;
}

.global-message-preview-wrap {
  margin-top: 14px;
}

.global-message-preview-box {
  margin-top: 6px;
  padding: 12px 14px;
  border: 4px solid transparent;
  text-align: center;
  line-height: 1.4;
  white-space: pre-wrap;
}

.global-message-preview-disabled {
  opacity: 0.55;
}

/* Small notes and inline errors for forms */
.input-note {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
}

.error-text {
  font-size: 13px;
  color: #ef4444;
  margin-top: 8px;
}

/* Dashboard styles */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.greeting-section {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
  text-align: left;
}

.greeting-section h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.greeting-section p {
  color: rgba(255,255,255,0.6);
}

.greeting-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.greeting-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid #555;
  object-fit: cover;
}

.downloads-section {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
}

.dashboard-skin-image {
  width: 64px;
  height: 128px;
}

.dashboard-cape-image {
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 128px;
}

.dashboard-cape-image.is-elytra {
  max-width: 142px;
  max-height: 184px;
}

.dashboard-preview-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
}

.dashboard-preview-item {
  flex: 1 1 160px;
  min-width: 140px;
}

.dashboard-preview-label {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

.dashboard-card-hint {
  margin-top: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 12px;
}

.downloads-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  color: #ccc;
}

.dropdown-releases {
  position: relative;
  display: inline-block;
  flex: 1 1 300px;
  max-width: 300px;
}

/* Make prominent download CTAs consistent across pages */
.download-section .btn,
.hero-cta .btn {
  min-width: 160px;
  padding: 10px 16px;
  font-size: 15px;
}

.releases-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 4px solid #333;
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 100;
  margin-top: -4px;
}

.releases-menu.active {
  display: flex;
}

.release-item {
  padding: 8px 12px;
  color: #ccc;
  text-decoration: none;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: all 0.1s;
  cursor: pointer;
}

.release-item:last-child {
  border-bottom: none;
}

.release-item:hover {
  background: #2a2a2a;
  color: #fff;
}

.release-date {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.release-item:hover .release-date {
  color: rgba(255,255,255,0.7);
}

/* Disabled release items (no assets) */
.release-item[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Home / Introduction Page Styles */
.hero-banner {
  background: linear-gradient(180deg, rgba(255, 197, 71, 0.4) 0%, rgba(255, 208, 0, 0.144) 100%);
  border: 4px solid #fff177;
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 24px;
  border-radius: 2px;
}

.hero-logo {
  max-height: 60px;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto 16px;
}

.hero-banner h1 {
  font-size: 32px;
  margin: 16px 0 8px 0;
  color: #e5e7eb;
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255, 236, 129, 0.7);
  margin-bottom: 24px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta a {
  display: inline-block;
  text-decoration: none;
  margin: 0;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.feature-card:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: #444;
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.feature-card h3 {
  font-size: 16px;
  margin: 0 0 12px 0;
  color: #ccc;
}

.feature-card p {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* Download Section */
.download-section {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.download-section h2 {
  margin-top: 0;
  font-size: 24px;
}

/* CTA Footer (make it look like other cards) */
.cta-footer {
  background: rgba(0, 0, 0, 0.25);
  border: 4px solid #333;
  padding: 24px;
  margin-top: 40px;
  text-align: center;
  border-radius: 2px;
}

.cta-footer h3 {
  font-size: 20px;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.cta-footer p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}

/* Touch-friendly button sizing for all interactive elements */
button, a.btn, .account-link, input[type="button"], input[type="submit"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-user-search .topbar-search-btn {
  min-height: 38px;
  padding: 6px 12px;
}

/* Tablet optimizations (768px and under) */
@media (max-width: 768px) {
  * {
    -webkit-text-size-adjust: 100%;
  }

  body {
    -webkit-font-smoothing: antialiased;
  }

  button, a.btn, .account-link {
    padding: 8px 16px;
  }

  p {
    font-size: 15px;
  }
}

@media (max-width: 600px) {
  .topbar {
    height: 48px;
    padding: 0 12px;
    gap: 8px;
  }

  .topbar .left {
    gap: 8px;
    max-height: 30px;
    height: auto;
    width: auto;
    margin-right: 8px;
  }

  .logo {
    height: 35px;
  }

  .logo-title {
    display: none;
  }
  
  .logo, .logo-title {
    vertical-align: middle;
    width: auto;
    margin-right: 10px;
  }

  .topbar .right {
    gap: 6px;
  }

  .topbar .center {
    min-width: 0;
  }

  .topbar-user-search {
    gap: 4px;
    width: 100%;
  }

  .topbar-user-search-input {
    width: 100%;
    max-width: 170px;
    min-height: 34px;
    padding: 6px;
    border-width: 3px;
    font-size: 12px;
  }

  .topbar-search-btn {
    min-height: 34px;
    padding: 6px 8px;
    border-width: 3px;
    font-size: 11px;
  }

  .topbar .right a.btn,
  .topbar .right a.btn.primary {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 40px;
    min-width: 40px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
    border-width: 1px;
  }

  .profile-username {
    display: none;
  }

  .dropdown-menu {
    top: 46px;
    right: 6px;
    min-width: 150px;
  }

  .global-message-float {
    margin: 6px;
    padding: 10px 12px;
    font-size: 13px;
    max-height: 36vh;
  }

  .has-global-message main {
    padding-top: var(--global-message-main-offset);
  }

  button, input[type="button"], input[type="submit"], .btn {
    font-size: 14px;
    padding: 10px 20px;
    min-height: 44px;
  }

  .topbar-user-search .topbar-search-btn {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  p {
    font-size: 14px;
  }
}

@media (max-width: 370px) {
  .topbar {
    padding: 0 8px;
  }

  .topbar-user-search-input {
    width: 100%;
    max-width: 120px;
    font-size: 11px;
  }

  .topbar-search-btn {
    padding: 4px 6px;
    font-size: 10px;
    min-height: 30px;
  }

  .topbar .right a.btn,
  .topbar .right a.btn.primary {
    padding: 4px 8px;
    font-size: 11px;
  }

  button, input[type="button"], input[type="submit"], .btn {
    font-size: 13px;
    padding: 8px 16px;
  }

  .topbar-user-search .topbar-search-btn {
    padding: 4px 6px;
    font-size: 10px;
    min-height: 30px;
  }

  p {
    font-size: 13px;
  }
}

/* Landscape mode optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar {
    height: 40px;
    padding: 0 12px;
  }

  .logo {
    height: 28px;
  }

  main {
    padding-top: 40px;
  }
}
