:root {
  --primary-color: #0a1845;
  --secondary-color: #ff3b34;
  --background-color: #f0f0f0;
  --button-bg-color: #28a745;
  --button-hover-bg-color: #218838;
  --button-secondary-bg-color: #6c757d;
  --button-secondary-hover-bg-color: #5a6268;
}

body#wheel {
  display: block;
  margin: 2rem auto 0;
  padding: 0;

  > *:nth-child(n + 2) {
    margin-top: 1rem;
  }

  section {
    position: relative;
    &#wheel {
      position: relative;
      margin-top: 0;
      top: 0rem;
    }

    &#price-section {
      display: flex;
      flex-direction: column;
      place-items: center;
      justify-content: center;
      z-index: 10;

      > img {
        position: fixed;
        top: 2.25rem;
        left: 1.5rem;
        height: 40px;
      }

      #lottery-state {
        /* background: #fff; */
        /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
        /* border: 2px solid var(--primary-color); */
        height: 100px;
        width: auto;
        padding: 0 2rem;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        font-size: 32px;
        font-weight: 600;

        &:has(.winner-name):before {
          content: "🏆";
          position: relative;
        }

        .winner-company {
          display: none;
        }
      }
    }
  }

  #header {
    display: flex;
    justify-content: center;
    h1 {
      font-size: 48px;
      line-height: 1;
      text-align: center;
      letter-spacing: -2px;
      z-index: 10;
    }
    span {
      /* color: #ff3b34; */
      font-size: 20px;
      font-weight: 600;
      text-align: center;
    }
  }

  #price-counter {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: row;
    gap: 0.125rem;
  }

  #marker1 {
    width: 100px;
    height: 50px;
    background: var(--secondary-color);
    position: fixed;
    bottom: 2rem;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  }
}

body {
  font-family: sans-serif;
  color: #0a1845;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 1rem;
  box-sizing: content-box;
  background: #f0f0f0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  span {
    font-size: 16px;
    font-weight: 500;
    color: var(--button-secondary-bg-color);
  }
}

h2 {
  margin-top: 0.75rem;
}

#canvas {
  position: relative;
  top: -11rem;
  margin: auto;
  z-index: -1;
}

#current-price-display {
  background: white;
  border: 2px solid #ff3b34;
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 1rem auto 0;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;

  .header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
  }

  h3 {
    font-size: 24px;
    font-weight: bold;
    color: #ff3b34;
    margin: 0;
    max-width: 300px;
    text-align: center;
  }

  #price-partner {
    color: #0a1845;
    font-size: 16px;
  }

  img#partner {
    width: auto;
    max-height: 40px;
    object-fit: contain;
  }

  img#price {
    width: auto;
    height: 250px;
    border-radius: 8px;
  }
}

section {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  box-sizing: content-box;
  border-radius: 0.5rem;

  &:has(*, h1) {
    display: flex;
  }

  *:has(.btn) {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
  }

  > * {
    margin: 0;
  }

  &.hl {
    background: #fff;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    padding: 1rem;
  }

  [class*="-grid"] {
    flex-wrap: wrap;
  }

  [class*="-card"] {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    flex: 0 0 250px;

    * {
      margin: 0;
    }

    h3 {
      font-size: 16px;
    }

    h4 {
      margin-bottom: 1rem;
    }

    span {
      white-space: nowrap;
    }

    img {
      width: auto;
      height: auto;
      max-height: 125px;
      object-fit: contain;
      border-radius: 4px;
      margin: auto;
      align-self: flex-start;
    }

    .btn {
      display: flex;
      flex-direction: row;
      min-width: initial;
      height: 32px;
      color: initial;
      background: #ddd;
    }

    .actions {
      display: flex;
      flex-direction: row;
      margin-top: auto;
    }

    .edit-form {
      position: absolute;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  }

  .partner-card {
    img {
      margin: 0;
      width: auto;
      height: 50px;
    }
    span {
      display: none;
    }
  }
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: flex-start;
  height: 44px;
  min-width: 75px;
  padding: 0 12px;
  background: #6e757c;
  stroke: white;
  color: white;
  text-decoration: none;
  font-size: initial;
  font-family: initial;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  font-weight: 500;
  /* appearance: none; */

  &.primary {
    background: hsl(119, 34%, 48%);
  }

  &.secondary {
    background: hsl(25, 74%, 58%);
  }

  &:hover {
    background: hsl(210, 6%, 36%);

    &.primary {
      background: hsl(119, 34%, 38%);
    }
    &.secondary {
      background: hsl(25, 74%, 48%);
    }
  }

  svg {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    stroke-width: 1.5px;
  }

  &.md {
    height: 32px;
    color: initial;
    background: #ddd;
  }
  &.md:hover {
    background: #bbb;
  }
}
select.btn {
  /* background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8 9l4 -4l4 4'/><path d='M16 15l-4 4l-4 -4'/></svg>"); */
  /* background-repeat: no-repeat; */
  /* background-position: 6px center; */
  /* background-size: 24px 24px; */
  max-width: 205px;
  /* padding-left: 32px; */
}

:disabled {
  filter: saturate(0);
}
svg {
  stroke: inherit;
}

.edit-form {
  overflow: hidden;
}

#debug {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  text-align: left;
  opacity: 0.75;
  margin-top: 15px;
  padding: 10px;
  background: #f0f0f0;
  border-radius: 5px;
  font-size: 10px;
  color: #666;
}

.hide {
  display: none !important;
}

form {
  display: flex;
  flex-direction: column;
}

.form-section form,
.edit-form form,
form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: flex-start;

  input,
  select {
    font-size: initial;
    height: 44px;
    box-sizing: border-box;
    align-self: flex-start;
    min-width: 400px;
  }

  label:nth-child(n + 2) {
    margin-top: 0.5rem;
  }
}

/* partner */

.partner-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.partner-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-section {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  max-width: 400px;
}

.form-row {
  display: flex;
  flex-direction: column;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-group small {
  color: #666;
  font-size: 12px;
  margin-top: 5px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #007bff;
  text-decoration: none;
}

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

.upload-status {
  margin-top: 5px;
  padding: 5px;
  border-radius: 4px;
  font-size: 12px;
  min-height: 20px;
}

.upload-status.uploading {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.upload-status.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.upload-status.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
