/* ---------- Queens Oyun Ekranı ---------- */
.queens-game-screen {
  padding: 8px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
}

.queens-topbar {
  display: grid;
  grid-template-columns: 44px 1fr 96px;
  align-items: center;
  padding: 8px 0 4px;
}

.queens-topbar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.queens-title-glyph {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.queens-title-glyph .queens-crown {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.queens-topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.queens-meta-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 2px 14px;
}

.queens-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.queens-difficulty {
  justify-self: center;
  background: var(--line-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
}

.queens-difficulty strong {
  font-weight: 800;
  margin-left: 4px;
  letter-spacing: 0.04em;
}

.queens-reset-btn {
  justify-self: end;
  min-width: 92px;
  min-height: 40px;
  border-radius: 999px;
  border: 1.5px solid var(--btn-border);
  background: transparent;
  color: var(--btn-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 18px;
}

.queens-reset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Tahta ---------- */
.queens-board {
  position: relative;
  display: grid;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-bg);
  user-select: none;
  touch-action: manipulation;
  aspect-ratio: 1 / 1;
}

.queens-cell {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  overflow: hidden;
}

.queens-cell:disabled {
  cursor: default;
}

.queens-cell-fill {
  position: absolute;
  inset: 0;
  background: var(--region-fill, #fff);
  z-index: 0;
}

.queens-cell-borders {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow:
    inset 0 0 0 0 transparent;
}

.queens-cell-borders[data-top] {
  border-top: 2.5px solid var(--ink);
}

.queens-cell-borders[data-left] {
  border-left: 2.5px solid var(--ink);
}

.queens-cell-borders[data-right] {
  border-right: 2.5px solid var(--ink);
}

.queens-cell-borders[data-bottom] {
  border-bottom: 2.5px solid var(--ink);
}

.queens-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-right: 1px solid rgba(15, 23, 42, 0.12);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  z-index: 1;
}

.queens-cell-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.78) 0,
    rgba(220, 38, 38, 0.78) 4px,
    rgba(255, 255, 255, 0) 4px,
    rgba(255, 255, 255, 0) 9px
  );
  mix-blend-mode: multiply;
}

.queens-cell-stripes-error {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.92) 0,
    rgba(220, 38, 38, 0.92) 4px,
    rgba(255, 255, 255, 0) 4px,
    rgba(255, 255, 255, 0) 9px
  );
}

.queens-crown,
.queens-xmark {
  position: relative;
  z-index: 5;
  width: 60%;
  height: 60%;
  color: var(--ink);
  pointer-events: none;
}

.queens-xmark {
  width: 50%;
  height: 50%;
  color: rgba(15, 23, 42, 0.78);
}

.queens-cell[data-state="queen"][data-conflict] .queens-crown {
  color: #b91c1c;
}

.queens-board[data-done] .queens-crown {
  color: #d6a821;
  filter: drop-shadow(0 1px 2px rgba(214, 168, 33, 0.4));
}

.queens-cell[data-prefilled] {
  cursor: not-allowed;
}

.queens-cell[data-prefilled] .queens-crown {
  color: var(--ink);
  opacity: 0.96;
}

/* ---------- Kontroller ---------- */
.queens-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.queens-control-btn {
  min-height: 50px;
  border-radius: 999px;
  border: 1.5px solid var(--btn-border);
  background: transparent;
  color: var(--btn-ink);
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
}

.queens-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Hata / İpucu kartları ---------- */
.queens-error-card,
.queens-hint-card {
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.queens-error-card {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #7f1d1d;
}

.queens-error-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.queens-error-actions,
.queens-hint-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.queens-link-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  padding: 4px 8px;
  cursor: pointer;
}

.queens-close-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.queens-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.queens-hint-card {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.queens-hint-card .queens-hint-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.queens-hint-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.queens-hint-message {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

/* ---------- Akordiyon panelleri ---------- */
.queens-accordion {
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.queens-accordion-header {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.queens-accordion-header svg {
  flex-shrink: 0;
  transition: transform 0.18s ease;
  transform: rotate(180deg);
}

.queens-accordion.is-open .queens-accordion-header svg {
  transform: rotate(0deg);
}

.queens-accordion-body {
  padding: 0 20px 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.queens-accordion-body p {
  margin: 0;
}

.queens-howto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.queens-howto li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.queens-howto-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mini grid (örnekler / eğitim) ---------- */
.queens-mini-grid {
  display: grid;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: var(--card-bg);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.queens-mini-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}

.queens-mini-fill {
  position: absolute;
  inset: 0;
  background: var(--region-fill, #fff);
}

.queens-mini-cell .queens-cell-borders {
  z-index: 1;
}

.queens-mini-cell .queens-cell-borders[data-top] {
  border-top: 2px solid var(--ink);
}

.queens-mini-cell .queens-cell-borders[data-left] {
  border-left: 2px solid var(--ink);
}

.queens-mini-cell .queens-cell-borders[data-right] {
  border-right: 2px solid var(--ink);
}

.queens-mini-cell .queens-cell-borders[data-bottom] {
  border-bottom: 2px solid var(--ink);
}

.queens-mini-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(15, 23, 42, 0.18);
  border-bottom: 1px solid rgba(15, 23, 42, 0.18);
  z-index: 1;
  pointer-events: none;
}

.queens-mini-cell .queens-crown,
.queens-mini-cell .queens-xmark {
  position: relative;
  z-index: 3;
  width: 70%;
  height: 70%;
  color: var(--ink);
}

/* ---------- Örnekler karuseli ---------- */
.queens-examples {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.queens-examples-stage {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 12px;
}

.queens-examples-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.queens-examples-arrow:hover {
  background: var(--line-2);
}

.queens-examples-card {
  background: var(--app-bg);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queens-examples-caption {
  text-align: center;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.queens-examples-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.queens-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: none;
  padding: 0;
  cursor: pointer;
}

.queens-dot.is-active {
  background: var(--ink);
}

button.queens-dot {
  cursor: pointer;
}

/* ---------- Eğitim modali ---------- */
.queens-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.queens-tutorial-card {
  position: relative;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queens-tutorial-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--line-2);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.queens-tutorial-title {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  padding-right: 36px;
}

.queens-tutorial-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

.queens-tutorial-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.queens-tutorial-step-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.queens-tutorial-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}

.queens-tutorial-progress .queens-dot {
  pointer-events: none;
}

.queens-tutorial-primary {
  width: 100%;
  border: none;
  background: var(--ink);
  color: var(--card-bg);
  border-radius: 999px;
  padding: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Sonuç kartı ---------- */
.queens-results-card {
  margin-top: 6px;
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.queens-results-title {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.queens-results-stats {
  display: grid;
  gap: 8px;
}

.queens-results-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 15px;
}

.queens-results-stats span {
  color: var(--ink-2);
}

.queens-results-stats strong {
  color: var(--ink);
}

.queens-results-btn {
  width: 100%;
  border: none;
  background: var(--ink);
  color: var(--card-bg);
  border-radius: 999px;
  padding: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Ana sayfa Queens önizleme ---------- */
.queens-preview-mini {
  width: 100%;
  height: 100%;
  display: grid;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--card-bg);
}

.queens-preview-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--region-fill, #eee);
  border-right: 0.5px solid rgba(15, 23, 42, 0.18);
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.18);
  color: var(--ink);
}

.queens-preview-cell[data-top]::before,
.queens-preview-cell[data-left]::before,
.queens-preview-cell[data-right]::after,
.queens-preview-cell[data-bottom]::after {
  content: '';
  position: absolute;
  background: var(--ink);
  z-index: 2;
}

.queens-preview-cell[data-top]::before {
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
}

.queens-preview-cell[data-bottom]::after {
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5px;
}

.queens-preview-cell[data-left]::before {
  top: 0;
  bottom: 0;
  left: 0;
  width: 1.5px;
  height: auto;
}

.queens-preview-cell[data-right]::after {
  top: 0;
  bottom: 0;
  right: 0;
  width: 1.5px;
  height: auto;
}

.queens-preview-cell[data-top][data-left]::before,
.queens-preview-cell[data-bottom][data-right]::after {
  /* If both, only first pseudo can have one direction; visual fallback is fine */
}

.queens-preview-crown {
  position: relative;
  z-index: 3;
  width: 70%;
  height: 70%;
}

/* ---------- Desktop ---------- */
.viewport-desktop .queens-game-screen {
  padding: 0;
}

.viewport-desktop .queens-topbar {
  display: none;
}

.viewport-desktop .queens-meta-row {
  border-bottom: 1px solid var(--line-2);
  padding: 0 0 14px;
  margin-bottom: 12px;
}

.viewport-desktop .queens-board {
  max-width: 540px;
  margin: 0 auto;
}

@media (max-width: 599px) {
  .queens-game-screen {
    padding: 12px 14px 60px;
    gap: 12px;
  }

  .queens-topbar-title {
    font-size: 22px;
  }

  .queens-timer {
    font-size: 18px;
  }

  .queens-difficulty {
    font-size: 13px;
    padding: 5px 12px;
  }

  .queens-control-btn {
    font-size: 16px;
  }

  .queens-accordion-header {
    font-size: 16px;
    padding: 14px 18px;
  }
}
