/* ==========================================================================
   viklab design system — sub-app skins
   Recipes, mastermind, asteroids, APOD, weather.
   Class contracts used by the sub-app JS (color-circle, search-box, …)
   are preserved; only their look is redefined here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared app widgets
   -------------------------------------------------------------------------- */
.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Recipes
   -------------------------------------------------------------------------- */
.search-box {
  position: relative;
  width: fit-content;
}

.input-search {
  height: 44px;
  width: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0 2.9rem 0 1rem;
  outline: none;
  transition: width var(--dur-3) var(--ease), border-color var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease);
}

.input-search::placeholder {
  color: var(--text-3);
  font-size: 0.9rem;
  letter-spacing: normal;
  font-weight: 400;
}

.input-search:focus,
.btn-search:focus ~ .input-search {
  width: min(300px, 70vw);
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}

.btn-search {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  z-index: 2;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}

.btn-search:hover {
  color: var(--text);
  background: var(--card-hover);
}

.btn-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#randomRecipes .card {
  width: 100%;
  max-width: 50rem;
}

#randomRecipes .card-link {
  display: none; /* placeholder links in the JS-generated markup */
}

#ingredientList {
  max-height: 300px;
  overflow-y: auto;
  min-width: 240px;
}

#alertContainer {
  position: fixed;
  top: calc(var(--nav-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  width: max-content;
  max-width: calc(100vw - 2rem);
}

/* --------------------------------------------------------------------------
   Mastermind (class names generated by js/mastermind.js)
   -------------------------------------------------------------------------- */
.mm-rules p {
  margin: 0;
  color: var(--text-2);
}

.mm-rules .badge {
  border: 1px solid var(--border-strong);
}

.color-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-circle:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.color-circle.empty {
  background-color: var(--surface);
  border: 2px dashed var(--text-3);
}

.color-slot {
  position: relative;
}

.color-option {
  cursor: pointer;
}

.color-palette .color-circle {
  margin: 5px;
}

.guess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.guess-colors {
  display: flex;
  gap: 10px;
}

.guess-colors .color-circle {
  width: 30px;
  height: 30px;
  cursor: default;
}

.guess-colors .color-circle:hover {
  transform: none;
  box-shadow: none;
}

.feedback {
  display: flex;
  gap: 5px;
  align-items: center;
}

.feedback-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

.feedback-pin.black {
  background-color: #000;
}

.feedback-pin.white {
  background-color: #fff;
}

.attempt-number {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-3);
  min-width: 30px;
}

/* --------------------------------------------------------------------------
   APOD
   -------------------------------------------------------------------------- */
.apod-figure {
  margin: 0 0 2rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

.apod-figure img {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
}

.apod-text {
  max-width: 760px;
  margin-inline: auto;
}

.apod-text h2 {
  font-size: 1.4rem;
}

.apod-text p {
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Weather
   -------------------------------------------------------------------------- */
.weather-result {
  max-width: 420px;
  margin: 1.5rem auto 0;
}

.weather-result:empty {
  display: none;
}

.weather-result h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.weather-result p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.95rem;
}

.weather-result p:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   Is it Christmas?
   -------------------------------------------------------------------------- */
.xmas-answer {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}
