/* ============================================
   MTG PREMODERN BRASÍLIA — ESTILO RETRÔ 2000s
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Press+Start+2P&display=swap');

/* --- CSS Variables --- */
:root {
  --gold: #DAA520;
  --gold-light: #FFD700;
  --gold-dark: #B8860B;
  --link-blue: #0000EE;
  --visited-purple: #551A8B;
  --poison-green: #00FF00;
  --dark-green: #006400;
  --blood-red: #8B0000;
  --bright-red: #FF0000;
  --parchment: #F5E6C8;
  --parchment-dark: #D4C4A0;
  --bg-dark: #1a0a00;
  --bg-darker: #0d0500;
  --text-light: #F0E0C0;
  --text-dark: #2B1B00;
  --border-ridge: 3px ridge var(--gold);
  --border-thick: 4px double var(--gold-dark);
  --font-medieval: 'MedievalSharp', 'Times New Roman', serif;
  --font-pixel: 'Press Start 2P', monospace;
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Times New Roman', serif;
  font-size: 16px;
  color: var(--text-light);
  background-color: var(--bg-dark);
  background-image:
    repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(139, 90, 43, 0.04) 2px,
      rgba(139, 90, 43, 0.04) 4px),
    repeating-linear-gradient(90deg,
      transparent,
      transparent 2px,
      rgba(139, 90, 43, 0.03) 2px,
      rgba(139, 90, 43, 0.03) 4px),
    radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #1a0a00 0%, #2a1500 50%, #1a0a00 100%);
  line-height: 1.6;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
  border-left: 2px ridge var(--gold-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold), var(--gold-dark));
  border: 1px ridge var(--gold);
}

/* --- Page Wrapper (Simulated Frames) --- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 1024px;
  margin: 0 auto;
  border-left: 4px ridge var(--gold);
  border-right: 4px ridge var(--gold);
}

/* --- Sidebar (Left Frame) --- */
.sidebar {
  width: 200px;
  min-width: 200px;
  background: linear-gradient(180deg, #1a0800, #2a1200, #1a0800);
  border-right: 4px ridge var(--gold);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  text-align: center;
  padding: 15px 10px;
  border-bottom: 3px ridge var(--gold);
  background: linear-gradient(180deg, rgba(218, 165, 32, 0.2), transparent);
}

.sidebar-header h2 {
  font-family: var(--font-medieval);
  color: var(--gold-light);
  font-size: 1.1em;
  text-shadow: 0 0 10px rgba(218, 165, 32, 0.5), 2px 2px 4px #000;
  margin-bottom: 5px;
}

.sidebar-header .subtitle {
  font-family: var(--font-pixel);
  font-size: 0.45em;
  color: var(--poison-green);
  text-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
  letter-spacing: 1px;
}

/* --- Navigation --- */
.nav-section {
  padding: 10px 0;
}

.nav-section .section-title {
  font-family: var(--font-pixel);
  font-size: 0.5em;
  color: var(--gold);
  text-align: center;
  padding: 8px 5px;
  border-top: 2px groove var(--gold-dark);
  border-bottom: 2px groove var(--gold-dark);
  background: rgba(218, 165, 32, 0.08);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  padding: 5px 0;
}

.nav-list li {
  border-bottom: 1px solid rgba(218, 165, 32, 0.15);
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  color: var(--gold-light);
  text-decoration: none;
  font-family: var(--font-medieval);
  font-size: 1em;
  transition: all 0.2s;
  position: relative;
}

.nav-list a::before {
  content: '⚔ ';
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-list a:hover {
  background: rgba(218, 165, 32, 0.15);
  color: #fff;
  text-shadow: 0 0 8px var(--gold);
  padding-left: 18px;
}

.nav-list a:hover::before {
  opacity: 1;
}

.nav-list a.active {
  background: rgba(218, 165, 32, 0.2);
  border-left: 3px solid var(--gold);
  color: #fff;
}

/* --- Sidebar decorations --- */
.sidebar-decor {
  text-align: center;
  padding: 10px;
  font-size: 1.8em;
  opacity: 0.6;
  animation: flicker 3s ease-in-out infinite alternate;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }
}

.sidebar-badge-area {
  margin-top: auto;
  padding: 10px;
  text-align: center;
  border-top: 2px groove var(--gold-dark);
}

.badge-88x31 {
  display: inline-block;
  width: 88px;
  height: 31px;
  margin: 3px;
  border: 1px solid var(--gold-dark);
  font-family: var(--font-pixel);
  font-size: 0.35em;
  line-height: 31px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s;
}

.badge-88x31:hover {
  box-shadow: 0 0 10px var(--gold);
}

.badge-mtg {
  background: linear-gradient(135deg, #1a0a00, #4a2000);
  color: var(--gold-light);
}

.badge-800x600 {
  background: linear-gradient(135deg, #000033, #000066);
  color: #88aaff;
}

.badge-netscape {
  background: linear-gradient(135deg, #003300, #006600);
  color: var(--poison-green);
}

/* --- Main Content Area (Right Frame) --- */
.main-content {
  flex: 1;
  padding: 0;
  min-width: 0;
}

/* --- Top Banner --- */
.top-banner {
  background: linear-gradient(180deg, rgba(218, 165, 32, 0.15), transparent);
  border-bottom: 4px ridge var(--gold);
  padding: 20px;
  text-align: center;
}

.top-banner h1 {
  font-family: var(--font-medieval);
  font-size: 2.2em;
  color: var(--gold-light);
  text-shadow:
    0 0 20px rgba(218, 165, 32, 0.6),
    3px 3px 6px #000,
    -1px -1px 0 var(--gold-dark);
  letter-spacing: 2px;
}

.top-banner .tagline {
  font-family: var(--font-pixel);
  font-size: 0.5em;
  color: var(--poison-green);
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
  margin-top: 5px;
}

/* --- Marquee News Ticker --- */
.marquee-container {
  background: linear-gradient(90deg, var(--bg-darker), rgba(139, 0, 0, 0.2), var(--bg-darker));
  border-top: 2px ridge var(--gold-dark);
  border-bottom: 2px ridge var(--gold-dark);
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: marquee-scroll 30s linear infinite;
  font-family: var(--font-pixel);
  font-size: 0.55em;
  color: var(--bright-red);
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

.marquee-content span {
  padding: 0 40px;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(40vw);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* --- Content Area --- */
.content-area {
  padding: 20px;
}

/* --- Section Panels --- */
.panel {
  border: var(--border-ridge);
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
}

.panel-header {
  background: linear-gradient(90deg, rgba(218, 165, 32, 0.25), rgba(218, 165, 32, 0.05));
  border-bottom: 2px ridge var(--gold);
  padding: 8px 15px;
  font-family: var(--font-medieval);
  font-size: 1.3em;
  color: var(--gold-light);
  text-shadow: 1px 1px 3px #000;
}

.panel-body {
  padding: 15px;
}

/* --- Tables (Retro Style) --- */
table {
  width: 100%;
  border-collapse: collapse;
  border: 3px ridge var(--gold);
  background: rgba(0, 0, 0, 0.2);
}

th {
  background: linear-gradient(180deg, rgba(218, 165, 32, 0.3), rgba(218, 165, 32, 0.1));
  border: 2px ridge var(--gold);
  padding: 8px 12px;
  font-family: var(--font-medieval);
  color: var(--gold-light);
  text-shadow: 1px 1px 2px #000;
  text-align: left;
}

td {
  border: 1px ridge var(--gold-dark);
  padding: 6px 12px;
  color: var(--text-light);
}

tr:nth-child(even) {
  background: rgba(218, 165, 32, 0.05);
}

tr:hover {
  background: rgba(218, 165, 32, 0.12);
}

/* --- Rank Badges --- */
.rank-1 {
  color: var(--gold-light);
  font-weight: bold;
  text-shadow: 0 0 8px var(--gold);
}

.rank-2 {
  color: #C0C0C0;
  font-weight: bold;
  text-shadow: 0 0 6px #aaa;
}

.rank-3 {
  color: #CD7F32;
  font-weight: bold;
  text-shadow: 0 0 6px #CD7F32;
}

/* --- Links --- */
a {
  color: var(--gold-light);
  text-decoration: underline;
}

a:hover {
  color: var(--poison-green);
  text-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

/* --- Welcome Section --- */
.welcome-text {
  font-family: var(--font-medieval);
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--parchment);
}

.welcome-text em {
  color: var(--gold-light);
  font-style: normal;
  text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
}

/* --- Visitor Counter --- */
.visitor-counter {
  display: inline-block;
  background: #000;
  border: 2px inset #555;
  padding: 4px 10px;
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  color: var(--poison-green);
  text-shadow: 0 0 6px rgba(0, 255, 0, 0.5);
  letter-spacing: 3px;
}

/* --- Webring --- */
.webring {
  text-align: center;
  padding: 10px;
  border: 2px groove var(--gold-dark);
  background: rgba(0, 0, 0, 0.3);
  margin-top: 15px;
}

.webring-title {
  font-family: var(--font-pixel);
  font-size: 0.55em;
  color: var(--gold);
  margin-bottom: 8px;
}

.webring a {
  color: var(--gold-light);
  font-family: var(--font-pixel);
  font-size: 0.6em;
  margin: 0 8px;
}

/* --- Deck Gallery --- */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.deck-card {
  border: 3px ridge var(--gold);
  background: linear-gradient(180deg, rgba(218, 165, 32, 0.1), rgba(0, 0, 0, 0.4));
  transition: all 0.3s;
}

.deck-card:hover {
  box-shadow: 0 0 15px rgba(218, 165, 32, 0.3);
  transform: translateY(-2px);
}

.deck-card-header {
  background: linear-gradient(90deg, rgba(218, 165, 32, 0.2), transparent);
  border-bottom: 2px ridge var(--gold);
  padding: 10px 12px;
}

.deck-card-header h3 {
  font-family: var(--font-medieval);
  color: var(--gold-light);
  font-size: 1.1em;
  margin: 0;
}

.deck-card-header .deck-meta {
  font-family: var(--font-pixel);
  font-size: 0.4em;
  color: var(--poison-green);
  margin-top: 3px;
}

.deck-card-body {
  padding: 12px;
  font-size: 0.9em;
}

.deck-card-body a {
  font-family: var(--font-medieval);
  color: var(--gold-light);
}

/* --- Metagame Bars --- */
.meta-bar-container {
  margin-bottom: 12px;
}

.meta-bar-label {
  font-family: var(--font-medieval);
  color: var(--gold-light);
  margin-bottom: 4px;
  font-size: 1em;
}

.meta-bar-track {
  background: rgba(0, 0, 0, 0.4);
  border: 2px ridge var(--gold-dark);
  height: 28px;
  position: relative;
}

.meta-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-family: var(--font-pixel);
  font-size: 0.5em;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  transition: width 1s ease-out;
}

.meta-bar-fill.control {
  background: linear-gradient(90deg, #003366, #0066cc);
}

.meta-bar-fill.aggro {
  background: linear-gradient(90deg, #660000, #cc0000);
}

.meta-bar-fill.combo {
  background: linear-gradient(90deg, #330066, #6600cc);
}

.meta-bar-fill.midrange {
  background: linear-gradient(90deg, #004400, #008800);
}

.meta-bar-fill.other {
  background: linear-gradient(90deg, #444, #888);
}

/* --- Agenda --- */
.event-upcoming {
  border-left: 3px solid var(--poison-green);
}

.event-date {
  font-family: var(--font-pixel);
  font-size: 0.55em;
  color: var(--poison-green);
}

/* --- Blog / News --- */
.news-list {
  list-style: none;
}

.news-item {
  border-bottom: 1px solid rgba(218, 165, 32, 0.2);
  padding: 12px 0;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-date {
  font-family: var(--font-pixel);
  font-size: 0.45em;
  color: var(--gold);
  display: block;
  margin-bottom: 4px;
}

.news-item-title {
  font-family: var(--font-medieval);
  font-size: 1.2em;
}

.news-item-title a {
  color: var(--gold-light);
}

.news-item-excerpt {
  color: var(--parchment-dark);
  font-size: 0.9em;
  margin-top: 4px;
}

/* --- Post Layout --- */
.post-content {
  font-family: 'Times New Roman', serif;
  font-size: 1.05em;
  line-height: 1.8;
  color: var(--parchment);
}

.post-content h2,
.post-content h3 {
  font-family: var(--font-medieval);
  color: var(--gold-light);
  margin: 20px 0 10px;
  text-shadow: 1px 1px 3px #000;
}

.post-content p {
  margin-bottom: 12px;
}

.post-content ul,
.post-content ol {
  margin-left: 25px;
  margin-bottom: 12px;
}

/* --- Deck Detail Page --- */
.decklist {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--parchment);
  white-space: pre-line;
}

.decklist h3 {
  font-family: var(--font-medieval);
  color: var(--gold-light);
  font-size: 1.1em;
  margin: 15px 0 5px;
  border-bottom: 1px solid var(--gold-dark);
  padding-bottom: 3px;
}

/* --- Footer --- */
.page-footer {
  border-top: 4px ridge var(--gold);
  background: rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: 15px;
  font-size: 0.85em;
  color: var(--parchment-dark);
}

.page-footer a {
  color: var(--gold-light);
}

/* --- Dividers --- */
.divider {
  border: none;
  border-top: 2px ridge var(--gold-dark);
  margin: 15px 0;
}

.divider-fancy {
  text-align: center;
  margin: 15px 0;
  color: var(--gold);
  font-size: 0.8em;
  opacity: 0.6;
}

/* --- Guestbook Teaser --- */
.under-construction {
  text-align: center;
  padding: 20px;
  border: 2px dashed var(--gold-dark);
  background: rgba(218, 165, 32, 0.05);
  font-family: var(--font-pixel);
  font-size: 0.55em;
  color: var(--gold);
}

.under-construction .emoji-big {
  font-size: 3em;
  display: block;
  margin-bottom: 10px;
}

/* --- Hamburger Button (hidden on desktop) --- */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 10;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--gold-light);
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(218, 165, 32, 0.4);
}

/* Hamburger animation when open */
.sidebar.open .hamburger-btn span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.sidebar.open .hamburger-btn span:nth-child(2) {
  opacity: 0;
}

.sidebar.open .hamburger-btn span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Responsive (keep the retro feel) --- */
@media (max-width: 700px) {
  .page-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    flex-direction: column;
    border-right: none;
    border-bottom: 4px ridge var(--gold);
  }

  /* Hamburger visible on mobile */
  .hamburger-btn {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .sidebar-header {
    width: 100%;
    border-bottom: 2px ridge var(--gold);
  }

  /* Hide nav and decorative elements by default */
  .sidebar .nav-section,
  .sidebar .sidebar-decor,
  .sidebar .sidebar-badge-area {
    display: none;
  }

  /* Show them when sidebar is open */
  .sidebar.open .nav-section,
  .sidebar.open .sidebar-decor {
    display: block;
    width: 100%;
  }

  .sidebar.open .sidebar-badge-area {
    display: block;
    width: 100%;
  }

  .sidebar.open .nav-list {
    display: block;
  }

  .sidebar.open .nav-list li {
    border-bottom: 1px solid rgba(218, 165, 32, 0.15);
  }

  .top-banner h1 {
    font-size: 1.4em;
  }

  .deck-grid {
    grid-template-columns: 1fr;
  }
}