
/* Global and body settings */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', serif;
  background: #ffffff;
  color: #222;
  padding: 2em;
  margin: 0;
  overflow-x: hidden;
}

/* Containers */
.container {
  padding-top: 80px;
  max-width: 1000px;
  margin: auto;
  background: #fff;
  padding: 2em;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  text-align: center;
}

.section {
  background-color: #fff;
  color: #222;
  padding: 24px;
  margin: 20px auto;
  border-radius: 12px;
  max-width: 1000px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  text-align: center;
  font-weight: bold;
  color: #000;
}

.centered-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 1em;
}

.big-title {
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

.admin-label {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: bold;
  color: white;
  height: 100%;
}

/* Buttons */
button, .preview-button {
  margin: 0.5em;
  padding: 0.75em 1.5em;
  background-color: #000;
  color: white;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}
button:hover, .preview-button:hover {
  background-color: #333;
}
.preview-button {
  display: inline-block;
  text-decoration: none;
}

/* Lists and Entries */
ul li {
  margin: 0.5em 0;
  padding: 1em;
  background: #f8f8f8;
  border-radius: 6px;
  border: 1px solid #eee;
  transition: box-shadow 0.2s;
}
ul li:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#games-list button {
  padding: 6px 14px;
  border: none;
  background-color: black;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
#games-list button:hover {
  background-color: #333;
}

#crew-list li {
  margin: 10px 0;
  list-style: none;           /* ❌ usuwa kropki */
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;        /* ✅ wyśrodkowanie kafelków */
  gap: 12px;
}

/* Logo navbar */
.logo {
  height: 100%;
  width: auto;
  display: block;
  margin: 0;
  padding: 0;
}


/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #000;
  color: white;
  height: 64px;              /* ustala wysokość paska */
  padding-left: 0;           /* brak odstępu od lewej */
  padding-right: 12px;       /* zostaje po prawej stronie */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.navbar a.btn-home,
.navbar button.btn-logout {
  color: white;
  background: transparent;
  border: none;
  margin-left: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.2s;
  font-family: inherit;
}
.navbar a.btn-home:hover,
.navbar button.btn-logout:hover {
  text-decoration: underline;
  opacity: 0.8;
}
.nav-left {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px; /* odstęp między logo a napisem */
}

.navbar-logo {
  height: 100%;
  width: auto;
  display: block;       /* usuwa domyślne odstępy inline-elementów */
  margin: 0;
  padding: 0;
}

.nav-right {
  display: flex;
  align-items: center;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px; /* odstęp między przyciskami */
}

/* Przyciski w panelu admina o równej szerokości */
.admin-nav-buttons button,
#btn-admins {
  font-size: 15px;
  font-weight: 600;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin: 8px auto;
  display: block;
  width: 250px; /* ✅ równa szerokość */
  max-width: 90%;
}

.admin-nav-buttons button:hover,
#btn-admins:hover {
  background-color: #333;
}

#judge-links button {
  display: inline-block;
  width: 220px;              /* ✅ równa szerokość */
  padding: 10px 16px;
  margin: 6px;
  font-size: 14px;
  font-weight: 600;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}
#judge-links button:hover {
  background-color: #333;
}

#add-select, #add-btn {
  padding: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-size: 14px;
}

#add-btn {
  background-color: #000;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
#add-btn:hover {
  background-color: #333;
}

/* Game / Crew Boxes */
.game-entry {
  background-color: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 16px;
  margin: 16px auto;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.game-entry .game-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}
.game-entry .game-start {
  font-size: 14px;
  color: #444;
  margin-bottom: 16px;
}
.game-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.game-buttons button {
  flex: 1 0 120px;
  padding: 10px;
  background-color: black;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
}

.game-buttons button:hover {
  background-color: #333;
}

.crew-list-box {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;  
  gap: 12px;
  align-items: center;
}

.crew-box {
  background-color: #f8f8f8;
  padding: 16px;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column; /* zmieniono z row */
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.crew-box button {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.crew-box button:hover {
  background-color: #333;
}

.generate-list-button {
  margin-top: 30px;
  padding: 10px 20px;
  font-size: 15px;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}
.generate-list-button:hover {
  background-color: #333;
}

.game-box {
  border: 1px solid #ccc;
  background-color: #f4f4f4;
  padding: 10px 20px;
  border-radius: 8px;
  margin: 15px auto;
  width: fit-content;
  text-align: left;
}

.task-group-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.task-group-form input {
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 260px;
  text-align: center;
}
.task-group-box {
  background-color: #f8f8f8;
  padding: 16px;
  border-radius: 12px;
  margin: 12px auto;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.task-group-box:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.group-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.group-sub {
  font-size: 13px;
  color: #777;
  margin-bottom: 2px;
}

.task-count {
  font-size: 15px;
  font-weight: 500;
}

.task-collection-name {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

.task-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 30px;
}

.task-add-form input,
.task-add-form select {
  padding: 10px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 280px;
  text-align: center;
}

.task-add-form button {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  background-color: #000;
  color: white;
  border: none;
  cursor: pointer;
}

.task-collection-subtitle {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.task-entry {
  background-color: #f8f8f8;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 10px auto;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-content {
  font-size: 15px;
  margin-bottom: 4px;
}

.task-type {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.btn-delete {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.task-add-form textarea {
  padding: 10px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 280px;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.4;
  font-family: inherit;
  box-sizing: border-box;
}

.form-section {
  margin-top: 30px;
  text-align: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0;
}

.form-group label {
  font-size: 15px;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group input,
.form-group select {
  padding: 10px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 280px;
  text-align: center;
  font-family: inherit;
  background-color: #fafafa;
}

.form-section button:hover {
  background-color: #333;
}

/* Input typu textarea - używane dla opisu */
.form-input {
  display: block;
  margin: 10px auto;
  padding: 12px 14px;
  width: 100%;
  max-width: 320px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fafafa;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  line-height: 1.5;
}

.media-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.media-buttons a,
.media-buttons button {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background-color: #000;
  color: white;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: inherit;
}

.media-buttons a:hover,
.media-buttons button:hover {
  background-color: #333;
}

a.btn-action, button.btn-action {
  display: inline-block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  margin: 6px;
  text-align: center;
  font-family: inherit;
  transition: background-color 0.2s;
  font-family: inherit;
}

a.btn-action:hover, button.btn-action:hover {
  background-color: #333;
}

.btn-action {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-width: 80px;
  text-align: center;
  transition: background-color 0.2s;
  font-family: inherit;
}

.btn-action:hover {
  background-color: #333;
}

/* Licznik znaków */
.char-counter {
  text-align: right;
  font-size: 13px;
  color: #666;
  margin-top: -6px;
  margin-bottom: 16px;
  padding-right: 10px;
}

/* Komunikaty błędów i sukcesów */
.feedback-msg {
  font-weight: bold;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* Login Panel */
.login-container {
  max-width: 480px;
  margin: 80px auto;
  padding: 40px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
  text-align: center;
}

.login-box input {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fafafa;
  font-size: 14px;
  transition: border-color 0.2s;
}
.login-box input:focus {
  outline: none;
  border-color: #000;
}

.login-box button {
  background: #000;
  color: white;
  padding: 14px 22px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}
.login-box button:hover {
  background: #333;
}

.login-role-buttons button {
  margin: 10px;
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 6px;
  background: #f0f0f0;
  color: #000;
  cursor: pointer;
  border: 1px solid #ccc;
  font-size: 14px;
  transition: background 0.2s;
}
.login-role-buttons button:hover {
  background: #e0e0e0;
}

.login-error {
  color: darkred;
  font-weight: bold;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

.form-section input,
.form-section select,
.form-section textarea {
  display: block;
  margin: 10px auto;
  padding: 12px 14px;
  width: 100%;
  max-width: 280px;
  border: 1px solid #aaa;
  border-radius: 8px;
  background-color: #fafafa;
  font-size: 15px;
  font-family: inherit;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  transition: border-color 0.2s ease;
  text-align: center;
}


.form-section input:focus {
  outline: none;
  border-color: black;
}

.form-section button {
  display: block;
  margin: 20px auto;
  padding: 12px 20px;
  font-size: 15px;
  background-color: #000;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.form-section button:hover {
  background-color: #333;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    justify-content: space-between;
    height: 64px;                 /* ustalamy dokładną wysokość */
    padding-left: 0;
    padding-right: 12px;              /* brak paddingu góra/dół, tylko boczny */
  }

  .btn-home {
    font-size: 14px;
    padding: 4px 4px;
  }

  .navbar a.btn-home,
  .navbar button.btn-logout {
    margin: 0;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: white;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
  }

  .container {
    padding-top: 80px;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 1em;
  }

  .game-entry {
    width: 95%;
    padding: 10px;
  }

  .game-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 6px; /* mniejsza przerwa */
    margin-top: 8px;
  }

  .game-buttons button {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 6px;
    border: none;
    background-color: #000;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0;
  }
  .game-buttons button:hover {
    background-color: #333;
  }

  .game-box {
    padding: 12px;
    font-size: 14px;
  }

  .crew-box {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .login-container {
    width: 95%;
    padding: 20px;
    margin: 40px auto;
  }

  .login-box {
    padding: 20px;
  }

  .login-box input,
  .login-box button {
    padding: 12px;
    font-size: 16px;
  }

  .login-role-buttons button {
    width: 100%;
    margin: 8px 0;
    font-size: 16px;
  }

  .login-error {
    font-size: 14px;
    text-align: center;
  }
}
