:root {
  --ink: #2e1d12;
  --cream: #f6e6bd;
  --gold: #e3b65c;
  --wine: #7f2928;
  --good: #56d58a;
  --danger: #ff786d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #140e0a;
}

body {
  color: #fff7df;
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid #fff0a6;
  outline-offset: 3px;
}

.home-shell {
  min-height: 100vh;
  padding: 38px clamp(18px, 4vw, 68px) 70px;
  background:
    radial-gradient(circle at 77% 5%, #c58c3d33, transparent 28%),
    linear-gradient(#1f150fef, #100b08f7),
    url("sahneler/antik-oda/assets/antik-oda-hq.webp") center / cover fixed;
}

.home-header {
  width: min(1240px, 100%);
  margin: 0 auto 28px;
}

.home-header p,
.section-heading small,
.difficulty-card small {
  margin: 0;
  color: #d8b169;
  font: 700 12px Arial, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.home-header h1 {
  margin: 6px 0 4px;
  color: #fff0bd;
  font-size: clamp(42px, 7vw, 78px);
  line-height: .95;
  text-shadow: 0 5px 18px #000b;
}

.home-header > span {
  color: #d7c6a7;
  font: 16px/1.6 Arial, sans-serif;
}

.difficulty-card {
  width: min(1240px, 100%);
  margin: 0 auto 32px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #8b6236;
  border-radius: 18px;
  background: #1a110dcc;
  box-shadow: 0 15px 45px #0008;
  backdrop-filter: blur(10px);
}

.difficulty-card h2,
.section-heading h2 {
  margin: 5px 0 3px;
  color: #fff0c7;
  font-size: clamp(23px, 3vw, 34px);
}

.difficulty-card p {
  margin: 0;
  color: #bda98b;
  font: 14px/1.5 Arial, sans-serif;
}

.difficulty-options {
  display: flex;
  gap: 8px;
}

.difficulty-options button {
  min-width: 105px;
  padding: 11px 17px;
  border: 1px solid #77512c;
  border-radius: 12px;
  color: #e8d6ae;
  background: #100a07b8;
  cursor: pointer;
  transition: .2s ease;
}

.difficulty-options button:hover,
.difficulty-options button.selected {
  border-color: #f0c76f;
  color: #2d1b0e;
  background: linear-gradient(#ffe9aa, #d49c43);
  transform: translateY(-2px);
}

.difficulty-options strong,
.difficulty-options span {
  display: block;
}

.difficulty-options span {
  margin-top: 3px;
  font: 12px Arial, sans-serif;
  opacity: .78;
}

.scene-section {
  width: min(1240px, 100%);
  margin: auto;
}

.fresh-scenes {
  margin-top: 42px;
}

.section-heading {
  margin-bottom: 15px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
}

.section-heading > span {
  padding: 8px 12px;
  border: 1px solid #876038;
  border-radius: 18px;
  color: #eed39a;
  background: #1b120dcc;
  font: 12px Arial, sans-serif;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.scene-card {
  display: block;
  min-height: 230px;
  padding: 0;
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid #8a6035;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  background: #2a1a12;
  cursor: pointer;
  box-shadow: 0 12px 30px #0008;
  transition: transform .2s ease, border-color .2s ease;
}

.scene-card:not(.locked):hover {
  z-index: 2;
  border-color: #f0c66e;
  transform: translateY(-4px);
}

.scene-card img,
.scene-placeholder {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.scene-placeholder {
  display: grid;
  place-items: center;
  color: #6b482c;
  font-size: 70px;
  background:
    linear-gradient(135deg, #39251a, #16100c),
    repeating-linear-gradient(45deg, transparent 0 15px, #ffffff05 16px 17px);
}

.scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #100907ed 0 33%, #1009078a 55%, #10090722);
}

.scene-number {
  position: absolute;
  right: 18px;
  top: 13px;
  color: #ffe4a8;
  font-size: 32px;
  opacity: .75;
}

.scene-copy {
  width: min(66%, 430px);
  position: absolute;
  left: 24px;
  bottom: 22px;
}

.scene-copy h3 {
  margin: 0 0 8px;
  color: #fff0c5;
  font-size: clamp(22px, 3vw, 31px);
}

.scene-copy p {
  margin: 0 0 13px;
  color: #d3c1a2;
  font: 13px/1.45 Arial, sans-serif;
}

.scene-copy em {
  color: #f0c872;
  font: 700 12px Arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.scene-card.locked {
  cursor: not-allowed;
  filter: saturate(.3);
  opacity: .7;
}

.scene-best {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 6px 9px;
  border: 1px solid #e3b65c88;
  border-radius: 999px;
  color: #fff1c7;
  background: #160f0bdb;
  font: 700 11px Arial, sans-serif;
}

.game-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #17100c;
}

.game-topbar {
  min-height: 78px;
  padding: 11px clamp(12px, 2.5vw, 28px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 50;
  border-bottom: 2px solid #67431f;
  background: linear-gradient(180deg, #332218, #1e140e);
  box-shadow: 0 5px 18px #0009;
}

.back-button {
  padding: 9px 12px;
  border: 1px solid #765129;
  border-radius: 9px;
  color: #efd79d;
  background: #120c08a8;
  cursor: pointer;
}

.game-title small {
  display: block;
  color: #d9b66b;
  font: 11px Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.game-title strong {
  color: #fff1bd;
  font-size: clamp(20px, 2.5vw, 30px);
}

.stats {
  display: flex;
  gap: 8px;
}

.stats > div {
  min-width: 96px;
  padding: 6px 12px;
  text-align: center;
  border: 1px solid #86602e;
  border-radius: 10px;
  background: #110c08aa;
}

.stats span,
.result-stats span {
  display: block;
  color: #d5b66f;
  font: 10px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stats b {
  color: #fff;
  font-size: 20px;
}

.stats b.danger {
  color: var(--danger);
}

.game-area {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  position: relative;
}

.scene-viewport {
  min-width: 0;
  position: relative;
  overflow: hidden;
  align-self: start;
  aspect-ratio: 1672 / 941;
  touch-action: none;
  cursor: crosshair;
  background: #100a06;
}

.scene-viewport.dragging,
.scene-viewport.dragging .room-scene,
.scene-viewport.dragging .hidden-object {
  cursor: grabbing !important;
}

.room-scene {
  width: 100%;
  aspect-ratio: 1672 / 941;
  position: relative;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  cursor: crosshair;
  user-select: none;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.room-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, #10080538 100%);
}

.hidden-object {
  min-width: 0;
  min-height: 0;
  padding: 0;
  position: absolute;
  z-index: 7;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: crosshair;
}

.hidden-object.active:not(.found) {
  z-index: 9;
  cursor: pointer;
}

.hidden-object.found {
  pointer-events: none;
}

.hidden-object.found.just-found {
  z-index: 20;
  overflow: visible;
  isolation: isolate;
}

.hidden-object.found.just-found::before {
  content: "";
  width: var(--aura-size, 58px);
  aspect-ratio: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  border: 2px solid #fff2a8;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8bdcc 0 8%, #ffd74d66 28%, #ffba2e20 55%, transparent 72%);
  box-shadow: 0 0 12px #fff1a8, 0 0 26px #ffd348, 0 0 42px #ff9f2e;
  z-index: 1;
  pointer-events: none;
  animation: found-aura 1.8s ease-out forwards;
}

.hidden-object.found::after {
  content: "✓";
  width: var(--marker-size, 14px);
  aspect-ratio: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #fff4b8;
  border-radius: 50%;
  color: #fff;
  background: #238b58e8;
  box-shadow: 0 0 0 1px #48de8740, 0 1px 3px #000a;
  font: 700 var(--marker-font, 9px) Arial, sans-serif;
  z-index: 3;
  animation: found-pop .55s ease-out forwards;
}

@keyframes found-aura {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.25); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  55% { opacity: .9; transform: translate(-50%, -50%) scale(1.28); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.85); }
}

@keyframes found-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  48% { opacity: 1; transform: translate(-50%, -50%) scale(1.45); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.hidden-object.hint {
  border: 3px solid #fff3a0;
  filter: drop-shadow(0 0 8px #ffd447) drop-shadow(0 0 15px #fff);
  animation: hint-ring .65s infinite alternate;
}

@keyframes hint-ring {
  from { transform: scale(.82); box-shadow: 0 0 0 2px #fff3a055; }
  to { transform: scale(1.22); box-shadow: 0 0 0 12px #fff3a015; }
}

.scene-controls {
  position: absolute;
  left: 10px;
  bottom: 12px;
  z-index: 35;
  display: flex;
  gap: 7px;
}

.scene-controls button,
.list-toggle,
.close-list {
  border: 1px solid #d6ad61;
  color: #fff5d4;
  background: #24170ee8;
  box-shadow: 0 4px 13px #0009;
  cursor: pointer;
}

.scene-controls button {
  width: 43px;
  height: 43px;
  padding: 0;
  border-radius: 50%;
  font: 700 22px Arial, sans-serif;
}

.list-toggle {
  display: none;
}

.desktop-guide {
  position: absolute;
  left: 50%;
  bottom: 66px;
  z-index: 30;
  padding: 8px 14px;
  border-radius: 20px;
  color: #fff6db;
  background: #160f0bd9;
  box-shadow: 0 4px 14px #0008;
  font: 13px Arial, sans-serif;
  pointer-events: none;
  transform: translateX(-50%);
  animation: desktop-guide-hide .5s ease 4s forwards;
}

@keyframes desktop-guide-hide {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.rotate-note {
  display: none;
}

@keyframes rotate-note-hide {
  0%, 78% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

.parchment-panel {
  padding: 34px 20px;
  color: #3a2415;
  background: linear-gradient(90deg, #24160f, #3c2819);
  box-shadow: -9px 0 20px #0008;
}

.parchment {
  min-height: 455px;
  padding: 34px 24px;
  position: sticky;
  top: 18px;
  border: 2px solid #bb823b;
  border-radius: 10px 4px 8px 12px;
  background:
    radial-gradient(circle at 12% 15%, #9b622321 0 2%, transparent 3%),
    radial-gradient(circle at 83% 77%, #9b622325 0 3%, transparent 4%),
    linear-gradient(100deg, #d5b36d, #f5e2ad 17%, #edd397 77%, #c89550);
  box-shadow: inset 0 0 23px #8c5e2b99, 0 8px 18px #0008;
}

.parchment::before,
.parchment::after {
  content: "";
  width: calc(100% + 18px);
  height: 24px;
  position: absolute;
  left: -9px;
  border-radius: 50%;
  background: linear-gradient(#b77b36, #efd59a 48%, #8e5829);
  box-shadow: 0 3px 6px #0007;
}

.parchment::before {
  top: -13px;
}

.parchment::after {
  bottom: -13px;
  transform: rotate(180deg);
}

.parchment h2 {
  margin: 2px 0 6px;
  text-align: center;
  font-size: 24px;
}

.parchment > p {
  margin: 0 0 17px;
  text-align: center;
  color: #765332;
  font: 12px Arial, sans-serif;
}

.parchment ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: targets;
}

.parchment li {
  counter-increment: targets;
  margin: 4px 0;
  padding: 8px 4px 8px 31px;
  position: relative;
  border-bottom: 1px dashed #8d653c77;
  font-size: 17px;
}

.parchment li::before {
  content: counter(targets) ".";
  position: absolute;
  left: 5px;
  color: #8a5b2c;
  font-weight: 700;
}

.parchment li.done {
  color: #7d6b54;
  opacity: .55;
  text-decoration: line-through 3px #7d2a20;
}

.hint-button {
  width: 100%;
  margin-top: 21px;
  padding: 12px 10px;
  border: 1px solid #68431f;
  border-radius: 8px;
  color: #fff2c7;
  background: linear-gradient(#674321, #3a2414);
  cursor: pointer;
}

.close-list {
  display: none;
}

.toast {
  max-width: calc(100% - 30px);
  padding: 11px 18px;
  position: fixed;
  left: 50%;
  top: 96px;
  z-index: 90;
  border-radius: 30px;
  background: #16110ef2;
  box-shadow: 0 7px 20px #0009;
  font: 700 14px Arial, sans-serif;
  transform: translateX(-50%);
}

.toast.good {
  color: var(--good);
  border: 1px solid #3e9d65;
}

.toast.bad {
  color: var(--danger);
  border: 1px solid #b6473f;
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0d0907df;
  backdrop-filter: blur(5px);
}

.result-card {
  width: min(500px, 100%);
  padding: 34px 27px;
  text-align: center;
  border: 2px solid #bf873c;
  border-radius: 18px;
  color: #f7e5b7;
  background: linear-gradient(145deg, #3c281a, #160e0a);
  box-shadow: 0 20px 70px #000;
}

.result-seal {
  width: 72px;
  height: 72px;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 34px;
  background: #8d2522;
  box-shadow: inset 0 0 0 7px #6f1617, 0 7px 12px #0007;
}

.result-card h2 {
  margin: 17px 0 8px;
  color: #ffe8a0;
  font-size: 34px;
}

.result-card p {
  color: #d8c7a7;
  font: 15px/1.55 Arial, sans-serif;
}

.result-stats {
  margin: 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.result-stats > div {
  padding: 11px;
  border: 1px solid #6c4927;
  border-radius: 10px;
  background: #0f0b08aa;
}

.result-stats b {
  color: #fff;
  font-size: 24px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-actions button {
  padding: 11px 18px;
  border: 0;
  border-radius: 9px;
  color: #2a1b0e;
  font-weight: 700;
  background: linear-gradient(#ffe29a, #c9943d);
  cursor: pointer;
}

.result-actions button.secondary {
  border: 1px solid #765129;
  color: #f2dbad;
  background: #1b120d;
}

@media (max-width: 800px) {
  html,
  body {
    overscroll-behavior: none;
  }

  body {
    overflow: hidden;
  }

  .home-shell {
    height: 100svh;
    overflow-y: auto;
    padding: 22px 14px 50px;
  }

  .difficulty-card {
    align-items: stretch;
    flex-direction: column;
  }

  .difficulty-options button {
    min-width: 0;
    flex: 1;
    padding-inline: 8px;
  }

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

  .scene-card {
    min-height: 205px;
  }

  .game-shell {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .game-topbar {
    min-height: 76px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .back-button {
    width: 39px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
  }

  .back-button::first-letter {
    font-size: 21px;
  }

  .game-title small {
    font-size: 9px;
  }

  .game-title strong {
    font-size: 18px;
  }

  .stats {
    gap: 4px;
  }

  .stats > div {
    min-width: 66px;
    padding: 5px 6px;
  }

  .stats > div:nth-child(3) {
    display: none;
  }

  .stats b {
    font-size: 16px;
  }

  .game-area {
    min-height: 0;
    height: calc(100svh - 76px);
    display: block;
    overflow: hidden;
  }

  .scene-viewport {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .scene-viewport::before {
    content: "";
    position: absolute;
    inset: -20px;
    opacity: .3;
    background-color: #100a06;
    background-image: var(--scene-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(13px) brightness(.55);
    transform: scale(1.08);
  }

  .room-scene {
    position: absolute;
    left: 0;
    top: 0;
  }

  .desktop-guide {
    display: none;
  }

  .rotate-note {
    display: block;
    position: absolute;
    left: 50%;
    top: 9px;
    z-index: 30;
    width: max-content;
    max-width: calc(100% - 20px);
    padding: 7px 12px;
    border: 1px solid #c99d54;
    border-radius: 18px;
    color: #fff3cd;
    background: #1d130de8;
    font: 12px Arial, sans-serif;
    pointer-events: none;
    transform: translateX(-50%);
    animation: rotate-note-hide .55s ease 4s forwards;
  }

  .list-toggle {
    min-height: 43px;
    padding: 8px 14px;
    position: absolute;
    right: 10px;
    bottom: 12px;
    z-index: 35;
    display: block;
    border-radius: 23px;
    font: 700 14px Arial, sans-serif;
  }

  .list-toggle b {
    min-width: 22px;
    height: 22px;
    margin-left: 4px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #25160c;
    background: #f4cf72;
  }

  .parchment-panel {
    width: min(390px, calc(100% - 20px));
    max-height: calc(100svh - 96px);
    padding: 25px 12px 18px;
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 70;
    overflow-y: auto;
    visibility: hidden;
    border-radius: 14px;
    background: #2b1c13ed;
    box-shadow: 0 15px 45px #000d;
    transform: translateY(calc(100% + 25px));
    transition: transform .28s ease, visibility .28s;
  }

  .parchment-panel.open {
    visibility: visible;
    transform: translateY(0);
  }

  .parchment {
    min-height: auto;
    position: static;
    padding: 25px 22px;
  }

  .parchment ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }

  .parchment li {
    font-size: 15px;
  }

  .close-list {
    width: 34px;
    height: 34px;
    padding: 0;
    position: absolute;
    right: 18px;
    top: 17px;
    z-index: 3;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font: 700 19px Arial, sans-serif;
  }
}

@media (max-width: 800px) and (orientation: landscape) {
  .rotate-note {
    display: none;
  }
}

@media (max-width: 520px) {
  .home-header h1 {
    font-size: 47px;
  }

  .home-header > span {
    font-size: 13px;
  }

  .difficulty-card {
    padding: 18px;
  }

  .scene-card {
    min-height: 190px;
  }

  .scene-copy {
    width: 78%;
    left: 18px;
    bottom: 17px;
  }

  .scene-copy p {
    display: none;
  }

  .game-topbar {
    min-height: 88px;
  }

  .game-area {
    height: calc(100svh - 88px);
  }

  .game-title strong {
    font-size: 15px;
  }

  .stats > div {
    min-width: 58px;
  }
}
