/* ──────────────────────────────────────────────────────────────────────── */
/*  Tokens of the Unknown — ecosystem trinket generator                     */
/* ──────────────────────────────────────────────────────────────────────── */

.tk-page { max-width: 1200px; margin: 0 auto; }

/* Header */
.tk-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tk-head-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .7rem; border-radius: 999px;
  border: 1px solid rgba(214,178,87,.25); background: rgba(214,178,87,.07);
  color: var(--gold); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem;
}
.tk-head-title h1 {
  margin: 0 0 .4rem; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 10%, #e5daff 55%, #f0cf7d 95%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tk-head-sub { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 580px; }
.tk-head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* Buttons */
.tk-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem; border-radius: 10px;
  font-size: .86rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
  border: 1px solid transparent;
}
.tk-btn-primary {
  background: linear-gradient(135deg, #a589ff 0%, var(--violet) 55%, #6a4df4 100%);
  color: #fff; border-color: rgba(139,112,255,.55);
  box-shadow: 0 3px 14px rgba(139,112,255,.3);
}
.tk-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(139,112,255,.45); }
.tk-btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.tk-btn-ghost:hover { color: var(--text); border-color: var(--gold); background: rgba(214,178,87,.06); }
.tk-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Controls panel */
.tk-controls {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  padding: 1rem 1.15rem; border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26,26,45,.65), rgba(19,19,33,.65));
  margin-bottom: 1.5rem; align-items: flex-end;
}
.tk-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.tk-field-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.tk-input, .tk-select {
  padding: .55rem .75rem;
  background: rgba(8,8,14,.65); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: .88rem; font-family: inherit; outline: none;
  transition: border-color .15s ease; min-width: 140px;
}
.tk-input:focus, .tk-select:focus { border-color: var(--gold); }
.tk-input[type="number"] { width: 110px; min-width: 0; }

/* Flavor segmented control */
.tk-seg { display: inline-flex; border: 1px solid var(--border); background: rgba(8,8,14,.65); border-radius: 10px; overflow: hidden; }
.tk-seg-btn {
  background: none; border: none; color: var(--muted);
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: .55rem .9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: all .15s ease; border-right: 1px solid var(--border);
}
.tk-seg-btn:last-child { border-right: 0; }
.tk-seg-btn:hover { color: var(--text); background: rgba(139,112,255,.06); }
.tk-seg-btn.is-active { background: linear-gradient(135deg, rgba(139,112,255,.22), rgba(139,112,255,.1)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(139,112,255,.4); }

/* Results list */
.tk-results {
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.tk-results-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .5rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: .55rem; margin-bottom: 1rem;
}
.tk-results-title { font-family: var(--display); font-size: 1.2rem; color: var(--gold-hi); letter-spacing: .02em; }
.tk-results-count { font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

.tk-list { list-style: none; counter-reset: tk; padding: 0; margin: 0; display: grid; gap: .55rem; grid-template-columns: 1fr; }
@media (min-width: 780px)  { .tk-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .tk-list { grid-template-columns: 1fr 1fr 1fr; } }
.tk-item {
  counter-increment: tk;
  display: flex; gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255,255,255,.015);
  transition: border-color .15s ease, background .15s ease;
}
.tk-item:hover { border-color: rgba(214,178,87,.3); background: rgba(214,178,87,.04); }
.tk-item-num {
  font-family: var(--display); font-size: .95rem; line-height: 1.3;
  color: var(--gold); min-width: 1.7rem; flex-shrink: 0;
}
.tk-item-num::before { content: counter(tk) "."; }
.tk-item-text { font-size: .88rem; color: var(--text); line-height: 1.55; }

.tk-empty {
  text-align: center; padding: 2.4rem 1rem;
  color: var(--faint); font-style: italic;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.tk-empty-icon { font-size: 1.9rem; color: var(--faint); opacity: .55; }
.tk-empty p { margin: 0; }

/* Skeleton */
.tk-skel {
  height: 44px;
  background: linear-gradient(110deg, rgba(40,40,60,.4) 25%, rgba(70,70,90,.55) 50%, rgba(40,40,60,.4) 75%);
  background-size: 200% 100%;
  border-radius: 12px; border: 1px solid var(--border);
  animation: tk-shimmer 1.4s infinite;
}
@keyframes tk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.tk-toast-host {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  z-index: 99999; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.tk-toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.05rem; border-radius: 10px;
  background: linear-gradient(180deg, rgba(26,26,45,.97), rgba(19,19,33,.97));
  border: 1px solid var(--border); color: var(--text);
  font-size: .86rem; box-shadow: 0 10px 28px rgba(0,0,0,.5);
  pointer-events: auto; animation: tk-toast-in .22s ease-out;
  max-width: 440px;
}
.tk-toast i { font-size: .9rem; flex-shrink: 0; }
.tk-toast.is-info i  { color: var(--violet); }
.tk-toast.is-warn    { border-color: rgba(232,160,80,.5); }
.tk-toast.is-warn i  { color: #e8a050; }
.tk-toast.is-error   { border-color: rgba(233,69,96,.55); }
.tk-toast.is-error i { color: #e94560; }
.tk-toast.is-out { opacity: 0; transform: translateY(-6px); transition: all .2s ease-in; }
@keyframes tk-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 720px) {
  .tk-head { align-items: stretch; }
  .tk-head-actions { justify-content: space-between; }
  .tk-controls { flex-direction: column; align-items: stretch; }
  .tk-select, .tk-input { width: 100%; min-width: 0; }
  .tk-seg { width: 100%; }
  .tk-seg-btn { flex: 1; justify-content: center; }
}
