* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #302d2a;
  background: #f7f3ed;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  cursor: pointer;
  background: #4d7657;
  color: white;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary {
  background: #e9e2d9;
  color: #403a35;
}

button.danger {
  background: #a84444;
}

button.small {
  padding: 6px 9px;
  font-size: 0.85rem;
}

input,
select {
  width: 100%;
  border: 1px solid #d8d0c7;
  border-radius: 10px;
  background: white;
  padding: 11px 12px;
  color: #302d2a;
  outline: none;
}

input:focus,
select:focus {
  border-color: #4d7657;
  box-shadow: 0 0 0 3px rgba(77, 118, 87, 0.12);
}

.topbar {
  background: white;
  border-bottom: 1px solid #e4ddd5;
  padding: 22px max(18px, calc((100% - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
}

.topbar p {
  margin: 0;
  color: #776f67;
}

main {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px 50px;
}

.search-card,
.admin-panel,
.player-card,
.flower-card,
.form-card {
  background: white;
  border: 1px solid #e4ddd5;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(60, 48, 37, 0.05);
}

.search-card {
  padding: 20px;
}

.search-card label {
  display: block;
  font-weight: 800;
  margin-bottom: 9px;
}

.search-row {
  display: flex;
  gap: 9px;
}

.search-row input {
  flex: 1;
}

.muted {
  color: #776f67;
  font-size: 0.92rem;
}

.search-card .muted {
  margin: 10px 0 0;
}

.admin-panel {
  margin-top: 18px;
  padding: 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.admin-header h2 {
  margin-bottom: 5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.form-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: none;
}

.form-card h3 {
  margin-bottom: 0;
}

.results {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.result-section h2 {
  margin-bottom: 10px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.player-card,
.flower-card {
  padding: 16px;
}

.card-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.flower-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.flower-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f2eee7;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.92rem;
}

.flower-chip button {
  border-radius: 50%;
  padding: 0;
  width: 20px;
  height: 20px;
  background: transparent;
  color: #766e66;
}

.admin-actions {
  margin-top: 12px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.empty {
  background: white;
  border: 1px dashed #d8d0c7;
  border-radius: 14px;
  padding: 24px;
  color: #776f67;
  text-align: center;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: #302d2a;
  color: white;
  padding: 11px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: min(90vw, 500px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 800px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
  }

  .search-row {
    flex-direction: column;
  }
}
