:root {
  --bg: #07111e;
  --bg2: #10233b;
  --panel: #ced9e6;
  --panel-dark: #8fa3bb;
  --line: #36495f;
  --text: #0d1a2a;
  --white: #f2f7fb;
  --blue1: #3d7bd0;
  --blue2: #2456a2;
  --blue3: #98c4ff;
  --yellow: #ffe66d;
  --green: #7ef7ae;
  --red: #ff7d7d;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at top, #1d3d67 0%, transparent 35%),
    linear-gradient(180deg, #04101d 0%, #061425 40%, #030910 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
}

.noise,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.noise {
  opacity: 0.06;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.4) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.2) 0 1px, transparent 1px),
    radial-gradient(circle at 60% 40%, rgba(255,255,255,0.2) 0 1px, transparent 1px);
  background-size: 6px 6px, 7px 7px, 5px 5px;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.22;
}

.site-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto;
}

.window {
  border: 1px solid #f6fbff;
  border-right-color: #5a6f89;
  border-bottom-color: #5a6f89;
  box-shadow: 0 10px 24px var(--shadow);
  background: linear-gradient(180deg, #dce7f2 0%, #b6c8dd 100%);
}

.topbar {
  margin-bottom: 14px;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #f4f8ff;
  font-size: 12px;
  background: linear-gradient(180deg, #0e54b2 0%, #083a7d 100%);
  border-bottom: 1px solid #6ab1ff;
}

.titlebar-right {
  margin-left: auto;
  opacity: 0.9;
  font-size: 11px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.5);
}

.red { background: #e25d5d; }
.yellow { background: #f0c760; }
.green { background: #67d08b; }

.hero {
  color: #061524;
  text-align: center;
  padding: 22px 18px 18px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.85), rgba(255,255,255,0) 45%),
    linear-gradient(180deg, #dceeff 0%, #8fc4ff 52%, #4b8de2 52%, #2f68bb 100%);
}

.badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #fefac8;
  background: linear-gradient(180deg, #6c0818 0%, #aa1830 100%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff8b8;
  text-shadow:
    0 1px 0 #654b00,
    0 2px 0 #654b00,
    0 0 10px rgba(255, 246, 142, 0.6);
}

.subtitle {
  margin: 10px 0 12px;
  font-size: 1rem;
  color: #eff7ff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

marquee {
  padding: 8px 10px;
  color: #fdfdfd;
  font-weight: bold;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.65);
  background: linear-gradient(180deg, rgba(10,39,81,0.8), rgba(3,18,38,0.8));
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.panel {
  color: var(--text);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 14px;
}

.panel-heading {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: bold;
  color: #f3f8ff;
  background: linear-gradient(180deg, #4f7ebf 0%, #2d5da8 100%);
  border-bottom: 1px solid #a8c4ec;
}

.panel-body {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(228,237,246,0.92) 100%);
}

label,
.small,
.status-box,
.tiny-box,
.fortune-summary,
.warning-box,
#detailsPanel {
  font-size: 13px;
  line-height: 1.45;
}

select,
button {
  font-family: inherit;
}

select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  color: #061524;
  border: 1px solid #5f7894;
  border-top-color: #8197ae;
  background: linear-gradient(180deg, #ffffff 0%, #dce8f3 100%);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.15);
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.glossy {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: bold;
  color: #fff;
  border: 1px solid #2b4f88;
  background: linear-gradient(180deg, #7fc0ff 0%, #3b7ed3 50%, #22579e 51%, #1a437f 100%);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 2px 0 rgba(0,0,0,0.2);
}

.glossy:hover {
  filter: brightness(1.08);
}

.glossy:active {
  transform: translateY(1px);
}

.glossy.alt {
  background: linear-gradient(180deg, #ffe68d 0%, #f4c448 50%, #d89d18 51%, #aa7307 100%);
  color: #2b1700;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  border-color: #9d6d0f;
}

.tiny-box,
.status-box,
.warning-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed #6f87a2;
  background: rgba(255,255,255,0.55);
}

.tiny-box ol {
  padding-left: 20px;
  margin: 8px 0 0;
}

.warning-box {
  color: #561414;
  background: linear-gradient(180deg, #fff3a7 0%, #ffd88e 100%);
  border-style: solid;
  border-color: #c38f21;
}

.fortune-summary {
  margin: 0;
  font-size: 14px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tarot-card {
  min-height: 340px;
  padding: 10px;
  position: relative;
  border: 2px solid #f4f0bf;
  box-shadow:
    inset 0 0 0 2px #7e6f21,
    0 14px 24px rgba(0,0,0,0.45);
  background: linear-gradient(180deg, #233f6f 0%, #152948 100%);
  color: #fff7c8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tarot-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255,245,174,0.5);
  pointer-events: none;
}

.tarot-card:hover {
  transform: translateY(-3px);
  filter: brightness(1.04);
}

.tarot-card.back {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 45%),
    linear-gradient(180deg, #193357 0%, #0d1d38 100%);
}

.tarot-card.back::after {
  content: "✦ ✦ ✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  letter-spacing: 8px;
  color: rgba(255,247,177,0.18);
}

.tarot-card.revealed.good {
  background: linear-gradient(180deg, #234d38 0%, #133020 100%);
}

.tarot-card.revealed.bad {
  background: linear-gradient(180deg, #592631 0%, #321018 100%);
}

.tarot-card.revealed.chaos {
  background: linear-gradient(180deg, #4f3b1b 0%, #2f1e0b 100%);
}

.card-top,
.card-bottom {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.card-middle {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  padding: 12px 0;
}

.card-slot {
  font-size: 13px;
  opacity: 0.85;
}

.card-icon {
  font-size: 44px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255,255,255,0.35);
}

.card-name {
  font-size: 1.15rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-tag {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  color: #07111e;
  background: linear-gradient(180deg, #fff8bf 0%, #f0d85f 100%);
  border: 1px solid #8d7622;
}

.details-panel {
  margin-top: 14px;
}

.reading-item + .reading-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dotted #667b95;
}

.reading-item h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #15365d;
}

.reading-item p {
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 18px;
  border: 1px dashed #7890aa;
  background: rgba(255,255,255,0.45);
}

.footer-box {
  margin-top: 14px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #10233b;
  background: linear-gradient(180deg, #d5e2ef 0%, #afc3d8 100%);
}

.blink {
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.25; }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 12px, 1000px);
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .tarot-card {
    min-height: 260px;
  }

  .buttons,
  .footer-content {
    grid-template-columns: 1fr;
    display: grid;
  }

  .titlebar {
    flex-wrap: wrap;
  }

  .titlebar-right {
    margin-left: 0;
    width: 100%;
  }
}
