/* =====================================================
   DIGITAL DARTS LEAGUE — Unified Stylesheet
   (merged + cleaned)
   ===================================================== */

/* =========================
   1) BASE / GLOBAL
   ========================= */

body {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', sans-serif;
  background-color: #f0f0f0;
  overflow-x: hidden;
}
html { scrollbar-gutter: stable both-edges; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

.logo-text { font-weight: 700; font-size: 18px; letter-spacing: 1px; }

.document a,
.document a:visited { color: #ff7a00; text-decoration: none; font-weight: 500; }
.document a:hover { color: #000; }


/* =========================
   2) NAVBAR & DROPDOWNS
   ========================= */
.navbar {
  background-color: #000;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1500;
  height: 52px !important;
  padding: 0 12px;
  box-sizing: border-box;
}
.navbar::after {
  content: "";
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 3px;
  background-color: #ff7a00;
}

.nav-left ul {
  list-style: none; display: flex;
  margin: 0; padding: 0; align-items: center;
}
.nav-left li { position: relative; margin-right: 1.5rem; }
.nav-left a {
  color: #fff; text-decoration: none; font-weight: 500;
  font-size: 16px; padding: 10px 15px; white-space: nowrap; display: block;
}
.user-links a { color: #fff; text-decoration: none; font-weight: 500; }
.user-links a:hover { color: #ff7a00; }
.auth-actions a:visited { color: #ff7a00; }

.arrow { display: inline-block; width: 1em; text-align: center; transition: transform 0.3s ease; }
.dropdown.open > a .arrow,
.dropdown-submenu.open > a .arrow { transform: rotate(90deg); }

.dropdown-content,
.dropdown-subcontent {
  display: none;
  position: absolute;
  background-color: #222;
  min-width: 180px;
  border: 1px solid #444;
  z-index: 2005 !important;
  overflow: visible !important;
  opacity: 1 !important;
  transition: none !important;
}
.dropdown.open > .dropdown-content,
.dropdown-submenu.open > .dropdown-subcontent { display: block !important; }

.dropdown-content a,
.dropdown-subcontent a {
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  display: block;
}
.dropdown-content a:hover,
.dropdown-subcontent a:hover { background-color: #444; }

.dropdown-submenu { position: relative; }
.dropdown-subcontent {
  background-color: #111;
  border-left: 3px solid #ff7a00;
  white-space: nowrap;
}
.dropdown-submenu.open > .dropdown-subcontent {
  top: 100% !important; left: 0 !important; margin-left: 0 !important;
}

/* =========================
   3) PAGE LAYOUT / DOCUMENT
   ========================= */
.document {
  padding: 90px 15px 70px 15px;
  max-width: 900px;
  margin: 0 auto;
  background-color: transparent;              /* let grey body show through */
  background-image: url("images/combined_footer_overlay.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: 240px auto;
  color: #000;
  min-height: calc(100vh - 70px);
  box-sizing: border-box;
}

.doc-logo { text-align: center; margin-bottom: 1.5rem; }
.doc-logo img { width: 120px; max-width: 100%; height: auto; }
.title { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 1rem; }
p.welcome { text-align: center; font-size: 15px; color: #333; margin: 0.5rem 0 1rem 0; }

/* =========================
   4) FOOTER (FIXED)
   ========================= */
.fixed-footer {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background: #000; padding: 0.8rem 0;
  display: flex; justify-content: space-around; align-items: center;
  border-top: 3px solid #ff7a00;
  z-index: 1200;
}
.fixed-footer a {
  color: #fff; font-size: 1.6rem; text-decoration: none; transition: color 0.2s ease;
}
.fixed-footer a:hover { color: #ff7a00; }
@media (max-width: 500px) {
  .fixed-footer a { font-size: 1.4rem; }
}

/* =========================
   5) MODALS (GENERIC + LOGIN)
   ========================= */
.modal {
  display: none; position: fixed; z-index: 2000; left: 0; top: 0;
  width: 100%; height: 100%; overflow: auto;
  background-color: rgba(0,0,0,0.6);
}
.modal-content {
  background-color: #fff; margin: 15% auto; padding: 20px;
  border: 3px solid #ff7a00; width: 90%; max-width: 400px;
  border-radius: 8px; text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.modal-content p { color: #333; font-size: 1rem; }
.close { color: #aaa; float: right; font-size: 24px; font-weight: bold; cursor: pointer; }
.close:hover, .close:focus { color: #ff7a00; }

/* Login modal */
#loginModalOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center; justify-content: center;
  z-index: 2000;
}
#loginModal {
  background: #fff; color: #000;
  width: min(92vw, 420px);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border-top: 4px solid #ff7a00;
}
#loginModal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid #eee; font-weight: 700;
}
#loginModal header .close-btn {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
}
#loginModal .content { padding: 1rem; }
#loginModal .actions {
  padding: 0 1rem 1rem 1rem; display: flex; justify-content: flex-end;
}
#loginModal .actions button {
  background: #ff7a00; color: #fff; border: none;
  padding: 0.5rem 1rem; border-radius: 4px; font-weight: 700; cursor: pointer;
  transition: background .2s ease;
}
#loginModal .actions button:hover { background: #e66a00; }

/* =========================
   6) CONTACT FORM
   ========================= */
#contactForm { display: flex; flex-direction: column; gap: 12px; }
#contactForm label { font-weight: 600; margin-bottom: 4px; }
#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm input[type="tel"],
#contactForm textarea {
  padding: 10px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 14px; width: 100%; box-sizing: border-box;
}
#contactForm textarea { min-height: 120px; resize: vertical; }
#contactForm button {
  background-color: #ff7a00; color: #fff; padding: 10px 18px;
  border: none; border-radius: 6px; cursor: pointer; font-weight: 700;
  width: auto !important; display: inline-block !important;
}
#contactForm button:hover { background-color: #e66a00; }
#contactForm .note { font-size: 0.85rem; color: #666; margin-top: -8px; }

.hp-wrap {
  display: none !important; visibility: hidden !important;
  height: 0 !important; overflow: hidden !important;
  margin: 0 !important; padding: 0 !important;
}

/* =========================
   7) RULES PAGES
   ========================= */
.rules-page h2 {
  font-size: 15px; margin-top: 1.8rem; margin-bottom: 0.4rem; font-weight: 700;
}
.rules-page ul { margin-top: 0.5rem; padding-left: 1.2rem; }
.rules-page li { margin-bottom: 0.5rem; line-height: 1.5; }

/* =========================
   8) TABLES / OPPONENT FINDER
   ========================= */
.players-table-wrapper {
  display: flex; justify-content: center; width: 100%;
  overflow-x: visible; padding-bottom: 1rem;
}
.players-table {
  width: 100%; border-collapse: collapse;
  margin: 20px auto 0 auto; table-layout: auto;
}
.players-table th,
.players-table td {
  border: 1px solid #ccc; padding: 8px; text-align: left;
  word-break: break-word; white-space: normal;
}
.players-table th { background-color: #ff7a00; color: #fff; }
.players-table tr:nth-child(even) { background-color: #f9f9f9; }
.players-table a,
.players-table a:visited { color: #000; text-decoration: none; font-weight: 500; }
.players-table a:hover { color: #ff7a00; }

@media (max-width: 700px) {
  .players-table-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto;
    max-width: 100vw; box-sizing: border-box;
  }
  .players-table { width: 100%; max-width: 100%; min-width: unset; table-layout: auto; }
}

.add-opponent-table {
  width: 100%; max-width: 500px; margin: 0 auto 20px; border-collapse: collapse;
  font-family: 'Raleway', sans-serif;
}
.add-opponent-table td {
  padding: 10px 8px; font-size: 16px; vertical-align: middle; color: #000;
}
.add-opponent-table label { font-weight: 600; white-space: nowrap; }
.add-opponent-table input[type="text"],
.add-opponent-table input[type="tel"] {
  width: 100%; padding: 8px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px;
}
.add-opponent-form .auth-actions { text-align: center; margin-top: 20px; }
.add-opponent-form button[type="submit"] {
  background-color: #ff7a00; color: #fff; border: none; padding: 10px 20px;
  font-weight: 700; font-size: 16px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.3s ease;
}
.add-opponent-form button[type="submit"]:hover { background-color: #e96b00; }

.auth-form-table {
  width: 100%; max-width: 500px; margin: 0 auto 20px; border-collapse: collapse;
}
.auth-form-table td {
  padding: 10px 8px; font-size: 16px; vertical-align: middle; color: #000;
}
.auth-form-table label { font-weight: 600; white-space: nowrap; }
.auth-form-table input[type="text"],
.auth-form-table input[type="password"],
.auth-form-table input[type="email"] {
  width: 100%; padding: 8px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px;
}
.auth-form-actions { text-align: center; margin-top: 20px; }
.auth-form-actions button[type="submit"],
.auth-form-actions input[type="submit"] {
  background-color: #ff7a00; color: #fff; border: none; padding: 10px 20px;
  font-weight: 700; font-size: 16px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.3s ease;
}
.auth-form-actions button[type="submit"]:hover,
.auth-form-actions input[type="submit"]:hover { background-color: #e66a00; }
.auth-form-table select,
.auth-form-table input[type="number"],
.auth-form-table input[type="date"],
.auth-form-table textarea {
  width: 100%;
  padding: 8px;
  font-size: 16px;
  font-family: 'Raleway', sans-serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #000;
  box-sizing: border-box;
}
.auth-form-table select:focus,
.auth-form-table input[type="number"]:focus,
.auth-form-table input[type="date"]:focus,
.auth-form-table textarea:focus {
  outline: 2px solid #ff7a00;
}

/* =========================
   9) SEARCH BAR (opponent finder)
   ========================= */
.search-bar { text-align: center; margin-bottom: 20px; }
.search-bar input {
  padding: 10px; border-radius: 6px; border: 1px solid #ccc; font-size: 15px; width: 280px;
}
@media screen and (max-width: 480px) {
  .search-bar input { width: 90%; }
}

/* =========================
   10) DASHBOARD BUTTONS
   ========================= */
.dash-btn {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-width: 140px;
  transition: background-color 0.2s ease;
  box-shadow: none !important;
}
.dash-btn:hover { background-color: #e66a00; }
.user-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-initial-circle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: #ff7a00;
  color: black;
  font-weight: bold;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  border: 2px solid #000;
}
.user-initial-wrapper a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
.success-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 12px;
  margin: 20px auto;
  width: 80%;
  text-align: center;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 12px;
  margin: 20px auto;
  width: 80%;
  text-align: center;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
}

/* === TOURNAMENT CARDS: Clean layout for all screens === */
.tournament-card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 30px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  align-items: stretch;
  box-sizing: border-box;
  padding: 0 12px;
}

.tournament-card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  flex: 0 0 300px;
  max-width: 300px;
  box-sizing: border-box;
}

.tournament-card {
  background: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}

.tournament-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 2;
}

.tournament-card h3 {
  margin-top: 0;
  font-size: 20px;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
  margin-bottom: 10px;
  text-align: center;
}

.tournament-card p {
  margin: 6px 0;
  font-size: 15px;
}

.tournament-card p:last-of-type {
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .tournament-card-grid {
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
  }
  .tournament-card-link {
    width: 100%;
    max-width: 100%;
  }
  .tournament-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

@media (min-width: 769px) {
  .tournament-card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  .tournament-card-link {
    flex: 0 0 300px;
    max-width: 300px;
    box-sizing: border-box;
  }
  .tournament-card {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ==========================================
   UNIFIED: Side-by-side Tournament Buttons
   ========================================== */
.my-tournament-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 12px;
}

.my-tournament-buttons form {
  flex: 0 0 auto;
  max-width: 140px;
  margin: 0;
}

.my-tournament-buttons button {
  width: auto;
  white-space: nowrap;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #ff7a00;
  color: white;
  transition: background-color 0.2s ease;
}

.my-tournament-buttons button:hover {
  background-color: #e66a00;
}

.my-tournament-buttons .btn-orange {
  background-color: #ff7a00;
  color: white;
  transition: background-color 0.2s ease;
  width: auto !important;
  flex: 1;
}

@media (max-width: 500px) {
  .my-tournament-buttons {
    flex-wrap: wrap;
  }
  .my-tournament-buttons form {
    flex: 1 1 45%;
  }
  .my-tournament-buttons button {
    width: 100%;
  }
}

/* =========================
   NEWS ANNOUNCEMENTS
   ========================= */
.news-section {
  margin-top: 30px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.news-title {
  font-size: 1.4em;
  margin-bottom: 20px;
  font-weight: bold;
  color: #ff7a00;
}

.news-heading {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 0;
  color: #ff7a00;
}

.news-date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
  display: block;
}

/* Existing style stays the same */
.news-item {
  margin-bottom: 25px;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease;
}

/* Hover effect stays */
.news-item:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* Make the sign-up link stand out a bit */
.signup-link {
  color: #ff7a00;
  text-decoration: underline;
  font-weight: bold;
}
.signup-link:hover {
  color: #e65c00;
}

.news-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.news-content p {
  margin: 5px 0;
  color: #444;
}

.news-link {
  color: #007bff;
  text-decoration: underline;
}
.btn-remove-inline {
  background-color: #ff7a00;
  color: white;
  border: none;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px;
}

.btn-remove-inline:hover {
  background-color: darkorange;
}

.btn-orange {
  background-color: #ff7a00;
  color: white !important;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  font-family: 'Raleway', sans-serif;
}

.btn-orange:hover {
  background-color: #e66a00;
}

.status-message {
  text-align: center;
  margin: 10px auto;
}

.tournament-edit-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.tournament-edit-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tournament-edit-wrapper form p {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
}

.tournament-edit-wrapper input[type="text"],
.tournament-edit-wrapper input[type="number"],
.tournament-edit-wrapper input[type="date"],
.tournament-edit-wrapper select,
.tournament-edit-wrapper textarea {
  padding: 8px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 400px;
}

.tournament-edit-wrapper textarea {
  resize: vertical;
}

.tournament-edit-wrapper .btn-orange {
  width: fit-content;
  padding: 8px 14px;
  margin-top: 0.5rem;
}

ul.player-list {
  list-style-type: none;
  padding-left: 0;
}

ul.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.player-info {
  font-weight: 500;
}

.dartsmind-username {
  color: #666;
  font-size: 0.9em;
  margin-left: 8px;
}

.bracket-match {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fdfdfd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.bracket-player-left,
.bracket-player-right {
  flex: 1 1 45%;
  text-align: center;
}

.bracket-vs {
  flex: 0 0 40px;
  text-align: center;
  font-weight: bold;
  color: #666;
}
@media screen and (max-width: 500px) {
  .add-opponent-table,
  .auth-form-table {
    width: 100%;
    font-size: 14px;
  }

  .add-opponent-table td,
  .auth-form-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }

  .add-opponent-table input,
  .auth-form-table input,
  .auth-form-table select,
  .auth-form-table textarea {
    width: 100%;
    box-sizing: border-box;
  }

  .auth-actions,
  .add-opponent-form .auth-actions {
    text-align: center;
    margin-top: 20px;
  }
}
.nav-logo-centered {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-logo-centered img {
  height: 44px;
  object-fit: contain;
}
.form {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

.form label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.form input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  margin-top: 5px;
  box-sizing: border-box;
}

.form button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #ff7a00;
  color: white;
  border: none;
  margin-top: 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.form button:hover {
  background-color: #e68a00;
}

.form p {
  margin-top: 20px;
  font-size: 15px;
  text-align: center;
}
.fixed-back-bar {
  position: fixed;
  top: 52px; /* directly under navbar */
  left: 0;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  z-index: 1400;
  padding: 8px 20px;
}

.back-link {
  color: #ff7a00;
  font-size: 15px;
  text-decoration: none;
  font-weight: normal;
}
.back-link:hover {
  color: #000;
}
.my-tournament-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
}

.my-tournament-buttons form {
  flex: 1 1 auto;
}

.my-tournament-buttons button {
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
}
.bracket-tabs-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bracket-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

  .rulescard {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 15px;
  }
  
 .rulescard h2 {
  font-size: 17px; margin-top: 1.8rem; margin-bottom: 0.4rem; font-weight: 700;
}

.rulescard ul { margin-top: 0.5rem; padding-left: 1.2rem; }
.rulescard li { margin-bottom: 0.5rem; line-height: 1.5; }
