/* ===== GOAL SPECIAL LAYOUT ===== */
#event-overlay.goal #event-icon {
  font-size: 48px;
}

#event-overlay.goal #event-label {
  font-size: 28px;
  font-weight: bold;
  margin-top: 6px;
}

#event-overlay.goal #event-team {
  font-size: 20px;
  margin-top: 6px;
}

#event-overlay.goal #event-extra {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
}
/* ================= RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f5f5;
  color: #222;
}

/* ================= ADMIN BAR ================= */
#admin-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px;
  background: #111;
  color: #fff;
}

#admin-bar input,
#admin-bar button {
  padding: 6px;
}

#modeLabel {
  margin-left: auto;
  font-weight: bold;
}

/* ================= TABS ================= */
#tabs {
  display: flex;
  gap: 6px;
}

.tab {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #eee;
  cursor: pointer;
  user-select: none;
}

.tab.active {
  background: #111;
  color: #fff;
}

/* ================= TAB CONTENT ================= */
.tab-content {
  display: none;
  padding: 10px;
}

.tab-content.active {
  display: block;
}

/* ================= ADMIN ONLY ================= */
.admin-only {
  display: none;
}

.admin .admin-only {
  display: block;
}

/* ================= LIVE LAYOUT ================= */
.live-layout {
  display: flex;
  align-items: flex-start;
}

/* ================= TIMELINE ================= */
.timeline-box {
  width: 260px;
  margin-top: 30px;   /* ⬅️ κατεβάζει το timeline */
}


.timeline-box h3 {
  margin-bottom: 6px;
}

#timeline {
  background: radial-gradient(
      circle at top left,
      rgba(0, 255, 120, 0.08),
      transparent 60%
    ),
    linear-gradient(
      to bottom,
      #0e1b13,
      #08120c
    );
  border: 1px solid rgba(0,255,120,0.25);
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 14px;
}


.timeline-row {
  font-size: 10px;   /* ⬅️ ΕΔΩ μικραίνει η γραμματοσειρά */

  background: linear-gradient(
    to right,
    rgba(0,0,0,0.65),
    rgba(0,255,120,0.06)
  );
  border-radius: 12px;
  margin-bottom: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #eafff3;
  box-shadow:
    inset 0 0 0 1px rgba(0,255,120,0.12),
    0 2px 6px rgba(0,0,0,0.5);
}


#timeline::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    #1eff8b,
    #0f5c38
  );
  border-radius: 10px;
}

#timeline::-webkit-scrollbar-track {
  background: #07110b;
}


.timeline-row.home {
  border-left: 5px solid #1e90ff;
}

.timeline-row.away {
  border-left: 5px solid #ff4d4d;
}

.timeline-row .minute {
  font-weight: bold;
  width: 50px;
}
/* ================= DELETE TIMELINE EVENT ================= */
.delete-event {
  margin-left: auto;
  color: #ff4d4d;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
}

.delete-event:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ================= PITCH WRAPPER ================= */
#pitch-wrapper {
  margin-left: 10px;
}

/* ================= MATCH CONTROLS ================= */
.match-controls {
  width: 560px;
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;   /* ⬅️ ΑΥΤΟ ΕΙΝΑΙ ΤΟ ΚΛΕΙΔΙ */
}


.match-controls button {
  padding: 6px 10px;
  font-size: 13px;
}
.stoppage-tab {
  background: #222;
  border: 2px solid #ffb300;
  color: #ffb300;
  font-weight: bold;
  border-radius: 10px;
}

.stoppage-tab:hover {
  background: #ffb300;
  color: #111;
}

/* ================= POSSESSION BAR ================= */
#possession-bar {
  display: flex;
  width: 520px;
  height: 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
}

#possession-bar .team {
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s ease;
}

/* ================= PITCH ================= */
#pitch {
  position: relative;
  width: 520px;
  height: 320px;
  background: #1e7f3b;
  border: 3px solid #fff;
  border-radius: 8px;
  overflow: hidden;
}

/* ================= SCOREBOARD ================= */
#pitch-clock {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 30;
  color: #fff;
  font-weight: bold;
  pointer-events: none;
}

/* SCORE */
#scoreboard {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.75);
  border-radius: 6px;
  overflow: hidden;
}

#scoreboard span {
  padding: 4px 8px;
  font-size: 14px;
}

#scoreboard .dash {
  opacity: 0.7;
}

/* CLOCK (ΔΕΞΙΑ) */
.clock {
  display: flex;
  flex-direction: column;   /* ⬅ ΚΑΘΕΤΑ */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  border-radius: 6px;
  padding: 2px 8px;
  min-width: 52px;
}

#match-time {
  font-size: 14px;
  line-height: 16px;
}

#match-phase {
  font-size: 11px;
  opacity: 0.85;
  line-height: 12px;
}


/* ================= PITCH LINES ================= */
.half-line {
  position: absolute;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.8);
}

.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.penalty-area {
  position: absolute;
  top: 50%;
  width: 80px;
  height: 180px;
  border: 2px solid #fff;
  transform: translateY(-50%);
}

.penalty-area.home { left: 0; }
.penalty-area.away { right: 0; }

.goal-area {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 100px;
  border: 2px solid #fff;
  transform: translateY(-50%);
}

.goal-area.home { left: 0; }
.goal-area.away { right: 0; }

.goal {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 60px;
  border: 2px solid #fff;
  transform: translateY(-50%);
}

.home-goal { left: -2px; }
.away-goal { right: -2px; }

/* ================= BALL ================= */
#ball {
  position: absolute;
  font-size: 18px;
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
  transition: all 0.8s ease-in-out;
}

/* ================= CANVAS ================= */
#possession-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.pitch-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 16px 26px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: bold;
  z-index: 40;
  text-align: center;
  line-height: 1.3;
  min-width: 260px;
}

.pitch-flash.hidden {
  display: none;
}


/* ================= EVENT OVERLAY ================= */
#event-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  color: #fff;
  padding: 22px 34px;
  border-radius: 16px;
  text-align: center;
  z-index: 50;
  min-width: 220px;
  animation: overlayPop 0.3s ease-out;
}

#event-overlay.hidden {
  display: none;
}

#event-icon {
  font-size: 48px;
  margin-bottom: 6px;
}

#event-label {
  font-size: 28px;
  font-weight: bold;
}

#event-team {
  font-size: 18px;
  opacity: 0.9;
}

@keyframes overlayPop {
  from {
    transform: translate(-50%, -60%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ================= EVENTS PANEL ================= */
#pitch-events-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 520px;
  background: #111;
  margin-top: 4px;
}

.team-events {
  padding: 10px;
}

.team-events h4 {
  color: #fff;
  text-align: center;
  margin-bottom: 6px;
}

.events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.event-btn {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.event-btn:hover {
  background: #333;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 600px) {
  #pitch,
  #pitch-events-panel,
  #possession-bar,
  .match-controls {
    width: 360px;
  }

  #pitch {
    height: 220px;
  }
}
/* ================= POSSESSION TABS ================= */
#possession-tabs {
  display: flex;
  justify-content: center;   /* ⬅ ΚΕΝΤΡΟ */
  align-items: center;
  gap: 14px;
  margin: 12px 0;
}

.pos-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid #ccc;
  background: #eee;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.2s ease;
}

/* ACTIVE STATES */
.pos-tab.active.home {
  background: #1e90ff;
  color: #fff;
  border-color: #1e90ff;
}

.pos-tab.active.away {
  background: #ff4d4d;
  color: #fff;
  border-color: #ff4d4d;
}

.event-btn {
  position: relative;
  z-index: 9999;
}

/* ================= CLICK FIX ================= */
#possession-canvas,
#ball,
#pitch-events {
  pointer-events: none;
}
/* ===== MINI TEAM STATS INSIDE PITCH ===== */
.team-stats {
  position: absolute;
  top: 6px;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
  border-radius: 8px;
  z-index: 30;
}

.home-stats {
  left: 6px;
}

.away-stats {
  right: 6px;
  text-align: right;
}
/* ================= SUBSTITUTION MODAL ================= */
#sub-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);

  display: none;              /* ⬅️ ΚΛΕΙΣΤΟ ΣΤΟ LOAD */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#sub-modal.hidden {
  display: none;
}

#sub-modal:not(.hidden) {
  display: flex;              /* ⬅️ ΑΝΟΙΓΕΙ ΜΟΝΟ ΟΤΑΝ ΤΟ ΘΕΣ */
}


#sub-modal.hidden {
  display: none;
}

.sub-box {
  background: #111;
  color: #fff;
  padding: 16px 18px;
  border-radius: 14px;
  width: 260px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.sub-box h3 {
  text-align: center;
  margin-bottom: 10px;
}
/* ================= LINEUPS GRID ================= */
.lineups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.team-lineup {
  background: #111;
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  min-height: 300px;
}

.team-lineup h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.team-lineup ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-lineup li {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
}

.team-lineup li:last-child {
  border-bottom: none;
}

/* Χρώματα τίτλων */
.team-lineup.home h3 {
  color: #1e90ff;
}

.team-lineup.away h3 {
  color: #ff4d4d;
}

/* ================= LINEUP ADMIN – PRO UI ================= */

#lineup-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Κάρτα */
.lineup-admin-team {
  background: linear-gradient(180deg, #0f0f0f, #151515);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

/* Header */
.lineup-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(0,0,0,0.6);
  z-index: 5;
}

.team-label {
  font-weight: bold;
  letter-spacing: 1px;
}

.team-label.home {
  color: #1e90ff;
}

.team-label.away {
  color: #ff4d4d;
}

.counts {
  font-size: 12px;
  opacity: 0.85;
}

/* Λίστα */
.lineup-admin-team ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}

/* Γραμμή παίκτη */
.lineup-admin-team li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  transition: background 0.2s ease;
}

.lineup-admin-team li:hover {
  background: rgba(255,255,255,0.05);
}

/* Dropdown */
.lineup-admin-team select {
  background: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}

/* Κατάσταση παίκτη */
.lineup-admin-team li[data-state="lineup"] {
  background: rgba(0,255,120,0.12);
}

.lineup-admin-team li[data-state="bench"] {
  background: rgba(255,180,0,0.15);
}


/* Στοίχιση γραμμών */
.lineup-admin-team.home li {
  flex-direction: row;
}

.lineup-admin-team.away li {
  flex-direction: row-reverse;
}

/* Dropdown πιο κοντά στο δεξί άκρο */
.lineup-admin-team.away select {
  margin-right: 6px;
}
.safe-chat {
  position: fixed;
  top: 120px;
  right: 20px;
  width: 300px;
  height: 400px;
  background: #111;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  z-index: 999999;
  color: #fff;
}

.safe-chat .chat-header {
  padding: 8px;
  font-weight: bold;
  text-align: center;
  background: #1e90ff;
}

.safe-chat #chat-messages {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  font-size: 13px;
  background: #000;
}

.safe-chat .chat-input {
  display: flex;
  border-top: 1px solid #333;
}

.safe-chat input {
  flex: 1;
  padding: 6px;
  border: none;
}

.safe-chat button {
  width: 40px;
  border: none;
  background: #1e90ff;
  color: #fff;
  cursor: pointer;
}
.sub-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.sub-modal.hidden {
  display: none;
}

.sub-box {
  background: #111;
  padding: 16px;
  border-radius: 8px;
  width: 260px;
  color: #fff;
}

.sub-box h3 {
  text-align: center;
  margin-bottom: 10px;
}

.sub-box label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.sub-box select {
  width: 100%;
  margin-top: 4px;
  padding: 4px;
}

.sub-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.sub-actions button {
  width: 48%;
  padding: 6px;
  cursor: pointer;
}
/* ================= EMBED MODE (PITCH ONLY) ================= */
html.embed body #admin-bar,
html.embed body #top-bar,
html.embed body #tabs,
html.embed body .timeline-box,
html.embed body #pitch-events-panel,
html.embed body #possession-tabs,
html.embed body .match-controls,
html.embed body .safe-chat,
html.embed body #lineup-admin,
html.embed body .lineups-grid {
  display: none !important;
}

html.embed body .live-layout {
  display: flex !important;
  justify-content: center !important;
}

html.embed body #pitch-wrapper {
  margin: 0 !important;
}

