/*
 * ╔══════════════════════════════════════════════════════════╗
 * ║  ORACLE — oracle.css                                    ║
 * ║  Dark cyber occult aesthetic                            ║
 * ║  Автор: Тони Ангелчовски · aiflux.eu · sait48.bg        ║
 * ╚══════════════════════════════════════════════════════════╝
 */

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
  --bg:        #0a0005;
  --bg2:       #0f000a;
  --purple:    #6600ff;
  --purple-dim:#3a0066;
  --red:       #ff0066;
  --red-dim:   #660026;
  --text:      #e8d5ff;
  --text-dim:  #8855aa;
  --mono:      'Share Tech Mono', monospace;
  --orb:       'Orbitron', sans-serif;
  --glow-p:    0 0 8px #6600ff, 0 0 20px #6600ff44;
  --glow-r:    0 0 8px #ff0066, 0 0 20px #ff006644;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: crosshair;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--red); text-shadow: var(--glow-r); }

/* ── SCANLINES ──────────────────────────────────────────── */
#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
}

/* ── VIGNETTE ───────────────────────────────────────────── */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.7) 100%
  );
}

/* ── BOOT SCREEN ────────────────────────────────────────── */
#boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.8s ease;
}
#boot-screen.fade-out { opacity: 0; pointer-events: none; }

#boot-text {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--purple);
  max-width: 500px;
  width: 90%;
  line-height: 1.8;
  text-shadow: var(--glow-p);
}
#boot-text .boot-line { display: block; }
#boot-text .boot-line.red { color: var(--red); text-shadow: var(--glow-r); }
#boot-text .boot-line.dim { color: var(--text-dim); }

/* ── HEADER ─────────────────────────────────────────────── */
#oracle-header {
  border-bottom: 1px solid var(--purple-dim);
  padding: 40px 24px 32px;
  background: linear-gradient(to bottom, #110010, transparent);
  text-align: center;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}
#oracle-logo {
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 0 20px #9933ff) brightness(1.4);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 14px #6600ff) brightness(1.3); }
  50%       { filter: drop-shadow(0 0 36px #cc44ff) brightness(1.7); }
}
#sys-name {
  font-family: var(--orb);
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: var(--glow-p);
}
.version {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
}
#sys-sub {
  font-size: 14px;
  letter-spacing: 4px;
  color: #cc99ee;
  margin-top: 2px;
}
#sys-tagline {
  font-size: 14px;
  color: #bb88dd;
  letter-spacing: 2px;
  margin-top: 10px;
  font-family: var(--mono);
  text-shadow: 0 0 10px #9933ff66;
  animation: pulse 4s ease-in-out infinite;
}
#header-status {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
#status-necromancer {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--red);
  text-shadow: var(--glow-r);
  animation: pulse 3s ease-in-out infinite;
}
#status-online {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #00ff88;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ── TAGLINE ────────────────────────────────────────────── */
#oracle-tagline {
  text-align: center;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 2px;
  color: #cc99ee;
  padding: 14px 24px;
  background: linear-gradient(to bottom, #0d0018, transparent);
  text-shadow: 0 0 14px #9933ff88;
  animation: pulse 4s ease-in-out infinite;
}

/* ── TERMINAL BAR ───────────────────────────────────────── */
#terminal-bar {
  background: #0d0012;
  border-top: 1px solid var(--purple-dim);
  border-bottom: 1px solid var(--purple-dim);
  padding: 8px 24px;
  font-size: 13px;
  color: #ddaaff;
  letter-spacing: 1px;
  text-shadow: 0 0 8px #cc44ff;
  display: flex;
  align-items: center;
  gap: 20px;
}
#necromancer-status {
  color: var(--red);
  font-size: 11px;
  letter-spacing: 2px;
  text-shadow: var(--glow-r);
  animation: pulse 3s ease-in-out infinite;
  white-space: nowrap;
  flex-shrink: 0;
}
#necromancer-status::before { content: '⬡ '; }
#terminal-line { flex: 1; }
#terminal-line::before { content: ''; }

/* ── MODE SELECT ────────────────────────────────────────── */
#mode-select {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
}
#mode-intro {
  font-family: var(--mono);
  font-size: 13px;
  color: #7a4a99;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.7;
  border-left: 2px solid var(--purple-dim);
  padding-left: 14px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.mode-card {
  border: 1px solid var(--purple-dim);
  background: #0d0012;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6600ff11, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.mode-card:hover::before { opacity: 1; }

/* Classified module */
.mode-classified {
  border-color: #330011;
  position: relative;
}
.mode-classified:hover {
  border-color: var(--red);
  box-shadow: var(--glow-r), inset 0 0 20px #ff006611;
}
.mode-classified:hover .mode-icon {
  color: var(--red);
  text-shadow: var(--glow-r);
}
.mode-classified-label {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--red);
  letter-spacing: 1px;
  opacity: 0.6;
}
.mode-card:hover {
  border-color: var(--purple);
  box-shadow: var(--glow-p), inset 0 0 20px #6600ff11;
  transform: translateY(-3px);
}
.mode-card:hover .mode-icon {
  color: var(--red);
  text-shadow: var(--glow-r);
}
.mode-icon {
  font-size: 36px;
  color: var(--purple);
  text-shadow: var(--glow-p);
  margin-bottom: 14px;
  transition: all 0.3s;
}
.mode-name {
  font-family: var(--orb);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 10px;
}
.mode-desc {
  font-size: 12px;
  color: var(--red);
  letter-spacing: 1px;
  font-family: var(--mono);
  text-shadow: 0 0 6px #ff006644;
  margin-bottom: 8px;
}
.mode-detail {
  font-size: 11px;
  color: #7a4a99;
  letter-spacing: 0.5px;
  line-height: 1.5;
  font-family: var(--mono);
}

/* ── CHAT SECTION ───────────────────────────────────────── */
#chat-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
#chat-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--purple-dim);
  margin-bottom: 16px;
}
#btn-back {
  background: none;
  border: 1px solid var(--purple-dim);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}
#btn-back:hover {
  border-color: var(--purple);
  color: var(--text);
  box-shadow: var(--glow-p);
}
#chat-mode-title {
  font-family: var(--orb);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--purple);
  text-shadow: var(--glow-p);
}
#chat-header-hint {
  margin-left: auto;
  font-size: 11px;
  color: #4a2266;
  letter-spacing: 1px;
  font-family: var(--mono);
}

/* ── MESSAGES ───────────────────────────────────────────── */
#chat-messages {
  min-height: 300px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--purple-dim) transparent;
}
.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.msg-user .msg-label { color: var(--text-dim); }
.msg-oracle .msg-label { color: var(--purple); text-shadow: var(--glow-p); }

.msg-bubble {
  padding: 14px 18px;
  border-left: 2px solid;
  font-size: 15px;
  line-height: 1.9;
  max-width: 85%;
}
.msg-user .msg-bubble {
  border-color: var(--text-dim);
  color: var(--text);
  background: #0d0012;
  align-self: flex-end;
}
.msg-oracle .msg-bubble {
  border-color: var(--purple);
  color: #f0e6ff;
  background: #0d0012;
  box-shadow: inset 0 0 20px #6600ff08;
  align-self: flex-start;
}

/* Typing indicator */
.typing-indicator span {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--purple);
  border-radius: 50%;
  margin: 0 2px;
  animation: typingDot 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── INPUT AREA ─────────────────────────────────────────── */
#chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--purple-dim);
  padding-top: 14px;
  margin-top: 8px;
}
#prompt-symbol {
  color: var(--red);
  font-size: 16px;
  text-shadow: var(--glow-r);
  padding-bottom: 10px;
  white-space: nowrap;
}
#chat-input {
  flex: 1;
  background: #0d0012;
  border: 1px solid var(--purple-dim);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  max-height: 120px;
}
#chat-input:focus {
  border-color: var(--purple);
  box-shadow: var(--glow-p);
}
#btn-send, #btn-cancel {
  font-family: var(--orb);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 10px 18px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
#btn-send {
  background: var(--purple);
  color: #fff;
  box-shadow: var(--glow-p);
}
#btn-send:hover { background: #7711ff; }
#btn-cancel {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-dim);
}
#btn-cancel:hover { background: var(--red); color: #fff; }

/* ── CHAT HINT ──────────────────────────────────────────── */
#chat-hint {
  font-size: 11px;
  color: #4a2266;
  letter-spacing: 1px;
  text-align: center;
  padding: 6px 0 2px;
  font-family: var(--mono);
}

/* ── FOOTER ─────────────────────────────────────────────── */
#oracle-footer {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  border-top: 1px solid var(--purple-dim);
}
.footer-sep { margin: 0 10px; color: var(--purple-dim); }

/* ── TAROT CARD PICKER ──────────────────────────────────── */
#tarot-picker {
  padding: 16px 0 24px;
}
.picker-label {
  font-size: 13px;
  color: #ddaaff;
  letter-spacing: 2px;
  text-shadow: 0 0 8px #cc44ff;
  margin-bottom: 20px;
  text-align: center;
}

/* ── TAROT QUESTION ─────────────────────────────────────── */
.tarot-question-wrap {
  margin-bottom: 24px;
  text-align: center;
}
.tarot-question-label {
  font-family: var(--orb);
  font-size: 13px;
  letter-spacing: 3px;
  color: #e8d5ff;
  text-shadow: 0 0 10px #9933ff;
  margin-bottom: 8px;
}
.tq-symbol {
  color: var(--red);
  font-size: 10px;
  margin: 0 8px;
  text-shadow: 0 0 6px #ff0066;
}
.tarot-question-sub {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.tarot-question-input-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}
.tq-prompt {
  color: var(--red);
  font-size: 16px;
  text-shadow: 0 0 8px #ff0066;
  padding-top: 10px;
  white-space: nowrap;
}
#tarot-question {
  flex: 1;
  background: #0d0012;
  border: 1px solid var(--purple-dim);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
}
#tarot-question:focus {
  border-color: var(--purple);
  box-shadow: var(--glow-p);
}
#tarot-question::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.tarot-question-hint {
  font-size: 11px;
  color: #4a2266;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ── TAROT DIVIDER ──────────────────────────────────────── */
.tarot-divider {
  text-align: center;
  font-family: var(--orb);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 16px;
  position: relative;
}
.tarot-divider::before,
.tarot-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--purple-dim));
}
.tarot-divider::before { left: 0; }
.tarot-divider::after  { right: 0; background: linear-gradient(to left, transparent, var(--purple-dim)); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 10px;
}
.card-wrap {
  cursor: pointer;
  perspective: 600px;
  transition: transform 0.2s;
}
.card-wrap:hover:not(.card-dimmed) {
  transform: translateY(-4px);
}
.card-dimmed {
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.5s;
}
.card-chosen {
  transform: scale(1.08);
  z-index: 10;
}
.card-flip {
  position: relative;
  width: 100%;
  padding-top: 171%; /* tarot ratio 140:240 */
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-flip.flipped {
  transform: rotateY(180deg);
}
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 5px;
  overflow: hidden;
}
.card-front {
  transform: rotateY(180deg);
  background: #0a0005;
  border: 1px solid #6600ff;
  display: flex;
  flex-direction: column;
}
.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,0,21,0.85);
  font-family: var(--orb);
  font-size: 7px;
  color: #e8d5ff;
  text-align: center;
  padding: 3px 2px;
  letter-spacing: 1px;
}
.card-back {
  background: #06000f;
  border: 1px solid #6600ff;
  overflow: hidden;
}
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── SELECTED CARD DISPLAY ──────────────────────────────── */
#selected-card-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--purple-dim);
  margin-bottom: 16px;
}
#selected-card-img-wrap {
  position: relative;
}
#selected-card-img-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid var(--purple-dim);
  border-radius: 8px;
  animation: pulse 3s ease-in-out infinite;
}
#selected-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: -16px;
  border: 1px solid #3a0066;
  border-radius: 10px;
  animation: pulse 3s ease-in-out 1s infinite;
}
#selected-card-img-wrap img {
  width: 160px;
  height: auto;
  display: block;
  border: 1px solid var(--purple);
  border-radius: 6px;
  box-shadow: 0 0 30px #6600ff88, 0 0 60px #6600ff33;
  filter: brightness(1.1);
  animation: cardGlow 4s ease-in-out infinite;
}
@keyframes cardGlow {
  0%, 100% { box-shadow: 0 0 20px #6600ff66, 0 0 40px #6600ff22; }
  50%       { box-shadow: 0 0 40px #9933ffaa, 0 0 80px #6600ff44; }
}
#selected-card-label {
  font-family: var(--orb);
  font-size: 14px;
  letter-spacing: 3px;
  color: #e8d5ff;
  text-shadow: 0 0 12px #9933ff;
  text-align: center;
}

/* ── GLITCH TEXT UTILITY ────────────────────────────────── */
.glitch-text {
  position: relative;
  display: inline-block;
  animation: glitchAnim 5s steps(1) infinite;
}
@keyframes glitchAnim {
  0%, 88%, 100% { text-shadow: none; transform: none; }
  90% { text-shadow: -2px 0 var(--red); transform: translateX(1px); }
  92% { text-shadow: 2px 0 var(--purple); transform: translateX(-1px); }
  94% { text-shadow: none; transform: none; }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
/* ── TABLET ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .modes-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  #mode-select { margin: 40px auto; }
  #sys-name { font-size: 18px; }
  #sys-sub { font-size: 11px; letter-spacing: 2px; }
  #oracle-logo { width: 110px; height: 110px; }
}

/* ── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* header */
  #oracle-header { padding: 12px 16px; }
  #oracle-logo { width: 90px; height: 90px; }
  #sys-name { font-size: 22px; letter-spacing: 4px; }
  #sys-sub { font-size: 10px; letter-spacing: 1px; }
  #status-label { display: none; }

  /* terminal bar */
  #terminal-bar { font-size: 12px; padding: 8px 16px; }

  /* mode grid — 1 колона на много малки екрани */
  .modes-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #mode-select { margin: 24px auto; padding: 0 12px; }
  .mode-card { padding: 22px 12px; }
  .mode-icon { font-size: 28px; margin-bottom: 10px; }
  .mode-name { font-size: 12px; letter-spacing: 1px; }
  .mode-desc { font-size: 11px; }

  /* chat */
  #chat-section { padding: 0 12px 16px; }
  #chat-mode-title { font-size: 11px; letter-spacing: 2px; }
  .msg-bubble { font-size: 14px; padding: 10px 14px; max-width: 95%; }

  /* tarot grid */
  .cards-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .card-name { font-size: 6px; }

  /* input */
  #chat-input { font-size: 14px; }
  #btn-send, #btn-cancel { font-size: 10px; padding: 10px 12px; letter-spacing: 1px; }
  #prompt-symbol { font-size: 14px; }

  /* footer */
  #oracle-footer { font-size: 11px; padding: 14px; }
}

/* ── VERY SMALL ─────────────────────────────────────────── */
@media (max-width: 360px) {
  .modes-grid { grid-template-columns: 1fr; }
  #sys-name { font-size: 13px; }
}
