:root {
  --rq-black: #000000;
  --rq-charcoal: #16161a;
  --rq-panel: #1e1e22;
  --rq-gold: #c9a24b;
  --rq-gold-bright: #e8c874;
  --rq-emerald: #1f5c3f;
  --rq-emerald-bright: #2f8f61;
  --rq-white: #f2ede0;
  --rq-gray: #8a8a8f;
  --rq-danger: #8f2f2f;
  --rq-radius: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--rq-white);
  font-family: "Georgia", "Iowan Old Style", serif;
}

body {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.95)),
    url('/Images/splash-bg.png') center / cover fixed no-repeat,
    var(--rq-black);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

h1, h2, h3 {
  color: var(--rq-gold-bright);
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(232, 200, 116, 0.25);
  margin-top: 0;
  font-variant: small-caps;
  font-weight: 700;
}

h1 {
  font-size: 2.1rem;
}

h2 {
  font-size: 1.4rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201, 162, 75, 0.5);
  position: relative;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: rgba(201, 162, 75, 0.2);
}

h3 {
  font-size: 1.05rem;
  color: var(--rq-gold);
}

a {
  color: var(--rq-gold);
}

button {
  font-family: inherit;
}

.screen {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Ornate frame: tekrar kullanilabilir sussleme cercevesi --- */
.ornate-frame {
  position: relative;
  background-color: var(--rq-panel);
  background-image:
    radial-gradient(ellipse at top left, rgba(90, 65, 30, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(0, 0, 0, 0.35), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l9 5.2v9.6L12 22l-9-5.2V7.2z M12 2v20 M3 7.2l9 5 9-5 M3 16.8l9-4.6 9 4.6' fill='none' stroke='%23c9a24b' stroke-width='1' stroke-opacity='0.07'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: top left, bottom right, bottom -20px right -20px;
  background-size: auto, auto, 180px 180px;
  border: 2px solid var(--rq-gold);
  border-radius: var(--rq-radius);
  padding: 20px;
  box-shadow: 0 0 0 1px rgba(201, 162, 75, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.ornate-frame::before,
.ornate-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--rq-gold);
  opacity: 0.9;
}

.ornate-frame::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 6px;
}

.ornate-frame::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 6px;
}

/* --- Buton / etkilesim efektleri --- */
.rq-btn {
  background: linear-gradient(180deg, #2e2a20, #17140f);
  color: var(--rq-gold-bright);
  border: 1px solid var(--rq-gold);
  border-radius: 4px;
  padding: 10px 22px;
  font-size: 1rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(232, 200, 116, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rq-btn:hover {
  box-shadow: 0 0 12px rgba(201, 162, 75, 0.5);
  transform: translateY(-1px);
}

.rq-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 4px rgba(201, 162, 75, 0.4);
}

.rq-btn:focus-visible {
  outline: 2px solid var(--rq-emerald-bright);
  outline-offset: 2px;
}

.rq-btn.secondary {
  color: var(--rq-white);
  border-color: var(--rq-gray);
}

.rq-btn.danger {
  border-color: var(--rq-danger);
  color: #e29a9a;
}

.rq-card {
  background: var(--rq-panel);
  border: 1px solid rgba(201, 162, 75, 0.4);
  border-radius: var(--rq-radius);
  padding: 14px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.rq-card:hover {
  border-color: var(--rq-gold);
  box-shadow: 0 0 10px rgba(201, 162, 75, 0.25);
}

.rq-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.rq-field label {
  font-size: 0.85rem;
  color: var(--rq-gray);
}

.rq-field input,
.rq-field select,
.rq-field textarea {
  background: var(--rq-charcoal);
  border: 1px solid var(--rq-gray);
  color: var(--rq-white);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
}

.rq-error {
  color: #e29a9a;
  font-size: 0.9rem;
}

.rq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 720px;
}

.rq-logo {
  height: 48px;
}

.rq-act-bg {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(201, 162, 75, 0.4);
  margin: 8px 0 4px;
}

/* --- Karakter portresi (cift cerceve, karakter kagidi hissi) --- */
.rq-portrait {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  padding: 6px;
  border: 1px solid var(--rq-gold);
  outline: 3px double rgba(201, 162, 75, 0.5);
  outline-offset: 4px;
  border-radius: 4px;
  background: var(--rq-charcoal);
}

/* --- Sinif secim gridi (buyuk, belirgin kartlar) --- */
.rq-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.rq-class-card {
  background: var(--rq-charcoal);
  border: 2px solid rgba(201, 162, 75, 0.35);
  border-radius: var(--rq-radius);
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  color: var(--rq-white);
  font-size: 0.95rem;
}

.rq-class-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
}

.rq-class-card:hover {
  border-color: var(--rq-gold);
  transform: translateY(-2px);
}

.rq-class-card.is-selected {
  border-color: var(--rq-gold-bright);
  box-shadow: 0 0 16px rgba(201, 162, 75, 0.5);
}

.rq-portrait-fallback {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--rq-black);
  font-weight: bold;
  margin: 0 auto;
}

/* --- Stat grid --- */
.rq-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rq-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rq-charcoal);
  border-radius: 4px;
  border-top: 2px solid rgba(201, 162, 75, 0.45);
  padding: 8px 10px;
}

.rq-stat svg {
  width: 22px;
  height: 22px;
  color: var(--rq-gold);
  flex-shrink: 0;
}

.rq-stat .rq-stat-value {
  font-weight: bold;
  color: var(--rq-white);
}

.rq-stat .rq-stat-label {
  font-size: 0.7rem;
  color: var(--rq-gray);
  display: block;
}

/* --- Envanter --- */
.rq-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.rq-inventory-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rq-charcoal);
  border: 1px solid rgba(201, 162, 75, 0.3);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
}

.rq-item-name {
  font-size: 0.9rem;
  color: var(--rq-white);
}

.rq-item-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--rq-gold);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(232, 200, 116, 0.18), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rq-gold-bright);
  flex-shrink: 0;
}

.rq-item-icon svg {
  width: 20px;
  height: 20px;
}

/* --- D20 zar --- */
.rq-dice-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rq-dice {
  width: 96px;
  height: 96px;
  perspective: 400px;
}

.rq-dice-face {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rq-gold-bright);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.rq-dice.is-rolling .rq-dice-face {
  animation: rq-dice-spin 0.6s ease-out;
}

@keyframes rq-dice-spin {
  0% { transform: rotate3d(1, 1, 0, 0deg) scale(1); }
  60% { transform: rotate3d(1, 1, 0, 540deg) scale(1.08); }
  100% { transform: rotate3d(1, 1, 0, 720deg) scale(1); }
}

.rq-dice-face svg {
  width: 100%;
  height: 100%;
}

.rq-dice-result {
  font-size: 1.4rem;
  font-weight: bold;
}

.rq-dice-result.is-critical {
  color: var(--rq-gold-bright);
  animation: rq-critical-flash 0.9s ease-out;
}

@keyframes rq-critical-flash {
  0% { text-shadow: 0 0 0 rgba(232, 200, 116, 0); }
  30% { text-shadow: 0 0 24px rgba(232, 200, 116, 0.95); }
  100% { text-shadow: 0 0 0 rgba(232, 200, 116, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .rq-dice.is-rolling .rq-dice-face {
    animation: none;
  }
  .rq-dice-result.is-critical {
    animation: none;
    text-shadow: 0 0 10px rgba(232, 200, 116, 0.6);
  }
  .rq-btn:hover {
    transform: none;
  }
}

.rq-character-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rq-quest-log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rq-quest-log li {
  border-left: 3px solid var(--rq-emerald-bright);
  padding: 6px 10px;
  background: var(--rq-charcoal);
  border-radius: 0 6px 6px 0;
}

.rq-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rq-muted {
  color: var(--rq-gray);
  font-size: 0.9rem;
}

/* --- Sahne girisi (DM'in yuksek sesle okuyacagi hype metni) --- */
.rq-scene-intro {
  background: linear-gradient(180deg, rgba(90, 65, 30, 0.25), rgba(90, 65, 30, 0.08));
  border-left: 3px solid var(--rq-gold);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.rq-scene-intro-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rq-gold);
  margin-bottom: 4px;
}

.rq-scene-intro p {
  font-style: italic;
  color: var(--rq-white);
  margin: 0;
}

/* --- DM Notu (sadece DM'in gorecegi, oyunculara okunmayacak ipucu) --- */
.rq-dm-note {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--rq-gray);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.rq-dm-note summary {
  cursor: pointer;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rq-gray);
}

.rq-dm-note p {
  margin: 8px 0 0;
  color: var(--rq-white);
  font-size: 0.9rem;
}

/* --- Kader Karti overlay --- */
.rq-fate-card {
  text-align: center;
  padding: 24px;
}

.rq-fate-card-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rq-gold);
  margin-bottom: 12px;
}

.rq-fate-card img {
  width: 100%;
  max-width: 260px;
  border-radius: 8px;
  border: 2px solid var(--rq-gold);
  box-shadow: 0 0 24px rgba(232, 200, 116, 0.35);
  margin-bottom: 16px;
}

.rq-fate-card h3 {
  margin: 0 0 8px;
}

.rq-fate-card-flavor {
  font-style: italic;
  color: var(--rq-white);
  margin: 0 0 12px;
}

.rq-fate-card-effect {
  color: var(--rq-gold-bright);
  font-weight: bold;
  margin: 0 0 16px;
}

/* --- Splash kapisi (giris ekrani) --- */
.rq-splash-gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background-size: cover;
  background-position: center;
  text-align: center;
}

.rq-splash-logo {
  max-width: 240px;
  width: 60%;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.8));
}

.rq-splash-tagline {
  color: var(--rq-white);
  font-size: 1.1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  margin: 0;
}

.rq-key-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 110px;
  height: 110px;
  padding: 0;
  color: var(--rq-gold-bright);
  filter: drop-shadow(0 0 14px rgba(232, 200, 116, 0.55));
  transition: transform 0.2s ease, filter 0.2s ease;
  animation: rq-key-pulse 3.2s ease-in-out infinite;
}

.rq-key-btn svg {
  width: 100%;
  height: 100%;
}

.rq-key-btn:hover,
.rq-key-btn:focus-visible {
  transform: scale(1.08) rotate(-4deg);
  filter: drop-shadow(0 0 26px rgba(232, 200, 116, 0.9));
  outline: none;
}

@keyframes rq-key-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(232, 200, 116, 0.4)); }
  50% { filter: drop-shadow(0 0 22px rgba(232, 200, 116, 0.75)); }
}

@media (prefers-reduced-motion: reduce) {
  .rq-key-btn {
    animation: none;
  }
  .rq-key-btn:hover {
    transform: none;
  }
}

/* --- Modal (DM sifre popup'i, ayarlar vb. icin genel) --- */
.rq-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.rq-modal-backdrop[hidden] {
  display: none;
}

.rq-modal {
  width: 100%;
  max-width: 420px;
}
