/* ============================
   Global & Layout
============================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #111;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 20px;
}

/* ============================
   Headings
============================ */

h1 {
    margin: 0 0 12px;
}

/* ============================
   Layout Helpers
============================ */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.two-col {
    display: flex;
    gap: 12px;
}

.two-col > div {
    flex: 1;
}

/* ============================
   Card & UI Elements
============================ */

.card {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.small-card {
    background: #fbfbff;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* ============================
   Form Controls
============================ */

input[type="text"],
input[type="file"],
input,
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* ============================
   Buttons
============================ */

button {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #bfc9d8;
    background: #fff;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #f0f4f8;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================
   Grid & Match Blocks
============================ */

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
}

.match-btns button {
    margin-left: 4px;
}

/* ============================
   Text Helpers
============================ */

.muted {
    font-size: 0.95em;
    color: #6b7280;
}

.winner {
    font-weight: 700;
    color: #065f46;
}

/* ============================
   Footer
============================ */

footer {
    margin-top: 20px;
    font-size: 0.9em;
    color: #6b7280;
}


#tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.tab-btn {
  padding: 8px 16px;
  background: #ccc;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

.tab-btn.active {
  background: #666;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

#standings {
  margin-top: 20px;
  padding: 10px;
  background: #f4f4f4;
  border-radius: 8px;
}

.undo-btn {
    margin-top: 6px;
    padding: 6px 10px;
    background: #ffe8e8;
    border: 1px solid #f5b5b5;
    color: #a33;
    border-radius: 6px;
    cursor: pointer;
}
.undo-btn:hover {
    background: #ffd6d6;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.usage-table th,
.usage-table td {
    border: 1px solid #d0d7de;
    padding: 6px 8px;
    text-align: center;
}

.usage-table th {
    background: #f0f3f8;
}

.usage-cell {
    background: #ffffff;
}
.deck-matrix td, .deck-matrix th {
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #d0d0d0;
}

.total-row {
    background: #f0f4ff;
    font-weight: bold;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.list-item span {
    flex: 1;
}

.mini-btn {
    font-size: 0.8em;
    padding: 4px 6px;
    margin-left: 6px;
}

.mini-btn.danger {
    background: #fee;
    border: 1px solid #f99;
    color: #a00;
}

.static-text p,
.static-text ul,
.static-text li {
    margin: 4px 0;
    font-size: 1rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-item {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    padding: 6px 0;
    border-bottom: 1px solid #e3e6f0;
}

.schedule-time {
    font-weight: bold;
    color: #374151;
    width: 180px;
}

.schedule-desc {
    color: #111827;
}

.tourney-notes {
    font-size: 1rem;
    line-height: 1.55;
    color: #1f2937;
}

.tourney-notes .intro {
    margin-bottom: 12px;
    font-weight: 500;
}

.tourney-notes .notes-section {
    margin: 16px 0;
    padding: 12px 14px;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
}

.tourney-notes h3 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    color: #1e3a8a;
}

.tourney-notes h4 {
    margin: 10px 0 4px 0;
    font-size: 1.05rem;
    color: #334155;
}

.tourney-notes ul {
    margin: 6px 0 6px 20px;
}

.tourney-notes li {
    margin-bottom: 4px;
}

.tourney-notes .subnote {
    margin-top: 6px;
    font-style: italic;
    color: #4b5563;
}
