* {
  box-sizing: border-box;
}

:root {
  --bg: #050805;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --green: #39d515;
  --green-soft: rgba(57, 213, 21, 0.18);
  --text: #ffffff;
  --muted: #b8c7b8;
  --danger: #ff5b5b;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 80% 20%, rgba(57, 213, 21, 0.18), transparent 32%),
    radial-gradient(circle at 10% 80%, rgba(57, 213, 21, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
}

button,
.button-link {
  border: none;
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--green);
  color: #071007;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.button-link:hover {
  filter: brightness(1.06);
}

.button-muted,
button.secondary {
  background: #2a2f2a;
  color: #fff;
}

.button-danger {
  background: rgba(255, 91, 91, 0.14);
  color: #ffb4b4;
  border: 1px solid rgba(255, 91, 91, 0.32);
}

.home-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.home-card {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.home-footer {
    text-align: center;
    padding-bottom: 8px;
}

.home-footer a {
    color: #b8c7b8;
    text-decoration: none;
    transition: color 0.25s ease;
}

.home-footer a:hover {
    color: #ffffff;
}

.brand {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.brand strong {
  color: var(--green);
  margin-left: 6px;
}

.home-header h1,
.panel-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.home-header p,
.panel-header p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.create-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
  margin-bottom: 22px;
  
}

.create-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.create-row button {
  width: 100%;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.tournaments-list {
  display: grid;
  gap: 12px;
}

.tournament-item,
.empty-state {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--border);
}

.tournament-item h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.tournament-item p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.item-actions {
  min-width: 160px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.app {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.panel,
.preview {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.panel {
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.back-link {
  display: inline-block;
  color: var(--green);
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

label {
  font-weight: 700;
  font-size: 13px;
  color: #e8ffe8;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

input:focus {
  border-color: rgba(57, 213, 21, 0.75);
  box-shadow: 0 0 0 3px rgba(57, 213, 21, 0.12);
}

.phase-details {
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.phase-details summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
  color: #fff;
  background: var(--green-soft);
}

.phase-details summary::-webkit-details-marker {
  display: none;
}

.phase-details summary::before {
  content: "+";
  color: var(--green);
  font-size: 20px;
  margin-right: 4px;
}

.phase-details[open] summary::before {
  content: "−";
}

.phase-details summary span {
  flex: 1;
}

.phase-details summary strong {
  color: var(--muted);
  font-size: 12px;
}

.phase-content {
  padding: 14px;
}

.match-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.match-card:last-child {
  margin-bottom: 0;
}

.match-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--green);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  margin: 6px 0 12px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

button.download {
  grid-column: span 2;
  background: #fff;
  color: #101510;
}

.preview {
  display: grid;
  place-items: center;
  overflow: auto;
}

canvas {
  width: 100%;
  max-width: 1280px;
  height: auto;
  border-radius: 12px;
  background: #000;
}

.home-hero {
    text-align: center;
    padding: 32px 24px 12px;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .panel {
    max-height: none;
  }

  .create-row,
  .tournament-item {
    grid-template-columns: 1fr;
    display: grid;
  }

  .item-actions {
    min-width: 0;
  }
}

.heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.secondary-link {
  background: #2a2f2a;
  color: #fff;
}

.button-archive {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.tournament-type {
  color: var(--green) !important;
  font-weight: 800;
}

.home-badge-logo {
    width: min(500px, 100%);
    max-width: 100%;
    height: auto;
}

.home-badge {
    max-width: 100%;
    justify-content: center;
}

.home-panel {
    width: 100%;
}

@media (max-width: 520px) {
    .home-shell {
        width: 100%;
        gap: 16px;
    }

    .home-hero {
        padding: 20px 10px 8px;
    }

    .home-badge-logo {
        width: 260px;
        height: auto;
    }

    .home-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .home-section summary {
        padding: 16px;
    }

    .tool-card {
        padding: 15px;
        border-radius: 14px;
    }

    .home-footer {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .home-badge-logo {
        width: 220px;
    }
}
#publicTournamentImage {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.inline-date-field {
  display: grid;
  gap: 6px;
}

.inline-date-field span {
  color: #e8ffe8;
  font-size: 12px;
  font-weight: 800;
}

.public-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0;
}

.public-info-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.public-info-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.public-info-card strong {
  color: #fff;
  font-size: 16px;
}

.public-podium {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(57, 213, 21, 0.08);
  border: 1px solid rgba(57, 213, 21, 0.22);
}

.public-podium h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.podium-list {
  display: grid;
  gap: 10px;
}

.podium-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.podium-item span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.podium-item strong {
  color: #fff;
  font-size: 14px;
}
