@layer overlays {
  .toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    padding: 10px 16px 10px 10px;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 45%),
      linear-gradient(180deg, rgba(42, 28, 78, 0.94), rgba(14, 9, 30, 0.96));
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 0 2px var(--toast-edge, rgba(240, 181, 52, 0.75)),
      0 14px 34px rgba(0, 0, 0, 0.5),
      0 0 28px var(--toast-glow, rgba(255, 190, 60, 0.25));
    opacity: 0;
    transform: translateY(-18px) scale(0.92);
    transition: opacity 0.3s ease, transform 0.45s var(--ease-spring);
  }

  .toast:not(:has(.toast__art)) {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 18px;
  }

  .toast.is-in {
    opacity: 1;
    transform: none;
  }

  .toast.is-leaving {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.35s var(--ease-out);
  }

  .toast[data-tone='mint'] {
    --toast-edge: rgba(94, 224, 106, 0.8);
    --toast-glow: rgba(94, 224, 106, 0.25);
  }

  .toast[data-tone='cyan'] {
    --toast-edge: rgba(93, 233, 255, 0.8);
    --toast-glow: rgba(93, 233, 255, 0.25);
  }

  .toast[data-tone='coral'] {
    --toast-edge: rgba(255, 90, 110, 0.85);
    --toast-glow: rgba(255, 90, 110, 0.25);
  }

  .toast[data-tone='violet'] {
    --toast-edge: rgba(178, 139, 255, 0.85);
    --toast-glow: rgba(178, 139, 255, 0.3);
  }

  .toast__art {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .toast__art img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    animation: value-bump 0.5s var(--ease-spring) 0.15s;
  }

  .toast__text {
    display: grid;
    min-width: 0;
  }

  .toast__title {
    font-size: 14.5px;
    font-weight: 900;
    color: var(--gold-hi);
  }

  .toast__body {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
  }

  .hint {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: auto;
    z-index: 2;
  }

  .hint__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 1, 8, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .hint.is-in .hint__backdrop {
    opacity: 1;
  }

  .hint__card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
    padding: 28px 24px 22px;
    border-radius: 26px;
    text-align: center;
    background:
      radial-gradient(120% 80% at 50% 0%, rgba(255, 212, 74, 0.18), transparent 70%),
      linear-gradient(180deg, #24163e, #0c0718);
    box-shadow:
      0 0 0 2px #2a1500,
      0 0 0 5px #f0b534,
      0 0 0 7px #2a1500,
      0 30px 70px rgba(0, 0, 0, 0.6);
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: transform 0.45s var(--ease-spring), opacity 0.2s ease;
  }

  .hint.is-in .hint__card {
    transform: none;
    opacity: 1;
  }

  .hint.is-leaving .hint__card {
    transform: scale(0.92);
    opacity: 0;
  }

  .hint.is-leaving .hint__backdrop {
    opacity: 0;
  }

  .hint__art {
    width: 64px;
    height: 64px;
    object-fit: contain;
    animation: wobble 0.9s ease-in-out 0.2s;
  }

  .hint__title {
    font-size: 20px;
    font-weight: 900;
    color: var(--gold-hi);
  }

  .hint__body {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-dim);
  }

  .hint__cta {
    margin-top: 8px;
    min-width: 150px;
    height: 48px;
    padding: 0 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #2a1500;
    background:
      radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 55%),
      linear-gradient(180deg, #ffe27a, #f5b52c 55%, #d88a0c);
    box-shadow:
      0 0 0 2px #2a1500,
      0 5px 0 0 #8a5200,
      0 5px 0 2px #2a1500,
      0 12px 20px rgba(0, 0, 0, 0.45),
      inset 0 2px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
  }

  .hint__cta:active {
    transform: translateY(4px);
    box-shadow:
      0 0 0 2px #2a1500,
      0 1px 0 0 #8a5200,
      0 1px 0 2px #2a1500,
      0 4px 10px rgba(0, 0, 0, 0.45),
      inset 0 2px 0 rgba(255, 255, 255, 0.5);
  }
}
