/* Stare — 1000-yard stare: near borders, infinite center, fall into the fold */

#panel-stare.panel.active {
  display: block;
}

.stare-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.1rem 2.25rem;
  color: #e6e2da;
}

.stare-top h2 {
  margin: 0 0 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0ebe3;
}

.stare-hint {
  margin: 0 0 0.9rem;
  max-width: 46rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(220, 210, 195, 0.72);
}

.stare-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: stretch;
}

.stare-prompt {
  flex: 1 1 14rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 8, 16, 0.85);
  color: #f2ece4;
  font: inherit;
  font-size: 16px;
}

.stare-select {
  min-height: 2.75rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 10, 18, 0.9);
  color: #eee;
  font: inherit;
  font-size: 0.88rem;
}

.stare-btn {
  min-height: 2.75rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(28, 24, 38, 0.9);
  color: #f0ebe4;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
}

.stare-btn.accent {
  border-color: rgba(140, 160, 220, 0.5);
  background: rgba(40, 50, 90, 0.55);
  color: #e8f0ff;
  font-weight: 600;
}

.stare-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stare-status {
  min-height: 1.25rem;
  margin: 0.2rem 0 0.75rem;
  font-size: 0.85rem;
  color: rgba(190, 200, 220, 0.78);
}

.stare-status.err {
  color: #f0a8a8;
}

.stare-status.ok {
  color: #a8dcc0;
}

/* Deep well preview — edges close, center recedes */
.stare-well {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(200, 185, 160, 0.16);
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, #12101c 0%, #08060f 55%, #030208 100%);
  min-height: min(58vh, 540px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 100px rgba(0, 0, 0, 0.72),
    0 24px 70px rgba(0, 0, 0, 0.5);
}

.stare-well::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 10px;
  z-index: 1;
  border-radius: 12px;
  border: 1px solid rgba(220, 200, 160, 0.08);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.stare-well::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(
      ellipse 38% 42% at 50% 48%,
      transparent 0%,
      transparent 22%,
      rgba(0, 0, 0, 0.18) 52%,
      rgba(0, 0, 0, 0.62) 100%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, transparent 16%, transparent 74%, rgba(0, 0, 0, 0.45) 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.55);
}

.stare-well.is-immersive {
  position: fixed;
  inset: 0;
  z-index: 80;
  border-radius: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.stare-well img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(58vh, 520px);
  object-fit: cover;
  /* Slight center push — fall into the distance */
  transform: scale(1.06);
  filter: contrast(1.06) saturate(1.05);
}

.stare-well.is-immersive img {
  max-height: none;
  min-height: 100%;
}

.stare-empty {
  margin: 0;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 22rem;
  color: rgba(200, 190, 175, 0.55);
  font-size: 0.92rem;
  line-height: 1.5;
  z-index: 3;
}

.stare-empty p {
  margin: 0;
}

/* Nested depth geometry view */
.stare-space-wrap {
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.7rem 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(200, 185, 160, 0.14);
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(28, 24, 40, 0.9) 0%, rgba(8, 6, 14, 0.95) 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.stare-space-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.stare-space-bar strong {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 220, 200, 0.88);
}

.stare-space-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: rgba(170, 165, 155, 0.7);
}

.stare-space-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #04030a;
  touch-action: none;
  cursor: grab;
}

.stare-space-stage.is-dragging {
  cursor: grabbing;
}

.stare-space-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stare-space-readout {
  margin: 0.45rem 0 0;
  min-height: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(170, 180, 200, 0.72);
  font-variant-numeric: tabular-nums;
}

.stare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

.stare-actions .stare-prompt {
  flex: 1 1 10rem;
}

.stare-saved h3 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1rem;
  color: #e4dcd0;
}

.stare-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
}

.stare-card {
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 10, 18, 0.95);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stare-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #121018;
}

.stare-card span {
  display: block;
  padding: 0.4rem 0.45rem 0.5rem;
  font-size: 0.74rem;
  line-height: 1.3;
  color: rgba(230, 220, 200, 0.88);
}

.stare-card small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.64rem;
  color: rgba(150, 145, 140, 0.65);
}

.stare-card:hover,
.stare-card:focus-visible {
  border-color: rgba(140, 160, 220, 0.45);
  outline: none;
}

body.stare-immersive .site-header,
body.stare-immersive .money-hud,
body.stare-immersive .xai-credits-hud {
  opacity: 0.15;
  pointer-events: none;
}

.stare-well-exit {
  position: absolute;
  z-index: 5;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
  color: #eee;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  display: none;
}

.stare-well.is-immersive .stare-well-exit {
  display: inline-flex;
  align-items: center;
}

.stare-well.stare-drop-active {
  outline: 2px dashed rgba(160, 180, 255, 0.65);
  outline-offset: -6px;
}

/* Equipped spells */
.stare-equipped-wrap {
  margin: 0.35rem 0 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 6, 14, 0.55);
}

.stare-equipped-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 190, 175, 0.75);
}

.stare-equipped {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 2.5rem;
}

.stare-equipped-empty {
  font-size: 0.82rem;
  color: rgba(170, 165, 155, 0.55);
  text-transform: none;
  letter-spacing: 0;
}

.stare-equip-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(160, 150, 220, 0.28);
  background: rgba(28, 24, 48, 0.55);
}

.stare-equip-row.is-generated {
  border-color: rgba(100, 180, 220, 0.35);
  background: rgba(20, 36, 52, 0.55);
}

.stare-equip-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #121018;
}

.stare-equip-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.stare-equip-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.stare-equip-top strong {
  color: #f0ebe4;
  font-weight: 600;
}

.stare-equip-kind {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(160, 170, 200, 0.7);
}

.stare-equip-remove {
  margin-left: auto;
  border: none;
  background: transparent;
  color: rgba(230, 220, 200, 0.65);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.stare-equip-remove:hover {
  color: #f0a8a8;
}

.stare-potency-label {
  display: block;
  font-size: 0.72rem;
  color: rgba(190, 195, 210, 0.8);
  text-transform: none;
  letter-spacing: 0;
}

.stare-potency-label em {
  font-style: normal;
  color: #c8d8ff;
  font-variant-numeric: tabular-nums;
}

.stare-potency {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  accent-color: #7a8fd4;
  cursor: pointer;
}

.stare-filter-row {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.stare-filter-btn {
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 18, 28, 0.8);
  color: rgba(210, 205, 195, 0.75);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.stare-filter-btn.is-active {
  border-color: rgba(140, 160, 220, 0.5);
  background: rgba(50, 60, 100, 0.55);
  color: #e8f0ff;
}

.stare-spell.is-generated {
  box-shadow: inset 0 0 0 1px rgba(100, 180, 220, 0.35);
}

.stare-btn-mini {
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
}

/* Spell tray */
.stare-tray {
  margin-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.stare-tray-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  color: rgba(220, 210, 195, 0.85);
}

.stare-tray-count {
  flex: 1 1 auto;
  font-size: 0.75rem;
  color: rgba(160, 155, 145, 0.7);
}

.stare-spell-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.55rem;
  -webkit-overflow-scrolling: touch;
}

.stare-spell {
  flex: 0 0 auto;
  width: 72px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #0c0a12;
  color: #ddd;
  font: inherit;
  cursor: grab;
  touch-action: none;
}

.stare-spell img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.stare-spell span {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  padding: 0.2rem 0.15rem 0.3rem;
  color: rgba(220, 210, 200, 0.8);
}

.stare-spell:hover,
.stare-spell:focus-visible {
  border-color: rgba(150, 160, 255, 0.5);
  outline: none;
}

.stare-drag-ghost {
  position: fixed;
  z-index: 9999;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(180, 170, 255, 0.7);
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.stare-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
