/* ==========================================================================
   Totó Stats Tracker - Midnight Theme Stylesheet
   Fiel ao tema Midnight do GitHub Pages com suporte estendido para o Tracker
   ========================================================================== */

/* --- Font Definitions --- */
@font-face {
  font-family: 'OpenSansLight';
  src: url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
       url('../fonts/OpenSans-Light-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'OpenSansRegular';
  src: url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
       url('../fonts/OpenSans-Regular-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'OpenSansSemibold';
  src: url('../fonts/OpenSans-Semibold-webfont.woff') format('woff'),
       url('../fonts/OpenSans-Semibold-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'OpenSansBold';
  src: url('../fonts/OpenSans-Bold-webfont.woff') format('woff'),
       url('../fonts/OpenSans-Bold-webfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* --- Reset & Base Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 14px/1.5 "OpenSansRegular", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #f0e7d5;
  font-weight: normal;
  background-color: #252525;
  background-image: linear-gradient(#2a2a29, #1c1c1c);
  background-attachment: fixed;
}

/* --- Home Page Specific Title (Bold with Logo) --- */
.hero-title-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto;
  text-align: center;
}

.hero-title-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: block;
  flex-shrink: 0;
}

.hero-title-text {
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: bold !important;
  font-size: 32px;
  line-height: 38px;
  color: #ffffff;
  margin: 0;
  text-align: center;
}

.nav-icon {
  display: inline-block;
  vertical-align: -1.5px;
  margin-right: 5px;
  opacity: 0.9;
}

body.page-home #title h1 {
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
}

h1, h2, h3, h4, h5, h6 {
  color: #e8e8e8;
  margin: 0 0 12px;
  font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 22px;
  line-height: 1.3;
  border-bottom: 1px solid #383838;
  padding-bottom: 6px;
  margin-top: 25px;
}

h3 {
  font-size: 17px;
  line-height: 22px;
  color: #d0c8b8;
  margin-top: 15px;
}

h4, h5, h6 {
  color: #e8e8e8;
  font-size: 15px;
}

p, ul, ol, table, pre, dl {
  margin: 0 0 18px;
}

a {
  color: #ffcc00;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: #ffeb9b;
}

strong {
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  color: #ffffff;
}

em {
  font-style: italic;
}

blockquote {
  border-left: 3px solid #ffcc00;
  margin: 0 0 18px;
  padding: 8px 16px;
  background: #1e1e1e;
  font-style: italic;
  color: #d7cfbe;
}

code {
  font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
  color: #efefef;
  font-size: 13px;
  background: #1b1b1b;
  padding: 2px 5px;
  border-radius: 2px;
  border: 1px solid #333333;
}

pre {
  padding: 10px 14px;
  background: #191919;
  border-radius: 2px;
  border: 1px solid #121212;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
  overflow-x: auto;
  margin: 0 0 18px;
}

pre code {
  color: #efefef;
  text-shadow: 0px 1px 0px #000;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

hr {
  border: 0;
  outline: none;
  height: 3px;
  background: transparent url('../images/hr.gif') center center repeat-x;
  margin: 20px 0;
}

ul {
  list-style-image: url('../images/bullet.png');
  padding-left: 20px;
}

/* --- Layout & Header --- */
.wrapper {
  flex: 1 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  padding: 0 16px;
}

#header {
  z-index: 1000;
  left: 0;
  top: 0;
  min-height: 60px;
  width: 100%;
  position: fixed;
  background: url('../images/nav-bg.gif') #353535;
  border-bottom: 4px solid #434343;
  box-shadow: 0px 1px 4px rgba(0,0,0,.35);
  display: flex;
  align-items: center;
}

#header nav {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#header .brand {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  line-height: 1;
}

#header .brand a {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  line-height: 1;
}

#header ul.nav-links {
  list-style: none;
  list-style-image: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#header ul.nav-links li {
  font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif;
  list-style: none;
  display: inline-block;
  color: white;
  text-shadow: 0px 1px 0px rgba(0,0,0,.2);
  font-size: 13px;
}

#header ul.nav-links li a {
  color: #ffffff;
  border: 1px solid #5d910b;
  background: linear-gradient(#93bd20, #659e10);
  border-radius: 2px;
  box-shadow: inset 0px 1px 0px rgba(255,255,255,.3), 0px 2px 4px rgba(0,0,0,.6);
  background-color: #93bd20;
  padding: 7px 11px;
  display: inline-block;
  text-align: center;
  font-size: 13px;
  line-height: 14px;
}

#header ul.nav-links li a:hover {
  background: linear-gradient(#749619, #527f0e);
  background-color: #659e10;
  border: 1px solid #527f0e;
  box-shadow: inset 0px 1px 1px rgba(0,0,0,.2);
  color: #ffffff;
}

#header ul.nav-links li.active a {
  background: linear-gradient(#4d750c, #395708);
  border-color: #2e4706;
  box-shadow: inset 0px 1px 2px rgba(0,0,0,.5);
}

#header ul.nav-links li.github a {
  background: linear-gradient(#444444, #2c2c2c);
  border-color: #555555;
  box-shadow: inset 0px 1px 0px rgba(255,255,255,.2), 0px 2px 4px rgba(0,0,0,.6);
}

#header ul.nav-links li.github a:hover {
  background: linear-gradient(#383838, #222222);
  border-color: #444444;
}

/* Gray Accent for Perfil and Regras buttons */
#header ul.nav-links li a#nav-perfil,
#header ul.nav-links li a#nav-regras {
  color: #f0e7d5;
  border: 1px solid #555555;
  background: linear-gradient(#505050, #383838);
  background-color: #444444;
  box-shadow: inset 0px 1px 0px rgba(255,255,255,.2), 0px 2px 4px rgba(0,0,0,.6);
}

#header ul.nav-links li a#nav-perfil:hover,
#header ul.nav-links li a#nav-regras:hover {
  background: linear-gradient(#424242, #2c2c2c);
  background-color: #383838;
  border-color: #444444;
  color: #ffffff;
}

#header ul.nav-links li.active a#nav-perfil,
#header ul.nav-links li.active a#nav-regras {
  background: linear-gradient(#2d2d2d, #1e1e1e);
  border-color: #222222;
  box-shadow: inset 0px 1px 2px rgba(0,0,0,.5);
  color: #ffffff;
}

/* --- Content Section --- */
section {
  max-width: 760px;
  padding: 15px 0 35px 0;
  margin: 78px auto 0 auto;
}

#title {
  border: 0;
  outline: none;
  margin: 0 0 24px 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

#title h1 {
  font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  font-size: 30px;
  text-align: center;
  line-height: 36px;
  color: #ffffff;
  margin-bottom: 0;
  width: 100%;
}

#title p {
  color: #d7cfbe;
  font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  font-size: 16px;
  text-align: center;
  margin-bottom: 12px;
}

#title .credits {
  font-size: 11px;
  font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #787878;
  display: block;
}

#title .credits.left {
  float: left;
}

#title .credits.right {
  float: right;
}

.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/* --- Tables & Custom Scrollbar --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid #3b3b3b;
  border-radius: 2px;
  background: #1e1e1e;
  scrollbar-width: thin;
  scrollbar-color: #444444 #191919;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #191919;
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #444444;
  border-radius: 3px;
  border: 1px solid #2a2a2a;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #659e10;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #434343;
  color: #b6b6b6;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  background-color: #2a2a2a;
}

td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #333333;
  vertical-align: middle;
}

tr:nth-child(even) td {
  background-color: #232323;
}

tr:hover td {
  background-color: #2b2b2b;
}

.table-leaderboard {
  width: 100%;
  table-layout: auto;
}

.table-leaderboard th,
.table-leaderboard td {
  white-space: nowrap;
  padding: 8px 7px;
  font-size: 12.5px;
}

.table-leaderboard th {
  font-size: 12px;
  letter-spacing: 0.3px;
}

.table-leaderboard .col-jogador,
.table-leaderboard td a {
  white-space: nowrap;
}

/* --- Panels & Cards --- */
.card {
  background: #1f1f1f;
  border: 1px solid #3e3e3e;
  border-radius: 3px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333333;
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #ffffff;
  margin: 0;
}

.card-subtitle {
  font-size: 12px;
  color: #999999;
}

/* --- Buttons & Filters --- */
.btn-group {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 14px;
  padding: 8px 12px;
  color: #f0e7d5;
  background: #333333;
  border: 1px solid #4a4a4a;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease-in-out;
  display: inline-block;
  text-decoration: none;
}

.btn:hover {
  background: #444444;
  color: #ffffff;
  border-color: #666666;
}

.btn.active, .btn.btn-active {
  background: linear-gradient(#93bd20, #659e10);
  border-color: #5d910b;
  color: #ffffff;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.btn-primary {
  color: white;
  border: 1px solid #5d910b;
  background: linear-gradient(#93bd20, #659e10);
  border-radius: 2px;
  box-shadow: inset 0px 1px 0px rgba(255,255,255,.3), 0px 2px 4px rgba(0,0,0,.5);
}

.btn-primary:hover {
  background: linear-gradient(#749619, #527f0e);
  color: white;
}

.btn-secondary {
  background: #2b2b2b;
  border: 1px solid #444;
  color: #d7cfbe;
}

.btn-secondary:hover {
  background: #383838;
  color: #ffffff;
}

/* --- Form Controls --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #b6b6b6;
  margin-bottom: 6px;
  font-size: 13px;
}

.form-select, .form-input {
  width: 100%;
  max-width: 400px;
  background: #191919;
  border: 1px solid #434343;
  color: #f0e7d5;
  padding: 8px 12px;
  font-size: 14px;
  font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-radius: 2px;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: #ffcc00;
}

/* --- Badges & Tags (Identidade Midnight) --- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-radius: 2px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-win {
  background: #1c3612;
  color: #93bd20;
  border: 1px solid #336618;
}

.badge-loss {
  background: #361515;
  color: #e06c75;
  border: 1px solid #662020;
}

.badge-draw {
  background: #252525;
  color: #cccccc;
  border: 1px solid #444444;
}

.badge-penalty {
  background: #38240a;
  color: #e5a84b;
  border: 1px solid #6e4414;
}

.badge-time {
  background: #14273d;
  color: #79b8ff;
  border: 1px solid #23476f;
}

.badge-neutral {
  background: #222222;
  color: #aaaaaa;
  border: 1px solid #3c3c3c;
}

.badge-rank-1 {
  background: #382c06;
  color: #ffcc00;
  border: 1px solid #8c6e0c;
}

.badge-rank-2 {
  background: #22262d;
  color: #d0d7de;
  border: 1px solid #57606a;
}

.badge-rank-3 {
  background: #331d0e;
  color: #e09b67;
  border: 1px solid #7a431d;
}

/* --- Stat Grids --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-grid-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-grid-triplo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}


.stat-box-hero {
  background: #1e1e1e;
  border: 1px solid #484848;
  border-radius: 3px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.stat-box-hero .stat-value {
  font-size: 32px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-box-hero .stat-label {
  font-size: 12px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #c5bba8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-box {
  background: #1a1a1a;
  border: 1px solid #363636;
  border-radius: 2px;
  padding: 12px;
  text-align: center;
}

.stat-box .stat-value {
  font-size: 24px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-box .stat-label {
  font-size: 11px;
  color: #a09787;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Podium Component --- */
.podium-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  align-items: end;
}

.podium-card {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  border-radius: 3px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
}

.podium-card.rank-1 {
  border-top: 3px solid #ffcc00;
  background: #232219;
  order: 2;
  padding-top: 20px;
  padding-bottom: 20px;
}

.podium-card.rank-2 {
  border-top: 3px solid #b4c2d1;
  background: #1d2024;
  order: 1;
}

.podium-card.rank-3 {
  border-top: 3px solid #cf8c57;
  background: #241d18;
  order: 3;
}

.podium-place {
  font-size: 12px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.podium-title-tag {
  display: inline-block;
  font-size: 10px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 2px 7px;
  border-radius: 2px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.podium-title-tag.ouro {
  background: #262007;
  border: 1px solid #8c6e0c;
  color: #ffcc00;
}

.podium-title-tag.prata {
  background: #1d2127;
  border: 1px solid #57606a;
  color: #d0d7de;
}

.podium-title-tag.bronze {
  background: #26170d;
  border: 1px solid #7a431d;
  color: #e09b67;
}

.podium-card.rank-1 .podium-place { color: #ffcc00; }
.podium-card.rank-2 .podium-place { color: #b4c2d1; }
.podium-card.rank-3 .podium-place { color: #cf8c57; }

.podium-name {
  font-size: 15px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffffff;
  margin-bottom: 4px;
  word-break: break-word;
}

.podium-score {
  font-size: 18px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffcc00;
}

/* --- Match Card Grid --- */
.match-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.match-item {
  background: #1e1e1e;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 14px 16px;
  transition: border-color 0.15s ease-in-out;
}

.match-item:hover {
  border-color: #555555;
}

.match-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  text-align: center;
}

.team-box {
  padding: 8px;
  background: #171717;
  border: 1px solid #2e2e2e;
  border-radius: 2px;
}

.team-box.winner {
  border-color: #5d910b;
  background: #1b2413;
}

.team-name {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 4px;
}

.team-roster {
  font-size: 12px;
  color: #a8a092;
}

.score-display {
  font-size: 26px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffcc00;
  letter-spacing: 2px;
  padding: 4px 10px;
  background: #141414;
  border: 1px solid #333333;
  border-radius: 2px;
}

.match-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888888;
  border-top: 1px solid #2b2b2b;
  padding-top: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

/* --- Match Detail View --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.team-detail-card {
  background: #1a1a1a;
  border: 1px solid #363636;
  border-radius: 3px;
  padding: 14px;
}

.team-detail-card.winner {
  border-top: 3px solid #93bd20;
}

.team-detail-card.loser {
  border-top: 3px solid #882b2b;
}

.partida-scoreboard-card {
  background: #242424;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.partida-scoreboard-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.partida-team-side.azul {
  text-align: left;
}

.partida-team-side.amarelo {
  text-align: right;
}

.partida-team-side .team-title-azul {
  font-size: 15px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #58a6ff;
}

.partida-team-side .team-title-amarelo {
  font-size: 15px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffcc00;
}

.partida-team-side .team-roster-text {
  font-size: 12px;
  color: #999999;
  margin-top: 2px;
}

.partida-score-box {
  font-size: 28px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffffff;
  letter-spacing: 2px;
  text-align: center;
  min-width: 110px;
  padding: 6px 14px;
  background: #181818;
  border: 1px solid #333333;
  border-radius: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.partida-scoreboard-footer {
  border-top: 1px solid #333333;
  padding-top: 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Text & Alignment Utilities --- */
.text-gold { color: #ffcc00 !important; }
.text-green { color: #93bd20 !important; }
.text-danger { color: #e06c75 !important; }
.text-muted { color: #888888 !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }

/* --- Global Real Footer --- */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  background-color: #1c1c1c;
  background-image: linear-gradient(#262626, #181818);
  border-top: 1px solid #383838;
  padding: 0 0 26px 0;
  font-size: 13px;
  color: #888888;
}

/* Barra "Voltar ao início" estilo Amazon */
.footer-back-to-top {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background-color: #2b2b2b;
  color: #dcdcdc;
  text-align: center;
  padding: 13px 16px;
  font-size: 13px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-decoration: none;
  border-bottom: 1px solid #383838;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.footer-back-to-top:hover {
  background-color: #353535;
  color: #ffcc00;
  text-decoration: none;
}

.footer-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 16px 0 16px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 24px;
  align-items: start;
  text-align: left;
}

.footer-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.footer-col .footer-title {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: #ffffff;
  line-height: 1.3;
}

.footer-col .footer-heading {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #d0c8b8;
  margin-bottom: 8px;
}

.footer-links {
  list-style: none;
  list-style-image: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 6px;
  list-style: none;
}

.footer-links li a {
  color: #aaaaaa;
  text-decoration: none;
}

.footer-links li a:hover {
  color: #ffcc00;
}

.link-imprimir-canhoto {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.footer-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  width: 100%;
}

.footer-badges a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-badges .badge-link-vercel img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 3px;
}

.footer-badges .badge-link-vscode img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 3px;
}

.footer-badges .badge-link-github img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 3px;
}

/* --- Conquistas e Títulos dos Jogadores (Identidade Midnight) --- */
.perfil-achievements-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.achievement-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  position: relative;
  cursor: help;
  border: 1px solid #383838;
  letter-spacing: 0.3px;
  background: #1e1e1e;
  transition: border-color 0.15s ease;
}

.achievement-flag.ouro {
  background: #262007;
  border-color: #8c6e0c;
  color: #ffcc00;
}

.achievement-flag.prata {
  background: #1d2127;
  border-color: #57606a;
  color: #d0d7de;
}

.achievement-flag.bronze {
  background: #26170d;
  border-color: #7a431d;
  color: #e09b67;
}

.achievement-flag.puro {
  background: #142810;
  border-color: #336618;
  color: #93bd20;
}

.achievement-flag:hover {
  border-color: #888888;
}

.achievement-flag .rank-pill {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.5px;
}

.achievement-flag.ouro .rank-pill {
  background: #ffcc00;
  color: #141414;
}

.achievement-flag.prata .rank-pill {
  background: #d0d7de;
  color: #141414;
}

.achievement-flag.bronze .rank-pill {
  background: #e09b67;
  color: #141414;
}

.achievement-flag.puro .rank-pill {
  background: #93bd20;
  color: #141414;
}

.achievement-flag[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #191919;
  color: #ffffff;
  border: 1px solid #444444;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: normal;
  border-radius: 2px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  z-index: 100;
  pointer-events: none;
}

/* Tag de título no Podium do Leaderboard */
.podium-title-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10.5px;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.podium-title-tag.ouro {
  background: #262007;
  border: 1px solid #8c6e0c;
  color: #ffcc00;
}

.podium-title-tag.prata {
  background: #1d2127;
  border: 1px solid #57606a;
  color: #d0d7de;
}

.podium-title-tag.bronze {
  background: #26170d;
  border: 1px solid #7a431d;
  color: #e09b67;
}

/* --- Estatísticas por Lado (Lado Azul vs Lado Amarelo) --- */
.side-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.side-card {
  background: #1e1e1e;
  border: 1px solid #333333;
  border-radius: 3px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.side-card.azul {
  border-top: 4px solid #58a6ff;
}

.side-card.amarelo {
  border-top: 4px solid #ffcc00;
}

.side-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #2e2e2e;
  padding-bottom: 8px;
}

.side-card-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-card.azul .side-card-title {
  color: #58a6ff;
}

.side-card.amarelo .side-card-title {
  color: #ffcc00;
}

.side-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.side-metric-item {
  background: #181818;
  padding: 8px 6px;
  border-radius: 4px;
  border: 1px solid #282828;
}

.side-metric-value {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
}

.side-metric-label {
  font-size: 10.5px;
  color: #999999;
  margin-top: 2px;
}

/* --- Gráfico de Evolução do Jogador (Perfil) --- */
.grafico-evolucao-card {
  background: #1e1e1e;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 16px;
  margin-bottom: 24px;
}

.grafico-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.grafico-titulo {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #ffffff;
}

.grafico-tab-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.grafico-tab-btn {
  background: #252525;
  border: 1px solid #3c3c3c;
  color: #cccccc;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grafico-tab-btn:hover {
  background: #303030;
  color: #ffffff;
  border-color: #555555;
}

.grafico-tab-btn.active {
  background: #93bd20;
  border-color: #93bd20;
  color: #141414;
  font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.grafico-canvas-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}

.grafico-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.grafico-tooltip {
  position: absolute;
  display: none;
  background: #1f1f1f;
  border: 1px solid #4a4a4a;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #ffffff;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -120%);
  white-space: nowrap;
  line-height: 1.4;
}

.grafico-footer-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: #888888;
}

/* --- Sistema de Pesquisa Avançada e Barra de Busca (Página Inicial) --- */
.search-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.search-section-title {
  margin: 0;
  border: none;
  padding: 0;
}

.search-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.btn-adv-toggle {
  font-size: 12px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-quick-input {
  width: 220px;
  max-width: 100%;
}

.adv-search-panel {
  background: #1e1e1e;
  border: 1px solid #383838;
  border-radius: 3px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.adv-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid #2e2e2e;
  padding-bottom: 10px;
}

.adv-search-title {
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.adv-search-jogador-row {
  margin-bottom: 14px;
}

.adv-search-jogador-row label {
  display: block;
  font-size: 12px;
  color: #cccccc;
  margin-bottom: 6px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.adv-criteria-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.adv-criterion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #181818;
  border: 1px solid #2e2e2e;
  border-radius: 2px;
  padding: 8px 10px;
  flex-wrap: nowrap;
}

.adv-criterion-label {
  font-size: 11.5px;
  font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ffcc00;
  width: 62px;
  flex-shrink: 0;
}

.adv-tipo-fator {
  flex: 1.2;
  min-width: 140px;
}

.adv-criterion-values-wrap {
  flex: 1.5;
  display: flex;
  gap: 8px;
  align-items: center;
}

.adv-criterion-values-wrap select,
.adv-criterion-values-wrap input {
  flex: 1;
  min-width: 0;
}

.adv-criterion-btn-remove {
  background: #282828;
  border: 1px solid #444444;
  color: #aaaaaa;
  padding: 6px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.adv-criterion-btn-remove:hover {
  background: #382020;
  border-color: #e06c75;
  color: #e06c75;
}

.adv-search-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #2e2e2e;
  padding-top: 12px;
}

.adv-search-status {
  font-size: 12px;
  color: #999999;
}

/* Tab bar superior em Regras */
.regras-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #383838;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.regras-tab-btn {
  background: #252525;
  border: 1px solid #3a3a3a;
  color: #cccccc;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.regras-tab-btn:hover {
  background: #303030;
  color: #ffffff;
}

.regras-tab-btn.active {
  background: #93bd20;
  border-color: #93bd20;
  color: #141414;
}

.title-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.title-category-card {
  background: #1e1e1e;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 18px;
}

.title-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: bold;
  color: #ffcc00;
  margin-bottom: 14px;
  border-bottom: 1px solid #2c2c2c;
  padding-bottom: 8px;
}

.title-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #242424;
  border: 1px solid #333333;
  margin-bottom: 10px;
  color: inherit;
  transition: border-color 0.2s ease;
}

.title-item-card:hover {
  border-color: #444444;
}

.title-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.title-item-name {
  font-weight: 800;
  font-size: 13.5px;
}

.title-item-desc {
  font-size: 11px;
  color: #999999;
  line-height: 1.35;
}

.title-item-badge-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* --- Canhoto de Impressão (Oculto na Tela) --- */
#canhoto-print-template {
  display: none;
}

/* --- Media Queries (Mobile & Tablet Optimization) --- */
@media screen and (max-width: 720px) {
  /* Layout Base e Container */
  .wrapper {
    padding: 0 12px;
  }

  section {
    margin-top: 20px;
    padding: 10px 0 25px 0;
  }

  #title {
    text-align: center;
    margin: 0 0 16px 0;
  }

  #title h1,
  h1 {
    font-size: 24px;
    line-height: 28px;
    text-align: center;
  }

  #title p {
    font-size: 14px;
    margin-bottom: 8px;
  }

  #title .credits {
    display: block;
    width: 100%;
    line-height: 20px;
    text-align: center;
  }

  #title .credits.left,
  #title .credits.right {
    float: none;
    display: block;
  }

  h2 {
    font-size: 18px;
    line-height: 1.25;
    margin-top: 18px;
    margin-bottom: 8px;
    padding-bottom: 4px;
  }

  h3 {
    font-size: 15px;
    margin-top: 12px;
    margin-bottom: 6px;
  }

  p, ul, ol, table, pre, dl {
    margin-bottom: 12px;
  }

  hr {
    margin: 14px 0;
  }

  /* Cards e Painéis */
  .card {
    padding: 12px;
    margin-bottom: 12px;
  }

  .card-header {
    padding-bottom: 8px;
    margin-bottom: 10px;
    gap: 6px;
  }

  /* Estatísticas Principais Grandes (Hero) - 3 Colunas Compactas */
  .stat-grid-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-box-hero {
    padding: 12px 6px;
    border-radius: 3px;
  }

  .stat-box-hero .stat-value {
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 4px;
  }

  .stat-box-hero .stat-label {
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.3px;
  }

  .stat-box-hero .stat-label svg {
    width: 11px;
    height: 11px;
    margin-right: 3px;
  }

  /* Grids de Estatísticas Secundárias */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-grid-triplo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
  }

  .stat-box {
    padding: 10px 6px;
  }

  .stat-box .stat-value {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .stat-box .stat-label {
    font-size: 10px;
    letter-spacing: 0.3px;
  }

  /* Podium do Leaderboard (3 Colunas Clássicas Compactas) */
  .podium-container {
    display: grid;
    grid-template-columns: 1fr 1.08fr 1fr;
    gap: 6px;
    margin-bottom: 18px;
    align-items: end;
  }

  .podium-card {
    padding: 10px 4px;
  }

  .podium-card.rank-1 {
    order: 2;
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .podium-card.rank-2 {
    order: 1;
    padding-top: 10px;
  }

  .podium-card.rank-3 {
    order: 3;
    padding-top: 8px;
  }

  .podium-place {
    font-size: 10px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
  }

  .podium-title-tag {
    font-size: 8.5px;
    padding: 1px 5px;
    margin: 2px 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .podium-name {
    font-size: 12.5px;
    margin-bottom: 2px;
  }

  .podium-score {
    font-size: 14.5px;
  }

  /* Estatísticas por Lado (Lado Azul vs Lado Amarelo) */
  .side-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 14px;
  }

  .side-card {
    padding: 12px 10px;
  }

  .side-card-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .side-card-title {
    font-size: 14.5px;
  }

  .side-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .side-metric-item {
    padding: 6px 3px;
  }

  .side-metric-value {
    font-size: 16px;
  }

  .side-metric-label {
    font-size: 10px;
  }

  /* Feed e Lista de Partidas */
  .match-grid {
    gap: 10px;
    margin-bottom: 18px;
  }

  .match-item {
    padding: 10px 12px;
  }

  .match-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    text-align: center;
  }

  .team-box {
    padding: 6px 6px;
  }

  .team-name {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .team-roster {
    font-size: 11px;
    line-height: 1.25;
  }

  .score-display {
    font-size: 20px;
    letter-spacing: 1.5px;
    padding: 4px 8px;
    min-width: 65px;
    text-align: center;
  }

  .match-meta-row {
    font-size: 11.5px;
    padding-top: 6px;
    margin-top: 6px;
    gap: 4px;
  }

  /* Detalhe da Partida */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .team-detail-card {
    padding: 10px;
  }

  .partida-scoreboard-card {
    padding: 14px 12px;
    margin-bottom: 16px;
  }

  .partida-scoreboard-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .partida-team-side.azul {
    text-align: left;
  }

  .partida-team-side.amarelo {
    text-align: right;
  }

  .partida-team-side .team-title-azul,
  .partida-team-side .team-title-amarelo {
    font-size: 13.5px;
  }

  .partida-team-side .team-roster-text {
    font-size: 11px;
    margin-top: 1px;
  }

  .partida-score-box {
    font-size: 22px;
    min-width: 80px;
    padding: 4px 10px;
    letter-spacing: 1.5px;
  }

  .partida-scoreboard-footer {
    padding-top: 8px;
    font-size: 11.5px;
    gap: 6px;
  }

  /* Busca e Filtros */
  .search-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .search-controls-right {
    width: 100%;
    margin-left: 0;
    display: flex;
    gap: 6px;
  }

  .btn-adv-toggle {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 10px;
  }

  .search-quick-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    font-size: 12.5px;
    padding: 6px 10px;
  }

  .adv-search-panel {
    padding: 12px 10px;
    margin-bottom: 14px;
  }

  .adv-criterion-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
  }

  .adv-criterion-label {
    width: auto;
    font-size: 11px;
  }

  .adv-tipo-fator {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    padding: 5px 8px;
  }

  .adv-criterion-values-wrap {
    width: 100%;
    order: 3;
    flex-basis: 100%;
    gap: 6px;
  }

  .adv-criterion-values-wrap select,
  .adv-criterion-values-wrap input {
    font-size: 12px;
    padding: 5px 8px;
  }

  .adv-criterion-btn-remove {
    order: 2;
    width: 28px;
    height: 28px;
    padding: 4px;
  }

  /* Tabelas */
  .table-responsive {
    margin-bottom: 14px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 6px 7px;
  }

  .table-leaderboard th,
  .table-leaderboard td {
    padding: 6px 5px;
    font-size: 11.5px;
  }

  .table-leaderboard th {
    font-size: 11px;
  }

  /* Gráfico de Evolução (Perfil) */
  .grafico-evolucao-card {
    padding: 12px 10px;
    margin-bottom: 16px;
  }

  .grafico-header-row {
    gap: 8px;
    margin-bottom: 10px;
  }

  .grafico-titulo {
    font-size: 13px;
  }

  .grafico-tab-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 4px;
  }

  .grafico-tab-btn {
    padding: 5px 4px;
    font-size: 11px;
    text-align: center;
    justify-content: center;
  }

  .grafico-canvas-container {
    height: 220px;
  }

  .grafico-footer-legend {
    font-size: 10.5px;
    margin-top: 8px;
    gap: 4px;
  }

  /* Regras e Conquistas */
  .regras-tab-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .regras-tab-btn {
    padding: 8px 6px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  .title-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .title-category-card {
    padding: 12px 10px;
  }

  .title-category-header {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 6px;
  }

  .title-item-card {
    padding: 8px 10px;
    gap: 10px;
    margin-bottom: 8px;
  }

  .title-item-name {
    font-size: 13px;
  }

  .title-item-desc {
    font-size: 10.5px;
  }

  .achievement-flag {
    padding: 3px 7px;
    font-size: 11px;
    gap: 4px;
  }

  /* Rodapé */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .footer-col-brand {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }
}

@media screen and (max-width: 540px) {
  /* Layout Base e Margens */
  .wrapper {
    padding: 0 8px;
  }

  section {
    margin-top: 12px;
    padding-top: 10px;
  }

  #title {
    margin-bottom: 12px;
  }

  #title h1,
  h1 {
    font-size: 21px;
    line-height: 25px;
  }

  .hero-title-container {
    gap: 10px;
  }

  .hero-title-logo {
    width: 30px;
    height: 30px;
  }

  .hero-title-text {
    font-size: 22px !important;
    line-height: 26px !important;
  }

  /* Header e Barra de Navegação Superior (4 Botões em Grid 100% Simétricos) */
  #header {
    position: relative;
    min-height: auto;
  }

  #header nav {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 8px 8px 8px;
    gap: 6px;
  }

  #header .brand {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-bottom: 2px;
  }

  #header .brand a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  #header .brand a strong {
    text-align: center;
    display: block;
    width: 100%;
    font-size: 15px;
  }

  #header ul.nav-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
    justify-content: center;
  }

  #header ul.nav-links li {
    display: block;
    width: 100%;
  }

  #header ul.nav-links li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 2px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
  }

  .nav-icon {
    width: 11px;
    height: 11px;
    margin-right: 3px;
  }

  /* Botões e Filtros Gerais */
  .btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 100%;
    margin-bottom: 12px;
  }

  .btn-group .btn {
    width: 100%;
    padding: 7px 4px;
    font-size: 11.5px;
    text-align: center;
  }

  .btn {
    font-size: 12px;
    padding: 7px 10px;
  }

  /* Estatísticas Principais Grandes (Hero) - 3 Colunas Ultra Eficientes */
  .stat-grid-hero {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 12px;
  }

  .stat-box-hero {
    padding: 10px 3px;
  }

  .stat-box-hero .stat-value {
    font-size: 19px;
    line-height: 1.1;
    margin-bottom: 3px;
  }

  .stat-box-hero .stat-label {
    font-size: 8.5px;
    line-height: 1.15;
    letter-spacing: 0.1px;
  }

  .stat-box-hero .stat-label svg {
    width: 9px;
    height: 9px;
    margin-right: 1px;
    vertical-align: -1px;
  }

  /* Stat Grids Secundários */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
  }

  .stat-grid-triplo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 12px;
  }

  .stat-box {
    padding: 8px 4px;
  }

  .stat-box .stat-value {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .stat-box .stat-label {
    font-size: 9px;
  }

  /* Podium do Leaderboard */
  .podium-container {
    grid-template-columns: 1fr 1.08fr 1fr;
    gap: 4px;
    margin-bottom: 14px;
  }

  .podium-card {
    padding: 8px 2px;
  }

  .podium-card.rank-1 {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .podium-card.rank-2 {
    padding-top: 8px;
  }

  .podium-card.rank-3 {
    padding-top: 6px;
  }

  .podium-place {
    font-size: 9px;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
  }

  .podium-title-tag {
    font-size: 7.5px;
    padding: 1px 3px;
    margin: 2px 0;
  }

  .podium-name {
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  .podium-score {
    font-size: 13px;
  }

  /* Confronto Geral de Lados */
  .side-card {
    padding: 10px 8px;
  }

  .side-metrics-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .side-metric-item {
    padding: 5px 2px;
  }

  .side-metric-value {
    font-size: 14.5px;
  }

  .side-metric-label {
    font-size: 9px;
  }

  /* Placar e Feed de Jogos */
  .match-scoreboard {
    grid-template-columns: 1fr auto 1fr;
    gap: 5px;
    margin: 6px 0;
  }

  .team-box {
    padding: 5px 4px;
  }

  .team-name {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .team-roster {
    font-size: 10px;
    line-height: 1.2;
  }

  .score-display {
    font-size: 18px;
    letter-spacing: 1px;
    padding: 3px 6px;
    min-width: 55px;
  }

  .match-meta-row {
    font-size: 11px;
    padding-top: 5px;
    margin-top: 5px;
  }

  .match-meta-row .btn {
    padding: 4px 7px;
    font-size: 11px;
  }

  /* Detalhe da Partida */
  .partida-scoreboard-card {
    padding: 10px 8px;
    margin-bottom: 14px;
  }

  .partida-scoreboard-header {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  .partida-team-side .team-title-azul,
  .partida-team-side .team-title-amarelo {
    font-size: 12.5px;
  }

  .partida-team-side .team-roster-text {
    font-size: 10.5px;
  }

  .partida-score-box {
    font-size: 20px;
    min-width: 65px;
    padding: 3px 8px;
    letter-spacing: 1px;
  }

  .partida-scoreboard-footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 4px;
    font-size: 11px;
    padding-top: 6px;
  }

  /* Pesquisa e Filtros */
  .search-controls-right {
    flex-direction: row;
    width: 100%;
    gap: 5px;
  }

  .btn-adv-toggle {
    font-size: 11px;
    padding: 6px 8px;
  }

  .search-quick-input {
    font-size: 12px;
    padding: 6px 8px;
  }

  .adv-search-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .adv-search-actions button {
    width: 100%;
    justify-content: center;
  }

  /* Formulários */
  .form-group {
    margin-bottom: 10px;
  }

  .form-label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .form-select, .form-input {
    font-size: 13px;
    padding: 6px 8px;
  }

  /* Tabelas */
  th, td {
    padding: 5px 5px;
    font-size: 11.5px;
  }

  .table-leaderboard th,
  .table-leaderboard td {
    padding: 5px 4px;
    font-size: 11px;
  }

  .table-leaderboard th {
    font-size: 10.5px;
  }

  /* Gráfico de Evolução (Perfil) */
  .grafico-canvas-container {
    height: 200px;
  }

  .grafico-tab-btn {
    padding: 5px 2px;
    font-size: 10px;
  }

  .grafico-footer-legend {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    font-size: 9.5px;
  }

  /* Regras e Conquistas */
  .regras-tab-bar {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .regras-tab-btn {
    padding: 7px 4px;
    font-size: 11px;
  }

  .title-category-card {
    padding: 10px 8px;
  }

  .title-item-card {
    padding: 7px 8px;
    gap: 6px;
  }

  .title-item-name {
    font-size: 12px;
  }

  .title-item-desc {
    font-size: 10px;
  }

  .achievement-flag {
    padding: 2px 5px;
    font-size: 10px;
    gap: 3px;
  }

  .achievement-flag .rank-pill {
    font-size: 8.5px;
    padding: 1px 3px;
  }

  /* Rodapé */
  .footer-container {
    padding: 14px 10px 0 10px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }

  .footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .footer-brand-container {
    justify-content: center;
    width: 100%;
  }

  .footer-heading {
    text-align: center;
    width: 100%;
    margin-bottom: 6px;
  }

  .footer-links {
    text-align: center;
    width: 100%;
    padding: 0;
  }

  .footer-links li {
    text-align: center;
    width: 100%;
    margin-bottom: 4px;
  }

  .footer-links li a {
    display: inline-block;
  }

  .link-imprimir-canhoto {
    justify-content: center;
    display: inline-flex;
  }

  .footer-badges {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    margin-top: 4px;
  }

  .footer-badges a {
    justify-content: center;
  }

  .footer-badges .badge-link-vercel img,
  .footer-badges .badge-link-vscode img,
  .footer-badges .badge-link-github img {
    width: 100px;
  }

  .footer-back-to-top {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* Telas Ultra-Compactas (ex.: iPhone SE 320px-375px) */
@media screen and (max-width: 380px) {
  .hero-title-text {
    font-size: 19px !important;
  }

  #header ul.nav-links li a {
    font-size: 10px;
    padding: 5px 1px;
  }

  .nav-icon {
    display: none;
  }

  .stat-box-hero .stat-value {
    font-size: 17px;
  }

  .stat-box-hero .stat-label {
    font-size: 8px;
  }

  .score-display {
    font-size: 16px;
    padding: 2px 4px;
    min-width: 48px;
  }

  .team-name {
    font-size: 11px;
  }

  .team-roster {
    font-size: 9.5px;
  }

  .podium-place {
    font-size: 8px;
  }

  .podium-score {
    font-size: 11.5px;
  }

  .side-metric-value {
    font-size: 13px;
  }

  .side-metric-label {
    font-size: 8.5px;
  }
}


/* ==========================================================================
   ESTILOS DE IMPRESSÃO - CANHOTO DE PARTIDA (PÁGINA A5 PRETA E BRANCA)
   ========================================================================== */
@page {
  size: A5 portrait;
  margin: 6mm 8mm 6mm 8mm;
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    height: auto !important;
    width: 100% !important;
  }

  /* Ocultar toda a estrutura do site no papel */
  body > *:not(#canhoto-print-template),
  #header,
  .wrapper,
  .site-footer,
  nav,
  button,
  .btn,
  #title,
  hr,
  .stat-grid-hero,
  .match-grid,
  .table-responsive {
    display: none !important;
    visibility: hidden !important;
  }

  /* Exibir estritamente a folha de canhoto A5 centralizada e compacta */
  #canhoto-print-template {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }

  #canhoto-print-template * {
    color: #000000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #000000 !important;
    box-sizing: border-box !important;
  }

  .canhoto-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: none;
    padding: 0;
    font-size: 10.5px;
    box-sizing: border-box;
  }

  .canhoto-top-header {
    text-align: center;
    border-bottom: 1.5px solid #000000;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }

  .canhoto-top-header h1 {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0;
    color: #000000 !important;
  }

  .canhoto-row-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: none;
    padding: 0 10px;
    margin-bottom: 8px;
  }

  .canhoto-field-inline {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 11px;
  }

  .canhoto-field-label {
    font-weight: bold;
    white-space: nowrap;
  }

  .canhoto-underline {
    border-bottom: 1.5px solid #000000;
    flex-grow: 1;
    min-height: 16px;
    display: inline-block;
  }

  .canhoto-score-card {
    border: none;
    padding: 0 6px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .canhoto-score-matchup {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
  }

  .canhoto-score-team-box {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .canhoto-score-team-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
  }

  .canhoto-score-box-num {
    display: inline-block;
    border: 1.8px solid #000000;
    width: 40px;
    height: 28px;
    text-align: center;
  }

  .canhoto-score-x {
    font-size: 16px;
    font-weight: 800;
  }

  .canhoto-winner-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    margin-top: 3px;
  }

  .canhoto-winner-label {
    font-weight: bold;
    font-size: 11.5px;
  }

  .canhoto-winner-checks {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .canhoto-check-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .canhoto-checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1.8px solid #000000;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
  }

  .canhoto-checkbox-sm {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 1.3px solid #000000;
    vertical-align: middle;
    flex-shrink: 0;
  }

  .canhoto-teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 8px;
  }

  .canhoto-team-column {
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .canhoto-team-header {
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1.5px solid #000000;
    padding-bottom: 3px;
    margin-bottom: 2px;
    letter-spacing: 1px;
  }

  .canhoto-player-slot {
    border-bottom: 1px dashed #999999;
    padding: 4px 0 6px 0;
    text-align: center;
  }

  .canhoto-player-slot:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .canhoto-player-title {
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 0;
  }

  .canhoto-player-name-field {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    font-size: 10.5px;
    margin-bottom: 3px;
  }

  .canhoto-player-stats-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.05fr 1.25fr;
    gap: 4px;
    font-size: 9.5px;
    align-items: center;
  }

  .canhoto-stat-cell {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
  }

  .canhoto-stat-box {
    display: inline-block;
    border: 1.3px solid #000000;
    width: 22px;
    height: 15px;
    text-align: center;
  }

  .canhoto-obs-container {
    border: none;
    padding: 0 4px;
    margin-top: 6px;
    margin-bottom: 8px;
  }

  .canhoto-obs-header {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
  }

  .canhoto-obs-row {
    border-bottom: 1.5px solid #000000;
    height: 16px;
  }

  .canhoto-qr-section {
    display: inline-flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1.5px solid #000000;
    border-radius: 4px;
    padding: 5px 14px;
    margin: 6px auto 0 auto;
    box-sizing: border-box;
    width: fit-content;
    max-width: 90%;
  }

  .canhoto-qr-box {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .canhoto-qr-img {
    width: 52px;
    height: 52px;
    display: block;
    shape-rendering: crispEdges !important;
    image-rendering: pixelated;
  }

  .canhoto-qr-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  .canhoto-qr-title {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000000 !important;
  }

  .canhoto-qr-url {
    font-size: 9px;
    font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
    font-weight: bold;
    color: #000000 !important;
    margin-top: 1px;
  }
}
