@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

body {
  background-color: #0b0f19;
  color: #f8fafc;
  display: flex;
  justify-content: center;
  padding: 20px 12px;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

header {
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-icon {
  font-size: 1.8rem;
  color: #38bdf8;
}

h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
}

.main-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hlavní karty */
.card {
  background: #1e293b;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid #334155;
  width: 100%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.15rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background-color: #0284c7;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  height: 120px;
  background-color: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 12px;
  color: #f8fafc;
  padding: 12px;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
}

textarea:focus, select:focus, input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.error-box {
  background-color: #450a0a;
  border: 1px solid #991b1b;
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.error-box.hidden { display: none; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-item.hidden { display: none; }

select, input[type="number"] {
  background-color: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 12px;
  color: #f8fafc;
  padding: 12px;
  font-size: 0.95rem;
  outline: none;
  width: 100%;
}

.options-box {
  background-color: #0f172a;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #334155;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: #0284c7;
  cursor: pointer;
}

.button-group {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  flex: 1;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-secondary {
  background-color: #334155;
  color: #f8fafc;
}
.btn-secondary:hover { background-color: #475569; }

.btn-danger {
  background-color: #7f1d1d;
  color: #fca5a5;
}
.btn-danger:hover { background-color: #991b1b; color: #fff; }

.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn:active { transform: scale(0.97); }

/* HISTORIE */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.history-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 10px;
}

.history-item {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: #38bdf8;
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.history-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

.history-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* VÝSLEDKY */
.results-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.results-wrapper.hidden { display: none; }

.results-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  width: 100%;
}

.team-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  width: 100%;
}

.team-title {
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-item {
  background-color: #0f172a;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #f8fafc;
  word-break: break-word;
}

.captain-tag {
  color: #f59e0b;
  font-size: 0.7rem;
  margin-left: auto;
  background: #451a03;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #78350f;
  white-space: nowrap;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #10b981;
  color: #064e3b;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); }