* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.success {
  background-color: #C8E6C9;
}
.error {
  background-color: #FFCDD2;
}
.neutral {
  background-color: #BBDEFB;
}
.warn {
  background-color: #FFF9C4;
}
body, html {
    height: 100%;
    font-family: Arial, sans-serif;
    overflow: hidden;
    position: fixed;
    width: 100%;
}
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
#controlSection {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
#controlSection button {
  flex: 0 0 auto;
  font-weight: bold;
  font-style: italic;
}
.section {
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
}
.top-section {
    background-color: #f0f0f0;
    flex-direction: column;
    flex: 0 0 auto;
}
.middle-section {
    background-color: #e0e0e0;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.bottom-section {
    background-color: #d0d0d0;
    flex: 0 0 auto;
}
.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
button {
    flex: 1 0 calc(25% - 10px);
    margin: .2em;
    padding: 10px 5px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    word-break: break-word;
    text-align: center;
    flex-direction: column;
    border-radius: .5em;
}
button:active {
    background-image: linear-gradient(rgba(0, 0, 0, 0.151) 0 0);
}
.modal button.delete-button {
    flex: none;
}
.middle-section button {
    margin: 0;
    word-break: normal;
    line-height: 1.2em;
}
.bottom-section button {
    flex: 1 0 calc(33.333% - 10px);
}
.score-display button {
    padding: 5px;
    margin: 0 5px;
    display: inline;
}
.subheading {
  padding-top: .2em;
  font-size: .7em;
  opacity: .7;
  font-weight: bold;
  font-style: italic;
}
.active {
    background-color: #4CAF50;
    color: white;
}
.score-display {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    width: 50%;
    margin: 5px 0;
    align-self: center;
}

#success {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
}
#warn {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
}
#error {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
}
#neutral {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    width: 100%;
}

#shotSection > div {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
}

#shotSection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 100%;
}
@media (min-width: 768px) {
    button {
        flex: 1 0 calc(25% - 10px);
        font-size: 16px;
    }
    #statSection {
        grid-template-columns: repeat(auto-fit, minmax(calc(25% - 10px), 1fr));
    }
    .score-display {
        font-size: 20px;
    }
}
@media (max-height: 600px) {
    body, html, #app {
      height: 100%;
      position: fixed;
    }
    html {
      overflow-y: auto;
    }
    
    .middle-section {
      flex: 1 1 0;
      min-height: 0;
    }
}
.stat-popup {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #205a8a;
    pointer-events: none;
    animation: fadeOut 0.5s ease-out;
}
@keyframes fadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -100%) scale(1.5); }
}
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal button {
    flex: auto;
}
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 85%;
    max-width: 600px;
    overflow-x: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    height: auto;
    min-height: 0;
    display: inline;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
th, td {
    border: 1px solid #ddd;
    padding: 1px 5px;
    text-align: left;
    min-width: 3em;
}
th {
    background-color: #f2f2f2;
}
.table-container {
    overflow-x: auto;
    position: relative;
  }
  
  #statsTable {
    border-collapse: separate;
    border-spacing: 0;
  }
  
  .sticky-column {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #fff; /* Match this with your table background color */
  }
  
  /* Ensure the header cell is above the body cells */
  thead .sticky-column {
    z-index: 2;
  }
.team-item, .player-item {
    display: flex;
    margin-bottom: 5px;
}

.team-item button, .player-item button {
    margin-right: 5px;
}

.team-item input, .player-item input {
    flex-grow: 1;
    margin: 5px;
}

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.stat-tile {
    background-color: #f0f0f0;
    padding: 8px;
    border-radius: 5px;
    text-align: center;
}

.selected-team {
    background-color: #C8E6C9;
}