@font-face {
  font-family: 'Minecraft';
  src: url('font/Minecraftia-Regular.otf') format('opentype');
  font-weight: normal; /* or 400 */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('font/Minecraftia-Italic.otf') format('opentype');
  font-weight: normal; /* or 400 */
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('font/Minecraftia-bold.otf') format('opentype');
  font-weight: bold; /* or 700 */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('font/Minecraftia-bolditalic.otf') format('opentype');
  font-weight: bold; /* or 700 */
  font-style: italic;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body.mc-theme-body, html {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto !important;
  overflow-x: hidden;
  background: 
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.55)),
    url('web/Dirt_background_BE1.webp');
  background-repeat: repeat;
  background-size: auto !important;
  image-rendering: pixelated;
  font-family: 'Minecraft', monospace;
  color: #ffffff;
}

.mc-page-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(5.2rem + env(safe-area-inset-top, 0px)) 1.25rem calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

/* Back Button */
.mc-back-btn {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top, 0px));
  left: calc(1.5rem + env(safe-area-inset-left, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #e0e0e0;
  text-decoration: none;
  font-family: 'Minecraft', monospace;
  font-size: 0.8rem;
  border-radius: 4px;
  background: #3a3a3a;
  border: 2px solid #555555;
  padding: 0.65rem 1.25rem;
  box-shadow: inset -2px -2px 0px #1a1a1a, inset 2px 2px 0px #888888, 0 4px 15px rgba(0,0,0,0.6);
  transition: transform 0.15s ease;
}

.mc-back-btn:hover, .mc-back-btn:active {
  transform: translateX(-3px);
  color: #ffffff;
}

.mc-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.mc-title {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  color: #ffffff;
  text-shadow: 3px 3px 0px #222222, 0 0 20px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
}

.mc-title-image {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0px #222222) drop-shadow(0 0 16px rgba(0, 0, 0, 0.8));
}

.mc-subtitle {
  font-size: 0.9rem;
  color: #ffaa00;
  text-shadow: 2px 2px 0px #3f2a00;
  margin-top: 0.5rem;
}

/* GUI Window & Creative Tabs */
.mc-gui-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.mc-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: -3px;
  position: relative;
  z-index: 5;
  padding-left: 14px;
  flex-wrap: wrap;
}

.mc-tab-btn {
  font-family: 'Minecraft', monospace;
  font-size: 0.82rem;
  color: #a8a8a8;
  background: #2b2622;
  border: 3px solid #14110e;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 16px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  top: 5px;
  box-shadow: inset 2px 2px 0px #4d4036, inset -2px 0px 0px #1a1613;
  touch-action: manipulation;
}

.mc-tab-btn:hover {
  background: #36302b;
  color: #ffffff;
}

.mc-tab-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 0 0 28px;
}

.mc-tab-btn.active {
  background: #3c342c;
  color: #ffff55;
  text-shadow: 2px 2px 0px #3f3f00;
  top: 0px;
  padding-top: 11px;
  padding-bottom: 9px;
  border-color: #4a3e33;
  border-bottom: 3px solid #3c342c;
  box-shadow: inset 2px 2px 0px #705e4f, inset -2px 0px 0px #241d18;
  z-index: 10;
}

.mc-gui-panel {
  background: rgba(22, 19, 18, 0.94);
  border: 4px solid #3c342c;
  border-radius: 0 6px 6px 6px;
  box-shadow: inset 3px 3px 0px #5c4e40, inset -3px -3px 0px #14110e, 0 15px 40px rgba(0, 0, 0, 0.85);
  padding: 1.8rem 1.4rem;
  width: 100%;
}

.mc-tab-content {
  display: none;
  width: 100%;
}

.mc-tab-content.active {
  display: block;
  animation: mcFadeIn 0.25s ease-out;
}

@keyframes mcFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mod Grid & Cards */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.mc-news-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

.mc-card {
  background: rgba(32, 28, 26, 0.95);
  border: 3px solid #4a3e33;
  box-shadow: inset 2px 2px 0px #6d5b4a, inset -2px -2px 0px #181411, 0 8px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

.mc-thumb-wrap {
  width: 100%;
  aspect-ratio: 1000 / 666;
  overflow: hidden;
  background: #000;
  border-bottom: 2px solid #3c3228;
}

.mc-mod-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mc-card-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.mc-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.mc-card-title {
  font-size: 1.05rem;
  color: #ffff55;
  text-shadow: 2px 2px 0px #3f3f00;
}

.mc-release-date {
  font-family: 'Minecraft', monospace;
  font-size: 0.68rem;
  color: #ffaa00;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 170, 0, 0.3);
  white-space: nowrap;
}

.mc-author-tag {
  font-size: 0.72rem;
  color: #aaaaaa;
  margin-bottom: 0.5rem;
}

/* Tags & Badges */
.mc-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.mc-badge {
  font-family: 'Minecraft', monospace;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid #000;
}

/* NeoForge Badge */
.badge-neoforge {
  background: #ff5722;
  color: #ffffff;
  text-shadow: 1px 1px 0px #000;
}

.badge-fabric { background: #55ffff; color: #000; }
.badge-forge { background: #ffaa00; color: #000; }
.badge-version { background: #555555; color: #fff; }
.badge-pack { background: #ff55ff; color: #000; }

/* WIP Badge */
.badge-wip {
  background: #ffcc00;
  color: #1a1a00;
  font-weight: bold;
}

/* Dependencies Box */
.mc-dependency-box {
  background: rgba(0, 0, 0, 0.45);
  border-left: 3px solid #ffaa00;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mc-dep-label {
  color: #ffaa00;
}

.mc-dep-link {
  color: #55ffff;
  text-decoration: none;
}

.mc-dep-link:hover {
  text-decoration: underline;
  color: #ffffff;
}

.mc-card-desc {
  font-size: 0.78rem;
  color: #e0e0e0;
  line-height: 1.45;
  margin-bottom: 0.8rem;
}

.mc-desc-toggle-btn {
  background: none;
  border: none;
  color: #55ff55;
  font-family: 'Minecraft', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
  margin-bottom: 1rem;
}

.mc-more-details {
  display: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.75rem;
  border-left: 3px solid #55ff55;
  margin-bottom: 1rem;
  font-size: 0.72rem;
  color: #cccccc;
  line-height: 1.4;
  white-space: pre-line;
}

.mc-more-details.open { display: block; }

/* WIP Banner (Replaces Action buttons when mod is in progress) */
.mc-wip-banner {
  background: rgba(255, 170, 0, 0.1);
  border: 2px dashed #ffaa00;
  color: #ffcc00;
  padding: 0.65rem 0.8rem;
  text-align: center;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 4px;
  margin-top: auto;
}

.mc-wip-icon {
  font-size: 0.9rem;
}

/* Released Mod Actions */
.mc-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}

.mc-pixel-btn {
  text-align: center;
  font-family: 'Minecraft', monospace;
  font-size: 0.68rem;
  text-decoration: none;
  padding: 0.6rem 0.2rem;
  border: 2px solid #000;
  color: #ffffff;
  box-shadow: inset 2px 2px 0px rgba(255,255,255,0.3), inset -2px -2px 0px rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.mc-pixel-btn:active { transform: translateY(2px); }
.btn-green { background: #1bd96a; color: #002b11; font-weight: bold; }
.btn-orange { background: #f16436; color: #ffffff; text-shadow: 1px 1px 0px #000; }
.btn-mirror { background: #4a5568; color: #ffffff; text-shadow: 1px 1px 0px #000; }

.mc-news-card { padding: 1.3rem; }
.mc-news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.mc-news-tag { font-size: 0.68rem; background: #55ff55; color: #003300; padding: 2px 5px; }
.mc-news-tag.tag-amber { background: #ffaa00; color: #331f00; }
.mc-news-date { font-size: 0.72rem; color: #aaaaaa; }

/* Mobile View adjustments */
@media (max-width: 650px) {
  .mc-tab-bar { padding-left: 0; justify-content: center; gap: 2px; }
  .mc-tab-btn { font-size: 0.7rem; padding: 6px 9px 4px; }
  .mc-tab-btn.active { padding-top: 9px; padding-bottom: 7px; }
  .mc-gui-panel { border-radius: 6px; padding: 1.2rem 0.85rem; }
  .mc-grid { grid-template-columns: 1fr; }
  .mc-card-actions { grid-template-columns: 1fr 1fr; }
  .mc-card-actions .btn-mirror { grid-column: span 2; }
  .mc-back-btn { top: calc(1rem + env(safe-area-inset-top, 0px)); left: calc(1rem + env(safe-area-inset-left, 0px)); padding: 0.5rem 0.95rem; font-size: 0.75rem; }
}