:root {
  --ink: #172033;
  --muted: #7c8496;
  --panel: rgba(247, 249, 255, 0.88);
  --primary: #5361aa;
  --primary-dark: #323b7d;
  --mint: #62c68d;
  --warning: #ffb33f;
  --danger: #ee6a91;
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #111827;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

button,
.hud-card,
.tutorial-banner,
.task-sticky,
.skip-button,
.solution-button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud-card,
.status-card,
.stats-card,
.panel-button,
.dpad,
.stance-button,
.look-zone,
.draw-card,
.success-card {
  position: fixed;
  z-index: 2;
}

.hud-card {
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 12px;
  background: rgba(246, 248, 255, 0.86);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.portrait {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--danger));
  font-weight: 950;
  font-size: 24px;
  overflow: hidden;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.portrait-stack {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, 1fr);
}

.portrait-stack img {
  min-width: 0;
  border-radius: 0;
}

.portrait-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #fff;
  font-weight: 950;
  font-size: 20px;
}

.status-card[hidden],
.stats-card[hidden],
.panel-button[hidden] {
  display: none !important;
}

.hud-card strong,
.status-card strong {
  display: block;
  font-weight: 950;
}

.hud-card p {
  margin: 3px 0 0;
  color: #4f586a;
  font-size: 14px;
  line-height: 1.35;
}

.status-card {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  min-width: 154px;
  border-radius: 20px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(23, 32, 51, 0.74);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.status-card span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.stats-card {
  position: fixed;
  z-index: 3;
  top: calc(max(16px, env(safe-area-inset-top)) + 92px);
  left: max(16px, env(safe-area-inset-left));
  width: min(300px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(166, 75, 255, 0.38);
  border-radius: 14px;
  color: #fff;
  background: rgba(18, 22, 38, 0.84);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}

.stats-card strong {
  color: #d9c5ff;
  font-size: 12px;
}

.stats-card pre {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font: 700 11px/1.45 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.panel-button {
  right: max(18px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  min-width: 118px;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 950;
  box-shadow: 0 0 0 0 rgba(98, 198, 141, 0.55);
  opacity: 0.45;
}

.panel-button.ready {
  opacity: 1;
  animation: pulse 1.1s infinite;
}

.panel-button:disabled {
  pointer-events: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(98, 198, 141, 0.58);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(98, 198, 141, 0);
  }
}

.dpad {
  left: max(18px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 8px;
}

.dpad button,
.draw-actions button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  color: #fff;
  background: rgba(23, 32, 51, 0.68);
  font: inherit;
  font-weight: 950;
  backdrop-filter: blur(12px);
}

.dpad button[data-move="forward"] {
  grid-column: 2;
}

.dpad button[data-move="left"] {
  grid-column: 1;
  grid-row: 2;
}

.dpad button[data-move="backward"] {
  grid-column: 2;
  grid-row: 3;
}

.dpad button[data-move="right"] {
  grid-column: 3;
  grid-row: 2;
}

.stance-button {
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 186px);
  min-width: 110px;
  min-height: 56px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  color: #fff;
  background: rgba(23, 32, 51, 0.68);
  backdrop-filter: blur(12px);
  font: inherit;
  font-weight: 950;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.stance-button:hover {
  transform: translateY(-1px);
}

.stance-button.crouched {
  color: #1d1233;
  border-color: rgba(166, 75, 255, 0.6);
  background: linear-gradient(135deg, #ede4f8, #c8b3ec);
  box-shadow: 0 12px 28px rgba(166, 75, 255, 0.32);
}

.look-zone {
  right: 0;
  top: 0;
  width: 45vw;
  height: 100vh;
  pointer-events: none;
}

.look-zone span {
  position: absolute;
  right: 20px;
  top: 50%;
  color: rgba(255, 255, 255, 0.34);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.draw-overlay,
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 15, 28, 0.72);
  backdrop-filter: blur(12px);
}

.draw-overlay[hidden],
.success-overlay[hidden] {
  display: none !important;
}

.draw-card,
.success-card {
  position: static;
  width: min(760px, 100%);
  border-radius: 30px;
  padding: clamp(20px, 4vw, 34px);
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.draw-card h1,
.success-card h1 {
  margin: 0 0 8px;
  font-size: clamp(38px, 8vw, 72px);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.draw-card p,
.success-card span {
  color: var(--muted);
  font-weight: 800;
}

#drawCanvas {
  display: block;
  width: 100%;
  max-height: 46vh;
  margin: 18px 0;
  border: 1px solid #d2d8e7;
  border-radius: 24px;
  background: #fff;
  touch-action: none;
}

.draw-actions {
  display: flex;
  gap: 10px;
}

.draw-actions button {
  min-height: 48px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
}

#drawStatus.good {
  color: #1a7b45;
}

#drawStatus.bad {
  color: #b13b43;
}

.success-card {
  text-align: center;
}

.success-card p {
  margin: 0 0 10px;
  color: var(--mint);
  font-weight: 950;
  letter-spacing: 0.16em;
}

@media (max-width: 720px) {
  .status-card {
    top: auto;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(28px, env(safe-area-inset-bottom)) + 72px);
  }

  .dpad {
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
  }
}

/* Puzzle atla + ayrı çözümü göster butonları */
.skip-button,
.solution-button {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 70px);
  right: max(16px, env(safe-area-inset-right));
  z-index: 3;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  background: rgba(23, 32, 51, 0.74);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.solution-button {
  top: calc(max(16px, env(safe-area-inset-top)) + 116px);
  color: #172033;
  border-color: rgba(255, 227, 122, 0.42);
  background: rgba(255, 227, 122, 0.88);
}
.skip-button:hover {
  background: rgba(83, 97, 170, 0.85);
}
.solution-button:hover {
  background: rgba(255, 235, 157, 0.96);
}
.solution-button.guidance-cue {
  animation: solutionGuidancePulse 1s infinite;
}
@keyframes solutionGuidancePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 227, 122, 0.78); }
  70% { box-shadow: 0 0 0 16px rgba(255, 227, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 227, 122, 0); }
}
.skip-button.disabled,
.skip-button:disabled,
.solution-button:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
@media (max-width: 720px) {
  .skip-button,
  .solution-button {
    top: calc(max(16px, env(safe-area-inset-top)) + 70px);
    font-size: 12px;
  }
}
@media (max-width: 720px) and (orientation: portrait) {
  .skip-button {
    /* Alt kontrolleri ve görev çipini açık bırak: HUD/status altına istifle. */
    top: calc(max(16px, env(safe-area-inset-top)) + 180px);
    right: max(16px, env(safe-area-inset-right));
    bottom: auto;
    font-size: 12px;
    padding: 7px 12px;
    min-height: 34px;
  }
  .solution-button {
    top: calc(max(16px, env(safe-area-inset-top)) + 222px);
    right: max(16px, env(safe-area-inset-right));
    bottom: auto;
    font-size: 12px;
    padding: 7px 12px;
    min-height: 34px;
  }
}

/* Tutorial banner — üst, 5sn auto-hide veya manuel kapat */
.tutorial-banner {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 64px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(480px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, rgba(94, 58, 142, 0.92), rgba(212, 83, 126, 0.88));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  backdrop-filter: blur(10px);
}
.tutorial-banner.visible {
  opacity: 1;
  pointer-events: auto;
}
.tutorial-banner[hidden] {
  display: none;
}
.tutorial-icon {
  flex-shrink: 0;
  font-size: 18px;
}
.tutorial-text {
  flex: 1 1 auto;
}
.tutorial-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease;
}
.tutorial-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* Alt sticky görev metni */
.task-sticky {
  position: fixed;
  left: 50%;
  bottom: calc(max(28px, env(safe-area-inset-bottom)) + 100px);
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(23, 32, 51, 0.74);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 240ms ease;
  backdrop-filter: blur(10px);
}
.task-sticky.visible {
  opacity: 1;
}
.task-sticky[hidden] {
  display: none;
}
.task-label {
  color: rgba(166, 75, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

/* Doğru karoda çömelme yönlendirmesi */
@keyframes alignmentPulse {
  0% { box-shadow: 0 0 0 0 rgba(166, 75, 255, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(166, 75, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(166, 75, 255, 0); }
}
.stance-button.alignment-cue {
  animation: alignmentPulse 1s infinite;
  border-color: rgba(166, 75, 255, 0.7);
}

@media (max-width: 720px) and (orientation: portrait) {
  .tutorial-banner {
    /* Karakter kartının altında ayrı bir satır; üst üste binmez. */
    top: calc(max(16px, env(safe-area-inset-top)) + 94px);
    width: calc(100vw - 24px);
    padding: 10px 12px;
    font-size: 13px;
  }
  .task-sticky {
    bottom: calc(max(28px, env(safe-area-inset-bottom)) + 86px);
    font-size: 12px;
    padding: 7px 12px;
  }

  body.puzzle-1-active .task-sticky {
    bottom: calc(max(28px, env(safe-area-inset-bottom)) + 228px);
  }
}

/* Transition fade */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s linear;
}
.transition-overlay[hidden] {
  display: none;
}
.loading-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.06em;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.loading-hint[hidden] {
  display: none;
}

/* Sarnıç UI */
.sarnic-ui {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.sarnic-ui[hidden] {
  display: none;
}
.ayna-container {
  position: absolute;
  right: 24px;
  bottom: 100px;
  width: 260px;
  height: 96px;
  border: 1px dashed rgba(141, 204, 255, 0.5);
  border-radius: 12px;
  background: rgba(14, 28, 43, 0.5);
  box-shadow: inset 0 0 28px rgba(52, 139, 218, 0.12);
  pointer-events: auto;
}
.ayna-rect {
  position: absolute;
  left: 83px;
  top: 18px;
  display: flex;
  width: 94px;
  height: 60px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(220, 243, 255, 0.8);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, rgba(166, 222, 255, 0.96), rgba(34, 102, 170, 0.96));
  box-shadow: 0 8px 24px rgba(60, 150, 255, 0.62), inset 0 1px rgba(255, 255, 255, 0.75);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}
.ayna-rect:active {
  cursor: grabbing;
}

.ayna-rect.dragging {
  border-color: #fff;
  box-shadow: 0 0 0 5px rgba(105, 185, 255, 0.24), 0 10px 30px rgba(60, 150, 255, 0.8);
}

.ayna-rect.guidance-cue {
  animation: mirrorGuidancePulse 1.15s ease-in-out infinite;
}

@keyframes mirrorGuidancePulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(60, 150, 255, 0.52), inset 0 1px rgba(255, 255, 255, 0.75); }
  50% { box-shadow: 0 0 0 8px rgba(81, 165, 255, 0.12), 0 10px 34px rgba(60, 150, 255, 0.94), inset 0 1px rgba(255, 255, 255, 0.9); }
}

.ayna-icon {
  position: relative;
  width: 17px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 3px;
  background: linear-gradient(135deg, #eefaff 0 38%, #7bc6f4 40% 57%, #dff6ff 59% 100%);
  box-shadow: 0 2px 8px rgba(0, 25, 60, 0.55), inset 0 0 5px rgba(255, 255, 255, 0.8);
  transform: perspective(30px) rotateY(-8deg);
}

.ayna-label {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .ayna-container {
    right: 16px;
    width: 230px;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  body.puzzle-2-active .ayna-container {
    left: 50%;
    right: auto;
    bottom: calc(max(28px, env(safe-area-inset-bottom)) + 130px);
    width: min(330px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
}

/* Puzzle 3 placeholder */
.puzzle3-placeholder {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(66, 232, 224, 0.12), transparent 34%),
    linear-gradient(180deg, #03070b, #08111a);
}
.puzzle3-placeholder[hidden] {
  display: none;
}
.puzzle3-card {
  width: min(620px, 100%);
  border: 1px solid rgba(66, 232, 224, 0.25);
  border-radius: 26px;
  padding: clamp(30px, 6vw, 52px);
  text-align: center;
  color: #fff;
  background: rgba(7, 14, 22, 0.91);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62), 0 0 48px rgba(66, 232, 224, 0.08);
  backdrop-filter: blur(18px);
}
.puzzle3-card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: -0.035em;
}
.puzzle3-card p {
  margin: 0 0 30px;
  color: rgba(225, 244, 246, 0.72);
  font-weight: 700;
  line-height: 1.5;
}
.final-kicker {
  display: block;
  margin-bottom: 14px;
  color: #42e8e0;
  font: 800 12px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.24em;
}
.puzzle3-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.puzzle3-card button,
.puzzle3-card .puzzle3-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.puzzle3-card button:hover,
.puzzle3-card .puzzle3-link:hover {
  transform: translateY(-1px);
}
.puzzle3-card button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.puzzle3-card button:hover {
  background: rgba(255, 255, 255, 0.2);
}
.puzzle3-card .puzzle3-link {
  background: var(--primary);
}
.puzzle3-card .puzzle3-link:hover {
  background: #6878c0;
}
.puzzle3-card .puzzle3-book[hidden] {
  display: none !important;
}
@media (max-width: 480px) {
  .puzzle3-actions {
    flex-direction: column;
  }
  .puzzle3-card button,
  .puzzle3-card .puzzle3-link {
    width: 100%;
  }
}

/* Mobile portrait UI sıkıştırma — puzzle 1 koridoru için */
@media (max-width: 720px) and (orientation: portrait) {
  .hud-card {
    padding: 10px;
    gap: 10px;
  }

  .status-card {
    /* Sağ-alt panel-button çakışmasını ortadan kaldır: sol-üst HUD altına taşı */
    top: calc(max(16px, env(safe-area-inset-top)) + 96px);
    left: max(16px, env(safe-area-inset-left));
    right: auto;
    bottom: auto;
    min-width: 0;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(83, 71, 132, 0.62);
    font-size: 13px;
  }

  .status-card span {
    font-size: 11px;
  }

  .stance-button {
    bottom: calc(max(24px, env(safe-area-inset-bottom)) + 158px);
    min-width: 88px;
    min-height: 48px;
    padding: 0 16px;
    font-size: 14px;
  }

  .dpad {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
  }
}

/* ===== Reveal cinematic overlay (Faz F — sahne arkada, DOM üstte) ===== */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.reveal-overlay.interactive {
  pointer-events: auto;
  cursor: pointer;
}
.reveal-overlay[hidden] {
  display: none;
}

/* Faz F: fade-to-black sahne swap (3.0sn) */
.reveal-fade {
  position: absolute;
  inset: 0;
  z-index: 250;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}
.reveal-fade.active {
  opacity: 1;
}

/* Diyalog overlay — 3D sahne üstünde merkez-alt */
.reveal-dialog {
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
  width: min(760px, calc(100vw - 48px));
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 16, 30, 0.78), rgba(8, 12, 22, 0.84));
  border: 1px solid rgba(102, 204, 255, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(68, 136, 204, 0.18);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 400ms ease;
}
.reveal-dialog.visible {
  opacity: 1;
}
.reveal-dialog-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(102, 204, 255, 0.45);
  box-shadow: 0 0 12px rgba(68, 136, 204, 0.4);
  background: rgba(20, 30, 50, 0.6);
}
.reveal-dialog-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.reveal-name {
  font: 600 24px "Inter", "Avenir Next", "Nunito Sans", sans-serif;
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px currentColor;
}
.reveal-name .reveal-name-suffix {
  margin-left: 8px;
  color: rgba(200, 220, 240, 0.55);
  font-style: italic;
  font-weight: 400;
  font-size: 0.7em;
  letter-spacing: 0.02em;
  text-shadow: none;
}
.reveal-line {
  font: 300 italic 30px "Inter", "Avenir Next", "Nunito Sans", sans-serif;
  color: #f0f4f8;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.reveal-advance {
  align-self: flex-end;
  margin-top: 4px;
  color: rgba(137, 238, 233, 0.72);
  font: 700 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: revealAdvancePulse 1.4s ease-in-out infinite;
}
.reveal-advance[hidden] {
  display: none;
}
@keyframes revealAdvancePulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.reveal-line.whisper {
  font-size: 22px;
  opacity: 0.85;
  letter-spacing: 0.05em;
}

@media (max-width: 720px) and (orientation: portrait) {
  .reveal-dialog {
    top: auto;
    bottom: max(28px, env(safe-area-inset-bottom));
    transform: translate(-50%, 0);
    width: calc(100vw - 24px);
    padding: 12px 14px;
    gap: 14px;
  }
  .reveal-dialog-avatar { width: 48px; height: 48px; }
  .reveal-name { font-size: 18px; }
  .reveal-line { font-size: 22px; }
  .reveal-line.whisper { font-size: 17px; }
}

/* Body class durum yönetimi — skip-button KALDI (puzzle 2/3'te de görünür olmalı) */
body.puzzle-2-active .dpad,
body.puzzle-2-active .stance-button,
body.puzzle-2-active .panel-button,
body.puzzle-2-active .look-zone,
body.puzzle-2-active .status-card {
  display: none !important;
}
body.puzzle-1-active .sarnic-ui {
  display: none !important;
}
body.puzzle-3-active .dpad,
body.puzzle-3-active .stance-button,
body.puzzle-3-active .panel-button,
body.puzzle-3-active .look-zone,
body.puzzle-3-active .sarnic-ui {
  display: none !important;
}
body.final-active .hud-card,
body.final-active .status-card,
body.final-active .stats-card,
body.final-active .skip-button,
body.final-active .solution-button,
body.final-active .tutorial-banner,
body.final-active .task-sticky,
body.final-active .dpad,
body.final-active .stance-button,
body.final-active .panel-button,
body.final-active .look-zone,
body.final-active .sarnic-ui {
  display: none !important;
}
