/* ===== GLOBAL ===== */
html, body {
  font-family: sans-serif;
  margin: 0;
  padding: 20px;
  background: #f2f2f2;
  height: 100%;
  overflow: hidden;
}

h1 {
  font-size: 38px;
  margin-bottom: 20px;
}

/* ===== TEAM SELECTION ===== */
.teams {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.team {
  width: 45%;
  text-align: center;
}

.team h2 {
  font-size: 48px;
  margin-bottom: 40px;
}

select {
  width: 100%;
  padding: 20px;
  font-size: 24px;
  border-radius: 12px;
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
  background: white;
}

th, td {
  padding: 14px;
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-top: 1px solid #ccc;
  text-align: left;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* ===== SCROLLABLE PLAYER TABLE ===== */

.table-scroll {
  max-height: calc(100vh - 260px);  /* leaves room for header + button */
  overflow-y: auto;
  background: white;
  border-radius: 8px;
}

/* ===== STICKY TABLE HEADER ===== */

.table-scroll thead th {
  position: sticky;
  top: 0;
  background: #d3d3d3;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* smoother scrolling on touch devices */
.table-scroll {
  -webkit-overflow-scrolling: touch;
}

/* ===== MAIN ACTION BUTTON ===== */
.action-btn {
  position: fixed;
  bottom: 20px;
  right: 40px;
  font-size: 26px;
  padding: 15px 30px;
  border-radius: 12px;
  background: #28a745;
  color: white;
  border: none;
}

.action-btn:disabled {
  background: #9fc49f;
}

/* Optional visual feedback when enabled */
.action-btn.enabled {
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}


/* ===== LIVE MATCH LAYOUT ===== */

.match-container {
  display: flex;
  align-items: flex-start;
  height: calc(100vh - 40px);
  flex-direction: row;
  height: 100vh;
}

.team-panel {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 40px;
  overflow: hidden;
}


.team-panel h2 {
  font-size: 38px;
  margin: 20px 0;
  text-align: center;
  max-width: 80%;
  word-break: break-word;
  min-height: 90px;   
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.team-spacer {
  flex: 1;
  margin-top: 150px;
}

.team-logo {
  position: absolute;
  opacity: 0.20;
  max-width: 60%;
  max-height: 60%;
  z-index: 1;
}

.team-actions {
  display: flex;
  flex-direction: column;
  gap: 40px;
  z-index: 2;
  margin-bottom: 40px;
}

.team-actions button {
  font-size: 32px;
  padding: 22px 38px;
  border-radius: 16px;
}

.goal-btn {
  background: #28a745;
  color: white;
  border: none;
}

.penalty-btn {
  background: #ffb703;
  color: black;
  border: none;
}

.end-match-btn {
  left: 50%;
  transform: translateX(-50%);
  right: auto;              
  background: #2196f3;
}


.end-btn {
  background: #2196f3;
  color: white;
  border: none;
}

.center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 120px;
}

/* SCORE */
.score-box {
  font-size: 52px;
  font-weight: bold;
  background: white;
  padding: 20px 40px;
  border-radius: 18px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* PHASE TEXT */
.match-phase {
  font-size: 22px;
  font-weight: 600;
  color: #333;
}

/* PHASE BUTTONS */
.phase-buttons {
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
}

.phase-buttons button {
  background: #555;
  color: white;
  border: none;
  padding: 14px 22px;
  font-size: 18px;
  border-radius: 12px;
}

button:disabled {
  background: #aaa;
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(100%);
}

.phase-normal {
  background: #4caf50; /* green */
}

.phase-overtime {
  background: #ff9800; /* orange */
}

.phase-shootout {
  background: #f44336; /* red */
}

.center-phase-buttons {
  margin-top: 10px;
}

/* ===== MODALS ===== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal.active {
  display: flex;
}

.modal-box {
  background: white;
  padding: 30px;
  width: 400px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-box h3 {
  text-align: center;
  font-size: 28px;
}

.modal-box input,
.modal-box select {
  font-size: 22px;
  padding: 12px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* ===== MODAL BUTTONS ===== */

.modal-actions button {
  font-size: 24px;
  padding: 18px 28px;
  border-radius: 14px;
  border: none;
  min-width: 140px;
}

.modal-cancel {
  background: #e0e0e0;
  color: #333;
}

.modal-confirm {
  background: #28a745;
  color: white;
}

/* ===== POST MATCH PAGE ===== */

.post-container {
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-title {
  font-size: 30px;
  margin-bottom: 20px;
}

.post-form {
  flex: 1;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}


.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  font-size: 22px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  font-size: 22px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #bbb;
}

.form-group textarea {
  min-height: 60px;
  resize: none;
}

/* SAVE BUTTON */

.post-save-btn {
  margin-bottom: auto;
  align-self: center;
  font-size: 26px;
  padding: 18px 60px;
  border-radius: 16px;
  border: none;
  background: #e53935;   /* red */
  color: white;
}
