*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root{
    /*--main-color:#19666c;*/
    --teal:#2a7a6e;
    --color1:#AFB63E;
    --color2: #1A2024;
    --color3:#AFB63E;
    --back-color:#f2f2f2;
    --boring-back: #ffffff;
    --ltgreen-back: #f5f7ec;
    --green-hover: #eaeed8;
    --dark-back: #1A2024;
    --light-text: #ffffff;
    --button: #AFB83E;
    --rust: #c0393b;
    --orange:#d4651a;
}
/* Base styles */{"path":"/tauri/D/xampp/htdocs/baseball/BaseballSurvivor/styles.css"}
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: var(--boring-back);
  margin:0;
}

/* Header & Navigation */
header {
  background-color: var(--dark-back);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 80px;
}
.logo {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}
.logo img {
  height: 60px;
  width: auto;
  display: block;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}
.greeting {
  padding: 0.4rem 1.2rem 0;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  text-align: right;
  width: 100%;
}

/* Main Content */
main {
  background: var(--boring-color);
  flex: 1 0 auto;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family:Poppins, Tahoma, sans-serif;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color1);
}
h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  /*font-family: "Sigmar One";*/
}
h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}
/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--color1);
  color: var(--light-text);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn:hover {
  background: var(--color2);
}
.btn.cancel { background: #888; }
.btn.cancel:hover { background: #555; }
img{
  max-width: 100%;
  height: auto;
  display: block;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem 0;
  background-color:  var(--color2);
  color:var(--light-text);
  font-size: 0.95rem;
  margin:0;
  margin-top: 1rem;
  display:flex;
  justify-content: space-around;
}
footer a{color:var(--light-text);}

/* standard styles */
.center{text-align: center;}
.errclass{font-style: italic; color:#E58429;}
#toolbar{display:flex; justify-content: space-around;background-color: var(--back-color); padding:1rem; border-radius: 1rem;}
.greybox{/*background-color: #eff7fc; */margin:0; padding:20px;}
/*layout styles */
.container {
  width:90%;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.flex-container{display:flex; justify-content: space-around; margin-top:2rem; padding: 2rem;}
.flex-child{background-color: #f2f2f2; border-radius: 3rem; padding:2rem;}
.flex-toolbar{background-color:#ffffff; display:flex;	justify-content: space-around;	align-items: flex-end; padding: 5px; border-radius: 5px; width:100%; margin:5px auto;}
.flex-toolbar select{background-color: #eeeeee; border-radius: 10px; width:15em; padding:5px; border:none; outline:none;}
#twocols{display:grid; grid-template-columns: 3fr 2fr;  min-height: 300px; }
.wavy-bottom {
    position: relative;
    padding-bottom: 20px;
}
.wavy-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background-repeat: repeat-x;
    background-position: 0 bottom;
    background-image:
        radial-gradient(50px 20px at 0% 100%, transparent 49px, white 50px),
        radial-gradient(50px 20px at 100% 100%, transparent 49px, white 50px);
    background-size: 50px 20px;
}
.companyname{ font-family: "Sigmar One"; margin:0; padding:0; text-align: center;  color: var(--color1);}
.maintitle{font-size: 2.5rem;}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.gray-card {
    background: #f2f2f2;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}
/* form */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}
.input-disabled {
    background: #e0e0e0;
    color: #666;
}
/* pops */
.form-popup{display:none; background-color:var(--ltgreen-back);max-width:50%; border-radius:10px; padding:.5rem; min-width: 300px;margin-top:1rem;}
#addTour, #sportForm, #addform{display:none; }
.editform table{width:80%;}
.editform td{padding:10px;}
.edit-grid{display: grid; grid-template-columns: 1fr 2fr; gap: 10px; max-width: 700px; align-items: center;}
.edit-grid label{color:var(--teal); font-weight: bold; padding: 5px;}
.edit-grid input{width: 100%;}
.edit-grid .form-submit{grid-column: 1 / -1; text-align: center;}
.cover-two{grid-column:1/3;}
/*grid */
.gridform {display: grid; grid-template-columns: 15rem auto; gap:0.75rem 2rem; width:100%; max-width: 700px;
@media (max-width: 600px) {
    .gridform {
        grid-template-columns: 1fr;  /* stacks to one column */
        gap: 1rem;
    }
}
}
.gridform, .gridformsimple label{color:#3B4C56; text-align: right; align-self:center; padding-top:0;width: min(100%, 600px); }
.gridform select{width: auto; min-width: 180px;}
.gridform input[type="number"] {width: 100px;}
.gridform input[type="datetime-local"] {width: 250px;}

.full-width{grid-column: span 2;}
.gridcenter{justify-self:center; grid-column: 1/3; margin-top:40px;}
#text, input[type=checkbox]{color:#ffffff; font-size:.8em;}
.formholder{max-width:50rem;	background-color: #E5FBFD; 	border-radius:5rem; margin:1rem auto;}
.formheader{background-color: #1FD4E4; color: #ffffff; font-weight:bold; text-align:center;border-top-left-radius:10px; border-top-right-radius:10px; padding: 10px;}
/* Tables */
.displaygrid{display: grid; grid-template-columns: 1fr 2fr 2fr 2fr 4fr 2fr 1fr 1fr;}
.displaygrid > span{padding: 4px 2px;}
.displaygrid > span:nth-child(16n+1),.displaygrid > span:nth-child(16n+2),.displaygrid > span:nth-child(16n+3),.displaygrid > span:nth-child(16n+4),
.displaygrid > span:nth-child(16n+5),.displaygrid > span:nth-child(16n+6),.displaygrid > span:nth-child(16n+7),.displaygrid > span:nth-child(16n+8){background-color: #d2e6f8;}
.displaygrid input{border-radius:0;	background-image:none;	background-color:none!important; background: transparent;	border:0;	outline: none;}
.displaygrid > span:nth-child(-n+8) { background-color: #2C679D;color:#ffffff; margin:5px; border-radius:5px;}
.displaygrid select{background:transparent; border:0; outline:none; width:100%; padding:2px;}
.inline-edit:focus, .inline-tribe:focus{background-color:#fff!important; outline:1px solid #357fc2;}

/*Data Tables */
/* Table wrapper - handles overflow on mobile */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-top: 1.5rem;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
thead th {
    background-color: var(--color1);
    color: var(--boring-back);
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    white-space: nowrap;
}
thead th:first-child { border-radius: 6px 0 0 0; }
thead th:last-child  { border-radius: 0 6px 0 0; }
.data-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.15s;
}
.data-table tbody tr:nth-child(even) {
    background-color: var(--ltgreen-back);   /* very light olive tint */
}
.data-table tbody tr:hover {
    background-color: var(--green-hover);   /* slightly deeper on hover */
    cursor: pointer;
}
tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Compact table — auto width instead of full-width stretch */
.table-compact {
  width: 50%;
  min-width: 400px;

}

.btn-edit,
.btn-delete {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.4rem;
}
td.btn-edit a {color: var(--color1); text-align: center;}
td.btn-delete a {color: var(--color1);}
td.btn-edit a:hover {color: var(--rust);}
td.btn-delete a:hover {color: var(--rust);}

/* Page header — title + action button on same line */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.page-header h2 { margin-bottom: 0; }

/* pagination */
.pagination{display:flex; justify-content:space-between; align-items:center; margin:15px 0;}
.pagination-left, .pagination-right{display:flex; gap:10px;}
.pagination a{color:var(--color1); font-size:1.2em;}
.pagination a:hover{color:var(--rust);}
.pagination-info{color:var(--color1); font-size:0.85em;}
.pagination-disabled{color:#ccc; font-size:1.2em;}
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
}
.badge-active   { background: #d4edda; color: #155724; }
.badge-past     { background: #f8d7da; color: #721c24; }
.badge-upcoming { background: #fff3cd; color: #856404; }
.badge-owner    { background: #cce5ff; color: #004085; }
.btn-danger { background-color: #c0392b; color: #fff; }
.btn-danger:hover { background-color: #a93226; }
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}
.hint {
    color: #666;
    font-style: italic;
    font-size: 0.95rem;
}
.hint a { color: var(--main-color); }
.msg-success {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* MENU */
/* Reset and base styles */
nav {
  margin-left: 0;
}
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  background-color: var(--dark-back);
}
.item {
  position: relative;
}
.item a {
  display: block;
  padding: 15px 20px;
  text-decoration: none;
  color: white;
  transition: background-color 0.3s ease;
}
.item a:hover {
  color: var(--color1);
}

/* Submenu styles */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--dark-back);
  min-width: 200px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}
.has-submenu:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Last nav item — drop submenu to the right edge so it doesn't go off-screen */
.item:last-child .submenu {
  left: auto;
  right: 0;
}
.subitem a {
  padding: 12px 20px;
  border-bottom: 1px solid #555;
  color: #ddd;
}
.subitem a:hover {
  color: var(--color1);
}
.subitem:last-child a {
  border-bottom: none;
}

/* Mobile hamburger menu */
.menu-toggle {
  display: none;
  background: #333;
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 18px;
}

/* Messages */
.messagebox {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.messagebox.success { background: #d4edda; color: #155724; }
.messagebox.error   { background: #f8d7da; color: #721c24; }

/* Pool page */
.pool-header { margin-bottom: 2rem; }
.pool-header h1 { margin-bottom: 0.25rem; }
.pool-meta { color: #555; font-size: 0.95rem; margin-bottom: 0.5rem; }
.pool-rules { color: #444; font-size: 0.9rem; margin-top: 0.5rem; }

.section { margin-bottom: 2.5rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.section-header h2 { margin-bottom: 0; }

.entry-cards { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.entry-card {
    background: var(--ltgreen-back);
    border: 1px solid #dde8c8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.entry-card-name { font-weight: bold; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.entry-card-name a { color: var(--teal); text-decoration: none; }
.entry-card-name a:hover { text-decoration: underline; }
.entry-card-stats { font-size: 0.875rem; color: #555; display: flex; gap: 1rem; }

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-error   { background: #f8d7da; color: #721c24; }

.highlight-row { background: #fffde7 !important; }

/* ── Scoring rules form ── */
.scoring-rules-block {
    grid-column: 1 / -1;
    background: var(--ltgreen-back);
    border: 1px solid #d0d8b0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
}
.scoring-rules-block h3 { margin: 0 0 0.85rem; font-size: 1rem; }
.scoring-rounds-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.scoring-round-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.scoring-round-cell input[type="number"] {
    width: 62px;
    text-align: center;
    font-size: 1rem;
    padding: 0.3rem;
}
.scoring-round-label { font-weight: 700; font-size: 0.82rem; color: #555; }
.scoring-option { display: flex; flex-direction: column; gap: 0.2rem; }
.scoring-option-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

/* ── Scoring summary (pool page) ── */
.scoring-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.5rem;
    font-size: 0.82rem;
    color: #555;
    margin-top: 0.5rem;
}
.sr-heading { font-weight: 700; color: #444; margin-right: 0.25rem; }
.sr-round   { font-weight: 600; color: #444; }
.sr-pts     { color: #666; margin-left: 1px; }
.sr-sep     { color: #ccc; margin: 0 0.1rem; }
.sr-bonus   { background: #e8f4e8; border: 1px solid #b8d8b8; border-radius: 4px; padding: 0.1rem 0.4rem; color: #2a6a2a; font-weight: 600; }

.rounds-badge { display: inline-block; white-space: nowrap; border: 1px dotted #c8ccb0; border-radius: 20px; padding: 0.15rem 0.75rem; font-size: 0.88rem; }
.rd-pipe { color: #bbb; font-weight: 300; }
.champ-pick { font-size: 0.9rem; }
.champ-won  { color: #155724; font-weight: 700; }
.champ-won::before  { content: '🏆 '; }
.champ-lost { color: #aaa; text-decoration: line-through; }
.muted { color: #aaa; }

.member-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.member-chip {
    background: var(--color2);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}
.empty-state { color: #666; font-style: italic; }
.action-bar { display: flex; gap: 1rem; margin-top: 1rem; }

/* Pool cards — used on home dashboard and My Pools page */
.pool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
/* ── Welcome blurb (logged-in index) ── */
.welcome-blurb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--ltgreen-back);
    border: 1px solid #d0d8b0;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: #333;
}

/* ── Rules banner (pool page, picks open) ── */
.rules-banner {
    background: #fffbea;
    border: 1px solid #f0d060;
    border-left: 4px solid #e6b800;
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-top: 0.75rem;
}
.rules-banner-heading { font-weight: 700; margin-bottom: 0.35rem; font-size: 0.95rem; }
.rules-banner-body    { font-size: 0.9rem; color: #444; line-height: 1.6; }

/* ── Rules collapsed (pool page, picks locked) ── */
.rules-collapsed { margin-top: 0.5rem; font-size: 0.85rem; color: #666; }
.rules-collapsed summary { cursor: pointer; font-weight: 600; color: #555; }
.rules-collapsed-body   { margin-top: 0.4rem; line-height: 1.6; }

/* ── Tournament panel (logged-out index) ── */
.tournament-panel {
    background: var(--dark-back);
    color: var(--light-text);
    padding: 2.5rem 0;
    margin-top: 2rem;
}
.tournament-panel-section { margin-bottom: 1.75rem; }
.tournament-panel-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color1);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.tournament-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}
.tournament-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}
.tournament-card-active { border-color: rgba(175,182,62,0.4); }
.tc-icon   { font-size: 1.75rem; flex-shrink: 0; }
.tc-body   { flex: 1; min-width: 0; }
.tc-name   { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta   { font-size: 0.78rem; color: #aaa; margin-top: 0.2rem; }

.pool-card {
    background: var(--ltgreen-back);
    border: 1px solid #dde8c8;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.pool-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pool-card-title a {
    color: var(--teal);
    text-decoration: none;
}
.pool-card-title a:hover { text-decoration: underline; }
.pool-card-meta {
    font-size: 0.9rem;
    color: #555;
}
.pool-card-stats {
    font-size: 0.875rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pool-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #dde8c8;
    flex-wrap: wrap;
    gap: 0.5rem;
}


/* ── Bracket ──────────────────────────────────────────────────────── */
.bracket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.bracket-header h1 { margin-bottom: 0.2rem; }
.bracket-meta { color: #555; font-size: 0.9rem; }

.bracket-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 3px solid var(--color1);
    margin-bottom: 0;
}
.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: #e0e0e0;
    color: #444;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background 0.15s;
}
.tab-btn.active { background: var(--color1); color: #fff; font-weight: bold; }
.tab-btn:hover:not(.active) { background: #ccc; }

.bracket-panel { display: none; padding: 1.25rem 0; }
.bracket-panel.active { display: block; }

.bracket-region { overflow-x: auto; padding-bottom: 0.5rem; }
.bracket-region-inner {
    display: flex;
    align-items: flex-start;  /* ← was stretch */
    min-width: 740px;
    position: relative;
}
.bracket-ff { min-height: 220px; }

.bracket-round {
    position: relative;
    width: 158px;
    flex-shrink: 0;
    overflow: visible;
}

/* Connector column */
.bracket-connector {
    width: 20px;
    flex-shrink: 0;
    position: relative;
      overflow: visible;
}
.conn-pair {
  display: none;
}

/* Game box */
.bracket-game {
    position: absolute;   /* JS sets top */
    width: 100%;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;     /* clip hover highlights to rounded corners */
}
/* Connector stubs are drawn entirely by JS — no pseudo-elements needed */

/* Team row */
.bracket-team {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    border: none;
    font-size: 0.72rem;
    height: 30px;
    transition: background 0.1s;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}
/* Separator between the two teams */
.bracket-team:first-of-type {
    border-bottom: 1px solid #eee;
}
.bracket-team:last-child { border-bottom: none; }
.bracket-team:hover:not(.tbd):not(.picked) { background: var(--green-hover); }
.bracket-team.picked        { background: var(--color1); color: #fff; font-weight: 600; }
.bracket-team.tbd           { color: #ccc; font-style: italic; cursor: default; }
.bracket-team.picked.winner { background: #27ae60; color: #fff; }
.bracket-team.picked.loser  { background: #e74c3c; color: #fff; }
.bracket-team input[type="radio"] { display: none; }
.bracket-team .seed {
    font-weight: 700;
    font-size: 0.6rem;
    min-width: 14px;
    color: #bbb;
    flex-shrink: 0;
    text-align: right;
}
.bracket-team.picked .seed { color: inherit; opacity: 0.7; }
.bracket-team .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-size: 0.73rem;
}
.ff-pending { color: #aaa; }
.ff-pending-name { font-size: 0.65rem; color: #aaa; white-space: normal; line-height: 1.2; }

/* Tiebreaker */
.tiebreaker-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 100px;
    padding: 0.75rem 1rem;
    background: var(--ltgreen-back);
    border-radius: 6px;
    font-size: 0.95rem;
}
.tiebreaker-section input[type="number"] { width: 90px; }

/* Save bar */
.bracket-save-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid #eee;
}
.pick-count { margin-left: auto; color: #666; font-size: 0.9rem; }

/* ── Wide Bracket Mode ─────────────────────────────────────────────── */
.wide-toggle {
    margin-left: auto;
    font-size: 0.78rem;
    background: #e8e8e8;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
}
.wide-toggle.active {
    background: var(--teal);
    color: #fff;
}

/* Round & region labels (hidden in normal tab mode) */
.round-label {
    display: none;
}
.region-heading {
    display: none;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.4rem 0 0.6rem;
    border-bottom: 2px solid var(--teal);
    margin-bottom: 0.5rem;
}

/* Wide mode: container goes full-width */
#bracket-container.wide-mode {
    width: 98%;
    max-width: none;
}

/* Hide tabs, show all panels in grid */
#bracket-container.wide-mode .bracket-tabs .tab-btn:not(.wide-toggle) {
    display: none;
}
#bracket-container.wide-mode #bracket-panels {
    display: grid;
    grid-template-areas:
        "east ff west"
        "south ff midwest";
    grid-template-columns: 1fr auto 1fr;
    overflow-x: auto;
    gap: 0;
}
#bracket-container.wide-mode .bracket-panel {
    display: block !important;
    padding: 0.5rem 0.25rem;
}
#bracket-container.wide-mode [data-region="east"]    { grid-area: east;    border-right: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="south"]   { grid-area: south;   border-right: 2px solid #ddd; border-top: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="ff"]      { grid-area: ff; display: flex !important; flex-direction: column; justify-content: center; padding: 0.5rem 1rem; position: relative; }
#bracket-container.wide-mode [data-region="west"]    { grid-area: west;    border-left: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="midwest"] { grid-area: midwest; border-left: 2px solid #ddd; border-top: 2px solid #ddd; }

/* Women's numbered regions: 1+4 on left, 2+3 on right (matches 1v4 / 2v3 FF pairings) */
#bracket-container.wide-mode [data-region="regional-1"] { grid-area: east;    border-right: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="regional-4"] { grid-area: south;   border-right: 2px solid #ddd; border-top: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="regional-2"] { grid-area: west;    border-left: 2px solid #ddd; }
#bracket-container.wide-mode [data-region="regional-3"] { grid-area: midwest; border-left: 2px solid #ddd; border-top: 2px solid #ddd; }

/* Show labels in wide mode */
#bracket-container.wide-mode .region-heading { display: block; }

/* Round labels: absolutely positioned above each round column so they
   don't participate in the flex layout and won't shift game positions */
#bracket-container.wide-mode .bracket-round {
    position: relative;
    padding-top: 22px; /* space for the label */
}
#bracket-container.wide-mode .round-label {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Give the region-inner top breathing room for round labels */
#bracket-container.wide-mode .bracket-region-inner {
    padding-top: 4px;
}

/* Right-side regions: flip round order so R1 is on the right */
#bracket-container.wide-mode [data-side="right"] .bracket-region-inner {
    flex-direction: row-reverse;
}
/* Right-side connector direction handled by JS isRight check */
/* Right-side drawn connector bars are handled by JS (isRight check) */

/* ── Wide mode: compact sizing ─────────────────────────────────────── */
#bracket-container.wide-mode .bracket-round {
    width: 118px;
    padding-top: 18px;
}
#bracket-container.wide-mode .bracket-connector {
    width: 14px;
}
#bracket-container.wide-mode .bracket-region-inner {
    min-width: unset;
}
#bracket-container.wide-mode .bracket-region {
    overflow-x: visible;
    padding-bottom: 0;
}
#bracket-container.wide-mode .bracket-team {
    height: 20px;
    font-size: 0.62rem;
    padding: 0 0.3rem;
    gap: 0.25rem;
}
#bracket-container.wide-mode .bracket-team .seed {
    font-size: 0.55rem;
    min-width: 11px;
}
#bracket-container.wide-mode .bracket-team .name {
    font-size: 0.63rem;
}
#bracket-container.wide-mode .region-heading {
    font-size: 0.72rem;
    padding: 0.25rem 0 0.4rem;
    margin-bottom: 0.25rem;
}
#bracket-container.wide-mode .round-label {
    font-size: 0.58rem;
}
/* FF section: wider connector and championship round in wide mode */
#bracket-container.wide-mode [data-region="ff"] .bracket-connector {
    width: 28px;
}
#bracket-container.wide-mode [data-region="ff"] [data-round="6"] {
    width: 138px;
}
/* FF wide mode: each semi-final team slot is its own independent box */
.ff-wide-slot {
    background: #fff;
    border: 1.5px solid #999 !important;   /* override first-of-type separator */
    border-radius: 4px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.13);
}
.ff-wide-slot:hover:not(.tbd):not(.picked) { background: var(--green-hover); }
.ff-wide-slot.picked        { background: var(--color1);  color: #fff; }
.ff-wide-slot.picked.winner { background: #27ae60;        color: #fff; }
.ff-wide-slot.loser,
.ff-wide-slot.picked.loser  { background: #e74c3c;        color: #fff; }

/* Prevent region panels from stretching to full grid row height (eliminates white space) */
#bracket-container.wide-mode [data-region="east"],
#bracket-container.wide-mode [data-region="south"],
#bracket-container.wide-mode [data-region="west"],
#bracket-container.wide-mode [data-region="midwest"],
#bracket-container.wide-mode [data-region="regional-1"],
#bracket-container.wide-mode [data-region="regional-2"],
#bracket-container.wide-mode [data-region="regional-3"],
#bracket-container.wide-mode [data-region="regional-4"] {
    align-self: start;
}
/* Compact tiebreaker in wide mode — stacked column so label wraps naturally */
#bracket-container.wide-mode .tiebreaker-section {
    margin-top: 0.5rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    line-height: 1.3;
}
#bracket-container.wide-mode .tiebreaker-section input[type="number"] {
    width: 64px;
}

/* ── Print styles ──────────────────────────────────────────────────── */
@media print {
    @page { size: landscape; margin: 0.35in; }

    /* Hide everything except the bracket */
    header, nav, .bracket-tabs, .bracket-save-bar,
    .tiebreaker-section, .bracket-header button,
    #print-bracket, footer, .footer { display: none !important; }

    body { background: #fff; font-size: 10px; }

    .bracket-header { margin-bottom: 0.1rem; }
    .bracket-header h1 { font-size: 0.9rem; margin-bottom: 0; }
    .bracket-meta { display: none; }
    .region-heading { padding: 0.15rem 0 0.2rem !important; margin-bottom: 0.15rem !important; }

    /* Force wide grid layout */
    #bracket-container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }
    #bracket-panels {
        display: grid !important;
        grid-template-areas: "east ff west" "south ff midwest" !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0 !important;
        overflow: visible !important;
    }
    .bracket-panel {
        display: block !important;
        padding: 0.25rem !important;
    }
    [data-region="east"]    { grid-area: east; border-right: 1px solid #ccc; }
    [data-region="south"]   { grid-area: south; border-right: 1px solid #ccc; border-top: 1px solid #ccc; }
    [data-region="ff"]      { grid-area: ff; display: flex !important; flex-direction: column; justify-content: center; padding: 0.25rem 0.5rem !important; }
    [data-region="west"]    { grid-area: west; border-left: 1px solid #ccc; }
    [data-region="midwest"] { grid-area: midwest; border-left: 1px solid #ccc; border-top: 1px solid #ccc; }
    [data-side="right"] .bracket-region-inner { flex-direction: row-reverse; }

    .region-heading { display: block !important; font-size: 0.65rem !important; }
    .round-label    { display: block !important; font-size: 0.5rem !important; }
    .bracket-round  { padding-top: 14px !important; }

    /* Compact game/team sizes for print */
    .bracket-round     { width: 75px !important; }
    .bracket-connector { width: 10px !important; }
    [data-region="ff"] .bracket-connector { width: 20px !important; }
    [data-region="ff"] [data-round="6"]   { width: 96px !important; }
    .tiebreaker-section { font-size: 0.65rem !important; padding: 0.25rem 0.5rem !important; margin-top: 0.25rem !important; }
    .bracket-team {
        height: 18px !important;
        font-size: 0.55rem !important;
        padding: 0 0.2rem !important;
    }
    .bracket-team .seed { font-size: 0.48rem !important; min-width: 9px !important; }
    .bracket-team .name { font-size: 0.55rem !important; }
    .bracket-game { box-shadow: none !important; }
    /* ff-wide-slot in print: no box-shadow, keep visible border */
    .ff-wide-slot { box-shadow: none !important; }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 999;
  }
  .menu.active {
    display: flex;
  }
  .item {
    width: 100%;
  }
  .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: #555;
    display: none;
  }
  .has-submenu.active .submenu {
    display: block;
  }
  .has-submenu > a::after {
    content: " ▼";
    float: right;
    transition: transform 0.3s ease;
  }
  .has-submenu.active > a::after {
    transform: rotate(180deg);
  }
  .subitem a {
    padding-left: 40px;
    background-color: #555;
  }
  .two-col-grid{ grid-template-columns: 1fr; }
  .data-table { font-size: 0.85rem; }
}

/* ── Suggestions ──────────────────────────────────────────────────── */
.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.suggestion-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 40px;
    flex-shrink: 0;
}
.vote-btn {
    background: none;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    width: 32px;
    height: 28px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.vote-btn:hover  { background: var(--green-hover); border-color: var(--color1); color: var(--color1); }
.vote-btn.voted  { background: var(--color1); border-color: var(--color1); color: #fff; }
.vote-count {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}
.suggestion-content  { flex: 1; min-width: 0; }
.suggestion-meta     { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; }
.suggestion-title    { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.suggestion-desc     { font-size: 0.85rem; color: #555; line-height: 1.5; }

.badge-info { background: #2980b9; color: #fff; }

.admin-note {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #eaf4fb;
    border-left: 3px solid #2980b9;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1a5276;
    line-height: 1.5;
}

/* Upset emoji */
.upset-emoji {
    display: inline-block;
    margin-left: 0.25rem;
    line-height: 1;
    animation: upsetPop 0.5s cubic-bezier(.36,1.56,.64,1) both;
    cursor: default;
}
.upset-emoji[data-level="minor"]   { font-size: 0.95em; }
.upset-emoji[data-level="major"]   { font-size: 1.1em;  animation-duration: 0.6s; }
.upset-emoji[data-level="huge"]    { font-size: 1.3em;  animation-duration: 0.7s; }
.upset-emoji[data-level="one-seed"]{ font-size: 1.3em;  animation-duration: 0.7s; animation-name: upsetSpin; }
@keyframes upsetPop {
    0%   { transform: scale(0);   opacity: 0; }
    70%  { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
@keyframes upsetSpin {
    0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
    70%  { transform: scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: scale(1)   rotate(0deg);  opacity: 1; }
}

/* Updates & News */
.updates-list { display: flex; flex-direction: column; gap: 1.25rem; }
.update-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.update-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.update-date { font-size: 0.85rem; color: #777; }
.update-title { margin: 0 0 0.6rem; font-size: 1.1rem; }
.update-body { color: #444; line-height: 1.6; font-size: 0.95rem; }
.update-body p { margin: 0 0 0.75rem; }
.update-body ul, .update-body ol { margin: 0 0 0.75rem 1.5rem; }
.update-body h2, .update-body h3 { margin: 1rem 0 0.4rem; }
.update-body blockquote { border-left: 3px solid #ccc; margin: 0.5rem 0 0.5rem 1rem; padding-left: 1rem; color: #666; }
.update-body hr { border: none; border-top: 1px solid #ddd; margin: 1rem 0; }
.update-body a { color: var(--teal); }
