* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #080818;
  --bg2: #0f0f2a;
  --gold: #c4a55f;
  --gold2: #e8c97a;
  --text: #e2d9f3;
  --muted: #7c6fa0;
  --card-bg: #13132a;
  --card-border: #2a2a5a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Stars */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.3); }
}

/* Screens */
.screen { display: none; position: relative; z-index: 1; min-height: 100vh; }
.screen.active { display: block; }

/* Main screen */
#main-screen {
  display: none;
  align-items: center;
  justify-content: center;
}
#main-screen.active { display: flex; }

.main-content {
  text-align: center;
  padding: 40px 24px;
}

.logo {
  font-size: 2.8rem;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(196, 165, 95, 0.6), 0 0 60px rgba(196, 165, 95, 0.2);
  margin-bottom: 12px;
}

.tagline {
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-bottom: 52px;
  font-style: italic;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.btn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.btn-desc {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-align: center;
  font-style: italic;
}

.niyet-text {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
  font-style: italic;
}

.screen-desc {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.07em;
  font-style: italic;
  padding: 64px 24px 0;
  line-height: 1.6;
}

.btn-primary {
  background: linear-gradient(135deg, #2a1f5a, #3d2d7a);
  color: var(--gold2);
  border: 1px solid var(--gold);
  padding: 14px 44px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(196, 165, 95, 0.15);
  min-width: 220px;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3d2d7a, #5a3fa0);
  box-shadow: 0 0 30px rgba(196, 165, 95, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--card-border);
  padding: 12px 44px;
  font-size: 0.9rem;
  font-family: 'Georgia', serif;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 220px;
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Back button */
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 4px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--gold); }

/* Card */
.card-container {
  width: 200px;
  height: 340px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.card.flipped { transform: rotateY(180deg); }

.card-back, .card-front {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  background: linear-gradient(160deg, #1a0f3a 0%, #0f0820 50%, #1a0f3a 100%);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(196, 165, 95, 0.2), inset 0 0 40px rgba(60, 0, 100, 0.4);
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(196, 165, 95, 0.3);
  border-radius: 8px;
}

.card-back-design {
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(196, 165, 95, 0.8);
  letter-spacing: 0.3em;
  z-index: 1;
}

.card-front {
  transform: rotateY(180deg);
  background: #0a0820;
  border: 2px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(196, 165, 95, 0.25);
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-front img.reversed {
  transform: rotate(180deg);
}

.reversed-tag {
  font-size: 0.6rem;
  color: #c060a0;
  letter-spacing: 0.12em;
  background: rgba(180,60,140,0.12);
  border: 1px solid rgba(180,60,140,0.3);
  padding: 2px 7px;
  border-radius: 3px;
  vertical-align: middle;
  font-style: normal;
}

/* Single screen */
.single-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px 48px;
  gap: 0;
}

.card-info {
  text-align: center;
  max-width: 480px;
  margin-top: 28px;
  opacity: 1;
  transition: opacity 0.4s;
}
.card-info.hidden { opacity: 0; pointer-events: none; }

.card-number {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.card-name {
  font-size: 1.8rem;
  color: var(--gold2);
  text-shadow: 0 0 20px rgba(196, 165, 95, 0.4);
  margin-bottom: 14px;
  letter-spacing: 0.08em;
}

.card-keywords {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-bottom: 18px;
  line-height: 1.8;
}

.card-meaning {
  font-size: 0.97rem;
  line-height: 1.85;
  color: #c8bde8;
  font-style: italic;
  padding: 18px 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

/* Spread screen */
.spread-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 16px 48px;
  gap: 32px;
}

.spread-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.spread-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spread-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.spread-slot .card-container {
  width: 140px;
  height: 238px;
}

.spread-card-name {
  font-size: 0.85rem;
  color: var(--gold2);
  text-align: center;
  min-height: 20px;
  transition: opacity 0.3s;
  letter-spacing: 0.05em;
}

.spread-meanings {
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spread-meaning-block {
  padding: 16px 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.spread-meaning-label {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.spread-meaning-keywords {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.spread-meaning-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #c8bde8;
  font-style: italic;
}

/* Link button */
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: 'Georgia', serif;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
  margin-top: 8px;
}
.btn-link:hover { color: var(--gold); }

/* Kart Sözlüğü */
.dict-content {
  padding: 72px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.dict-title {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.dict-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 560px;
}

.dict-filter {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--muted);
  padding: 6px 14px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Georgia', serif;
}
.dict-filter:hover { border-color: var(--gold); color: var(--gold); }
.dict-filter.active { border-color: var(--gold); color: var(--gold2); background: rgba(196,165,95,0.1); }

.dict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  max-width: 560px;
  width: 100%;
}

.dict-card {
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s;
}
.dict-card:hover { transform: translateY(-4px); }

.dict-card-img {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  aspect-ratio: 200 / 340;
}
.dict-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dict-card-name {
  font-size: 0.62rem;
  color: var(--gold2);
  letter-spacing: 0.03em;
  margin-top: 4px;
  line-height: 1.3;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  max-width: 580px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  padding: 28px 24px 24px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--gold); }

.modal-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.modal-img {
  width: 130px;
  height: 221px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  flex-shrink: 0;
}

.modal-info { flex: 1; min-width: 0; }

.modal-en {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
}

.modal-section-title {
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Pick grid (spread secimi) */
.pick-phase {
  width: 100%;
  min-height: calc(100vh - 60px);
  padding: 60px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pick-instruction {
  font-size: 0.88rem;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-align: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 6px;
  max-width: min(1060px, calc(100vw - 40px));
  width: 100%;
  margin: 0 auto;
}

.pick-card {
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, #1a0f3a 0%, #0f0820 50%, #1a0f3a 100%);
  border: 1px solid var(--gold);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}
.pick-card::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(196,165,95,0.15);
  border-radius: 2px;
  pointer-events: none;
}
.pick-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(196,165,95,0.4); }
.pick-card.picked {
  border-color: var(--gold2);
  background: linear-gradient(160deg, #2d1f5a 0%, #1a1035 50%, #2d1f5a 100%);
  box-shadow: 0 0 10px rgba(196,165,95,0.5);
  cursor: default;
  transform: none;
}
.pick-back-design { display: none; }
.pick-card.picked .pick-back-design {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.6rem;
  font-weight: bold;
  color: var(--gold2);
}

/* Daily card */
.daily-date {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 6px;
}
.daily-label {
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Celtic Cross */
.celtic-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 16px 48px;
  gap: 24px;
}

#celtic-meanings {
  min-height: 140px;
  max-width: 560px;
  width: 100%;
}

.celtic-layout {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.celtic-cross-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.celtic-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: flex-end;
}

.celtic-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.celtic-empty {
  width: 80px;
}

.celtic-pos-label {
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.cc-card {
  width: 80px;
  height: 136px;
}

.cc-card .card-back-design {
  font-size: 1rem;
}

.celtic-staff {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mobile */
@media (max-width: 480px) {
  .logo { font-size: 2rem; }
  .card-container { width: 170px; height: 289px; }
  .spread-slot .card-container { width: 100px; height: 170px; }
  .spread-cards { gap: 8px; }
  .card-back-design { font-size: 1.2rem; }
  .card-name { font-size: 1.5rem; }
  .single-content { padding: 72px 16px 40px; }
  .celtic-empty { width: 64px; }
  .cc-card { width: 64px; height: 109px; }
  .celtic-layout { gap: 12px; }
  .celtic-staff { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pick-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .dict-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
  .modal-content { flex-direction: column; align-items: center; }
  .modal-img { width: 110px; height: 187px; }
}
