* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'MacMinecraft', sans-serif;
  image-rendering: pixelated;
  -webkit-box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

@font-face {
  font-family: 'MacMinecraft';
  src: url('assets/fonts/font.woff2') format('woff2');
}

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;
}

/* --- Top Bar --- */
.topbar {
  width: 100%;
  height: 60px;
  background: #1e150f url("assets/images/background_dirt.png") repeat;
  border-bottom: 4px solid #1a0f08;
  display: flex;
  align-items: center;
  justify-content: space-between;
  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;
}

/* Left side (logo + brand) */
.topbar .left {
  display: flex;
  align-items: center;
}

.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;
  gap: 8px;
}

.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;
  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;
}

/* 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;
}

.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;
}

/* 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;
  }

  .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 .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;
  }

  button, input[type="button"], input[type="submit"], .btn {
    font-size: 14px;
    padding: 10px 20px;
    min-height: 44px;
  }

  p {
    font-size: 14px;
  }
}

@media (max-width: 370px) {
  .topbar {
    padding: 0 8px;
  }

  .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;
  }

  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;
  }
}
