* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.header h1 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.header p {
  color: #888;
}

h2 {
  font-size: 1.2rem;
  color: #aaa;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.create-section {
  background: #14141f;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #f5c518;
}

.form-group textarea {
  resize: vertical;
  font-family: monospace;
  font-size: 0.85rem;
}

.player-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}

.player-option input {
  display: none;
}

.option-card {
  display: block;
  padding: 0.8rem;
  background: #1a1a2e;
  border: 2px solid #333;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.option-card:hover {
  border-color: #555;
}

.player-option input:checked + .option-card {
  border-color: #f5c518;
  background: #1a1a2e;
}

.option-card strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.option-card small {
  color: #777;
  font-size: 0.75rem;
}

.btn-create {
  width: 100%;
  padding: 0.9rem;
  background: #f5c518;
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.btn-create:hover {
  background: #e0b415;
}

.matches-section {
  margin-top: 1rem;
}

.no-matches {
  text-align: center;
  color: #555;
  padding: 2rem;
}

.match-card-admin {
  background: #14141f;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.match-card-info h3 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.match-card-info p {
  color: #888;
  font-size: 0.85rem;
}

.player-badge {
  display: inline-block;
  background: #f5c518;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.3rem;
}

.match-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

.btn-sm:hover {
  opacity: 0.85;
}

.btn-view {
  background: #333;
  color: #fff;
}

.btn-copy {
  background: #f5c518;
  color: #000;
}

.btn-delete {
  background: #dc3545;
  color: #fff;
}

.btn-edit {
  background: #0d6efd;
  color: #fff;
}

.btn-cancel {
  padding: 0.9rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.form-actions .btn-create {
  flex: 2;
}

.btn-logout {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: #dc3545;
  color: #dc3545;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #14141f;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-box h2 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.login-box p {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.login-box input:focus {
  outline: none;
  border-color: #f5c518;
}

.login-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0a0a0f;
}

.landing-content {
  text-align: center;
}

.landing-content h1 {
  font-size: 3rem;
  color: #f5c518;
  margin-bottom: 0.5rem;
}

.landing-content p {
  color: #888;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.btn-admin {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: #f5c518;
  color: #000;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn-admin:hover {
  background: #e0b415;
}

.player-page {
  min-height: 100vh;
  background: #000;
}

.player-header {
  background: #111;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #222;
}

.back-link {
  color: #f5c518;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.match-info-display {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.match-info-display .flag {
  font-size: 1.5rem;
}

.match-info-display strong {
  color: #fff;
  font-size: 1.1rem;
}

.match-info-display .stage {
  background: #333;
  color: #aaa;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.match-info-display .time {
  color: #f5c518;
  font-size: 0.85rem;
}

.player-container {
  width: 100%;
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.embed-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.embed-container iframe {
  width: 100%;
  height: 80vh;
  border: none;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .match-card-admin {
    flex-direction: column;
    align-items: flex-start;
  }

  .match-card-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .player-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .match-info-display {
    flex-direction: column;
    align-items: flex-start;
  }
}
