.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 0;
    margin-top: 0;
}

.tableprime {
    border-collapse: collapse;
    min-width: 1400px;
}

th, td {
    padding: 8px 12px;
    white-space: nowrap;
}

thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

@media (max-width: 768px) {
    .table-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: auto;
        margin-left: 0;
        margin-top: 0;
    }

    .tableprime {
        min-width: 1200px;
    }

    th, td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .stat-title {
        font-size: 24px;
    }

    .sortable-header {
        font-size: 12px;
        gap: 2px;
    }

    .arrow {
        font-size: 10px;
    }

    .edit-button {
        font-size: 11px;
        padding: 2px 5px;
    }

    .edit-button2 {
        font-size: 9px;
        padding: 2px 5px;
    }

    thead th {
        position: static;
    }
}

.stat-title{
    text-align: center;
    color:black;
    text-decoration: none;


}

.stat-link{

    color:black;
    text-decoration: none;
}
.stat-title:hover{
    text-align: center;
    color:purple;
    text-decoration: none;


}


.stat-link:hover{

    color:purple;
    text-decoration: none;

}


.lowering-symbol{
   color:red;
   font-size:30px
}

.rising-symbol{
   color:blue;
   font-size:30px
}

.neutral-symbol{
   color:gray;
   font-weight: 900;
   font-size:30px

}

.edit-button {
    background-color:#198754;
    border: outset;
    color: white;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 100%;


}



/* Ensure the first cell is the anchor */
.edit-action-cell {
    position: relative; /* This makes the top:0/left:0 work */
    padding: 0 !important; /* Remove padding so button hits the very corner */
    width: 60px; /* Give it enough width so it doesn't squish */
    vertical-align: top;
}

.edit-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.edit-button2 {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    background-color: purple;
    color: white;
    border: none;
    font-size: 10px;
    padding: 2px 6px;
    cursor: pointer;
}



/* Trigger hover on the ROW, show button in the CELL */
.player-row:hover .edit-button2 {
    opacity: 1;
    visibility: visible;
}



/* Styling specific options by value */
.trend-select option[value="Neutral"] {
  color: gray;
}

.trend-select option[value="Lowering"] {
  color: red;
  font-weight: bold; /* Support varies by browser */
}

.trend-select option[value="Rising"] {
  color: green;
  font-weight: bold;
}

/* Styling the option that is currently selected in the list */
.trend-select option:checked {
  background-color: #f0f0f0;
}

.trend-select {

  width: auto;          /* Let it fit the content or set a fixed width like 100px */
  font-size: 0.8rem;    /* Makes the text and box height smaller */
  padding: 2px 5px;     /* Reduces internal spacing */
  height: 28px;
}



.sortable-header {
    text-decoration: none;
    color: #222;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s ease;
}

.sortable-header:hover {
    color: #0077cc;
}

.sortable-header.active {
    font-weight: 700;
}

.arrow {
    font-size: 0.75rem;
}

/* Color direction */
.arrow.asc {
    color: green;
}

.arrow.desc {
    color: red;
}


.games-table {
    background-color: beige;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}






.team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.players {
    display: flex;
    gap: 10px; /* THIS adds spacing between names */
    flex-wrap: wrap;
    justify-content: center;
}

.player-name {
    font-weight: bolder;
    background: #dcc4395c;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
}
.vs {
    font-weight: 900;
    font-size: 44px;
}

.winner {
    margin-top: 8px;
    font-weight: bold;
    color: green;
    font-size: 20px;
}


.winning-team {
    background-color: #d4edda;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 10px;
    transition: all 0.3s ease-in-out;
}

.winning-team:hover {
    transform: scale(1.03);
}

.edit-btn {
    color:black;
    position: relative;
    padding: 10px 20px;
    border-radius: 150px;
    border: 1px solid rgb(61, 106, 255);
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    background: transparent;

    overflow: hidden;
    box-shadow: 0 0 0 0 transparent;
    -webkit-transition: all 0.2s ease-in;
    -moz-transition: all 0.2s ease-in;
    transition: all 0.2s ease-in;
    font-family:nter, Helvetica, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", EmojiSymbols, -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;


}



.edit-btn:hover {
  background-color: black;
  color: beige;
}

/* wrapper for the two side-by-side tables */
.double-table{
  display: flex;
  gap: 30px;
  align-items: flex-start;
  width: 100%;
  margin-left: 0;
  overflow-x: auto;
}

/* each table */
.side-table{
  width: max-content;        /* shrink-wrap to content (headers/cells) */
  max-width: 100%;           /* but don't overflow container */
  border-collapse: collapse;
  table-layout: auto;        /* let browser size by content */
  font-size: 11px;
  background: #fff;
  border: 1px solid #444;
}

/* cells */
.side-table th,
.side-table td{
  border: 1px solid #777;
  padding: 4px 5px;
  text-align: center;
  white-space: nowrap;
}

/* title row like the picture */
.side-table .side-title{
  background: #eee;
  font-weight: 800;
  font-size: 18px;
  color: #b00000;
  text-align: left;
}

/* column sizing: give Player more space */
.side-table .col-player{
  width: auto;        /* allow column to grow */

  text-align: left;
}
.side-table .col-stat{
  width: 8%;
}
.side-table .col-shot{
  width: 12%;
}

/* Player name cell: allow wrapping so names don't clip */
.side-table td.player{
  text-align: left;
  font-weight: 600;
  white-space: nowrap;     /* allows wrapping */
  word-break: break-word;/* prevents overflow for very long names */
  width:auto
}

/* keep stacked on small screens */
@media (max-width: 900px){
  .double-table{ flex-direction: column; }
  .side-table{ width: 100%; }
}

.game-title{
    margin-left: 38%;
    font-size:32px;
    font-weight:800;
    margin-bottom:20px;
}

.playersweekly{
    font-size:11px;
    text-align:left;
}

.vsweekly{
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 0;
}

.table-containerweekly {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.playercard {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  padding: 18px;
}

.playercard-left {
  width: 150px;
  flex: 0 0 150px;
}

.playercard-pic {
  width: 150px;
  height: 150px;
  object-fit: cover;
  display: block;
  border: 1px solid #ddd;
  background: #fafafa;
}

.playercard-right {
  flex: 1;
  min-width: 0;
}

.playercard-title {
  font-size: 44px;
  font-weight: 900;
  margin: 0 0 10px 0;
  line-height: 1;
}

.playercard-subname {
  font-size: 18px;
  margin: 0 0 6px 0;
}

.playercard-nicknames {
  font-size: 16px;
  font-style: italic;
  margin: 0 0 12px 0;
}

.playercard-measurements {
  display: flex;
  gap: 18px;
  margin: 6px 0 16px 0;
  flex-wrap: wrap;
}

.measure {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.measure-label {
  font-weight: 700;
  font-size: 14px;
  color: #444;
}

.measure-value {
  font-size: 14px;
  color: #111;
}

.playercard-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 10px;
  max-width: 520px;
}

.statbox {
  border: 1px solid #ddd;
  background: #f8f8f8;
  padding: 10px 10px;
  text-align: center;
}
.statbox-involvement {
  border: 1px solid #ddd;
  background: #f8f8f8;
  padding: 10px 10px;
  text-align: center;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* vertical centering */
  align-items: center;      /* horizontal centering */
  text-align: center;
  cursor: help;
}
.statbox-gw{
  border: 1px solid #ddd;
  background: #f8f8f8;
  padding: 10px 10px;
  text-align: center;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* vertical centering */
  align-items: center;      /* horizontal centering */
  text-align: center;



}

.stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #444;
}

.stat-labelvolvement {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #444;
}

.stat-labelgw{
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #444;


}



.stat-value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 4px;
}

/* Mobile */
@media (max-width: 650px) {
  .playercard {
    flex-direction: column;
    align-items: center;
  }
  .playercard-left {
    width: 180px;
    flex-basis: auto;
  }
  .playercard-pic {
    width: 180px;
    height: 180px;
  }
  .playercard-title {
    font-size: 34px;
    text-align: center;
  }
  .playercard-stats {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }
}

.nickname-chip{
    background:#eee;
    padding:3px 8px;
    border-radius:12px;
    font-size:12px;
    margin-right:4px;
}

.table-table{
    display: flex;
    align-items: center;

    align-content: center;
    flex-wrap: wrap;

}
.nameinfo{
    color:black;
    text-decoration: none;
    font-weight: 900;
    font-family: Arial, sans-serif;
    font-size:17px

}





.nameinfo:hover{

    color:purple;
    text-decoration: none;
    font-weight: 900;
    font-family: Arial, sans-serif;
    font-size:17px


    }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.player-cardinfo{
    background-color: cornsilk;
    border: 2px solid black;
    padding: 10px;
    font-size: 12px;
    text-align: center;
    flex: 0 0 calc(100% / 5);
    box-sizing: border-box;


}


.trend-up {
    color: green;
    font-size: 20px;
}

.trend-down {
    color: red;
    font-size: 20px;
}

.trend-neutral {
    color: gray;
    font-size: 20px;
}


.play-rank{

    font-size:20px;
    font-family: "Sofia", sans-serif;
    font-weight: 900;
    color:purple;
    font-variant: small-caps;
}

.ranking-title{
    font-family: "Brush Script MT", cursive;
    color:black;
    font-weight: 900;
    text-align: center;

}

.stat-labelvolvement{
    position: relative;
    cursor: help;
}

.desc-box{
    display: none;
    position: absolute;
    top: 425%;            /* puts it above the label */
    left: 50%;
    transform: translateX(-50%);

    background: rgba(0,0,0,0.75);   /* transparency */
    color: white;

    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    width: 200px;
    text-align: center;
}

.desc-box:after{
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(0,0,0,0.75);
}

/* show tooltip when hovering label */
.stat-labelvolvement:hover .desc-box{
    display: block;
}

.statbox-involvement:hover .desc-box{
    display: block;
}

.game-form-wrap {
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
}

.game-form-title {
    font-size: 32px;
    margin-bottom: 20px;
}

.game-top-bar,
.winner-section {
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group.small {
    width: 110px;
}

.field-group label,
.winner-label {
    font-weight: 600;
}

.field-group input,
.field-group select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.winner-options {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}





.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 14px;
}

.players-table-wrap {
    overflow-x: auto;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

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

.players-table th {
    background: #f5f5f5;
}

.players-table select,
.players-table input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.submit-row {
    margin-top: 24px;
    text-align: center;
}



.submit-btn {
    padding: 12px 22px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: #111;
    color: white;
}

.submit-btn:hover {
    opacity: 0.9;
}

.message-box {
    margin-top: 18px;
    font-weight: 600;
    text-align: center;
}

.message-success {
    color: green;
}

.message-error {
    color: red;
}

.teams-container {
    display:flex;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.team-card {
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 16px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .teams-container {
        grid-template-columns: 1fr;
    }
}
