/* =========================================================
   PXE Stüdyo — dart görünümü (js/views-dart.js)
   Ahşap lambri duvar, mantar panoda dart tahtası (canvas),
   yanında ahşap çerçeveli tebeşir tahtası gibi skor paneli.
   Bütün sınıflar "dt-" ile başlar.
   ========================================================= */

.dt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(290px, 26vw, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(14px, 2.2vw, 32px);
  padding: 72px clamp(16px, 3vw, 44px) clamp(16px, 2.4vw, 32px);
  background: #26170D;
  overflow: hidden;
}

/* ---------- Duvar: ahşap lambri + lamba ışığı ---------- */
.dt-wall {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 58% at 38% 46%, rgba(255, 196, 120, .22), rgba(255, 196, 120, 0) 72%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 134px, rgba(10, 5, 2, .75) 134px 137px, rgba(255, 214, 160, .07) 137px 138px, rgba(0, 0, 0, 0) 138px 140px),
    repeating-linear-gradient(90deg, rgba(255, 220, 170, .045) 0 140px, rgba(0, 0, 0, .07) 140px 280px, rgba(255, 220, 170, 0) 280px 420px),
    repeating-linear-gradient(90deg, rgba(255, 226, 180, .035) 0 2px, rgba(0, 0, 0, .05) 2px 5px, rgba(255, 226, 180, .02) 5px 9px, rgba(0, 0, 0, .06) 9px 14px, rgba(255, 226, 180, .03) 14px 17px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, rgba(0, 0, 0, 0) 1px 23px),
    repeating-linear-gradient(90deg, rgba(255, 230, 190, .03) 0 1px, rgba(0, 0, 0, 0) 1px 31px),
    linear-gradient(180deg, #5B3A21 0%, #43291A 55%, #2C1A0F 100%);
}
/* Süpürgelik */
.dt-wall::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8%;
  background: linear-gradient(180deg, #1F130B, #140C07);
  box-shadow: 0 -2px 0 rgba(255, 214, 160, .08), 0 -10px 24px rgba(0, 0, 0, .35);
}
/* Köşelere doğru kararan oda */
.dt-wall::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 85% at 38% 46%, rgba(10, 6, 3, 0) 35%, rgba(10, 6, 3, .8) 100%);
}

/* ---------- Sahne: tahta (canvas) ---------- */
.dt-stage {
  position: relative; z-index: 1; min-width: 0; min-height: 0;
  border-radius: 14px; outline: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.dt-stage:focus-visible { box-shadow: inset 0 0 0 2px rgba(225, 37, 27, .55); }
.dt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.dt-stage.is-aim .dt-canvas { cursor: none; }
.dt-stage.is-pause .dt-canvas { cursor: pointer; }

/* İlk atışa kadar görünen ipucu */
.dt-tip {
  position: absolute; left: 50%; bottom: 10px; z-index: 1;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px); text-align: center;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(14, 13, 12, .62); border: 1px solid var(--line-d);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 400 10.5px/1.35 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.dt-tip.is-gone { opacity: 0; transform: translate(-50%, 8px); }

/* 301 bitince */
.dt-over {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(14, 13, 12, .3), rgba(14, 13, 12, .7));
  border-radius: 14px;
  animation: dtFade .6s var(--ease) both;
}
.dt-over[hidden] { display: none; }
.dt-over-in {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  max-width: min(380px, 100%); padding: 24px 26px 22px; border-radius: 18px;
  background: rgba(14, 13, 12, .9); border: 1px solid var(--line-d);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  animation: dtPop .6s var(--ease) both;
}
.dt-over-n { font: 800 clamp(2.4rem, 5vw, 3.8rem)/1 var(--f-display); letter-spacing: -.05em; color: var(--red); }
.dt-over-t { font-size: 14px; line-height: 1.5; opacity: .82; max-width: 32ch; }
.dt-over .btn { margin-top: 6px; }

/* ---------- Skor paneli: ahşap çerçeveli tebeşir tahtası ---------- */
.dt .dt-panel {
  position: relative; z-index: 1; align-self: center;
  max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(16px, 1.8vw, 24px);
  background:
    radial-gradient(ellipse 70% 40% at 25% 12%, rgba(242, 238, 231, .06), rgba(242, 238, 231, 0) 70%),
    radial-gradient(ellipse 60% 35% at 80% 88%, rgba(242, 238, 231, .045), rgba(242, 238, 231, 0) 70%),
    #191B1A;
  border: 9px solid #4B2F1B;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 50px rgba(0, 0, 0, .45),
    0 0 0 1px rgba(255, 214, 160, .1), 0 30px 70px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  scrollbar-width: thin; scrollbar-color: rgba(242, 238, 231, .2) transparent;
}
.dt-title { font-size: clamp(1.4rem, 2.2vw, 2rem); margin: 8px 0 14px; }

.dt-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-modes .chip { color: var(--paper); }

.dt-score {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-bottom: 12px;
  border-bottom: 1px dashed rgba(242, 238, 231, .18);
}
.dt-big small, .dt-turn small {
  display: block; margin-bottom: 6px;
  font: 400 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; opacity: .55;
}
.dt-big b {
  display: block; transform-origin: left bottom;
  font: 800 clamp(2.8rem, 5.2vw, 4.4rem)/.9 var(--f-display); letter-spacing: -.05em;
  color: #F6F1E8; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 1px rgba(242, 238, 231, .5), 0 0 14px rgba(242, 238, 231, .08);
}
.dt-big b.is-bump { animation: dtBump .45s var(--ease); }
.dt-turn { text-align: right; }
.dt-turn b { font: 800 26px/1 var(--f-display); letter-spacing: -.03em; color: var(--red); }

/* Turun üç oku: renk şeridi tahtadaki kanat rengiyle aynı */
.dt-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.dt-slot {
  display: grid; align-content: start; gap: 6px; min-width: 0; min-height: 76px;
  padding: 9px 10px 10px;
  border: 1px dashed rgba(242, 238, 231, .2); border-radius: 10px;
  transition: border-color .3s, background .3s;
}
.dt-slot i {
  display: flex; align-items: center; gap: 6px;
  font: 400 9.5px/1 var(--f-mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; opacity: .55;
}
.dt-slot i::before { content: ""; flex: none; width: 12px; height: 5px; border-radius: 1px 3px 3px 1px; background: var(--c, var(--red)); }
.dt-slot b { font: 800 clamp(15px, 1.35vw, 19px)/1 var(--f-display); letter-spacing: -.04em; white-space: nowrap; }
.dt-slot small { min-height: 1.25em; font: 400 9.5px/1.25 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.dt-slot.is-hit { border-style: solid; border-color: rgba(242, 238, 231, .28); background: rgba(242, 238, 231, .05); animation: dtSlot .45s var(--ease); }
.dt-slot.is-miss b { opacity: .45; }
.dt-slot.is-next { border-color: rgba(225, 37, 27, .85); }
.dt-slot.is-next i { opacity: 1; }

.dt-sum {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px;
  font: 400 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
}
.dt-sum span { opacity: .6; }
.dt-sum b { font: 800 22px/1 var(--f-display); letter-spacing: -.03em; }
.dt-sum b.is-bust { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }

.dt-out {
  margin-top: 10px; padding: 10px 12px; min-height: 42px; border-radius: 10px;
  background: rgba(242, 238, 231, .05);
  font-size: 13.5px; line-height: 1.45;
}
.dt-out b { color: #E2B33C; font-family: var(--f-mono); font-weight: 700; }
.dt-skip { opacity: .55; font-size: 12px; }

.dt-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font: 400 11px/1.5 var(--f-mono); opacity: .8; }
.dt-stats span { white-space: nowrap; }
.dt-stats b { color: var(--paper); font-weight: 700; }

/* Tur geçmişi */
.dt-hist-k {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 16px;
  font: 400 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; opacity: .55;
}
.dt-hist {
  margin-top: 8px; max-height: 172px; overflow-y: auto;
  border-top: 1px solid rgba(242, 238, 231, .12);
  scrollbar-width: thin; scrollbar-color: rgba(242, 238, 231, .2) transparent;
}
.dt-hist li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid rgba(242, 238, 231, .08);
  font: 400 12px/1.35 var(--f-mono);
}
.dt[data-mode="free"] .dt-hist li { grid-template-columns: 24px minmax(0, 1fr) auto; }
.dt-hist li b { font-size: 10px; color: var(--red); }
.dt-hist li span { opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-hist li em { min-width: 34px; text-align: right; font-style: normal; font-weight: 700; }
.dt-hist li small { min-width: 32px; text-align: right; font-size: 11px; opacity: .5; }
.dt-hist li.is-bust em { color: var(--red); }
.dt-hist li.is-bust span { text-decoration: line-through; opacity: .45; }
.dt-hist li.is-empty { display: block; font-size: 11.5px; opacity: .5; }
.dt-hist li:first-child:not(.is-empty) { animation: dtSlot .45s var(--ease); }

.dt-rules { margin-top: 14px; font-size: 12.5px; line-height: 1.5; opacity: .68; }
.dt-rules b { color: var(--red); }
.dt-rules i { font-style: normal; color: #E2B33C; }
.dt-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dt-act .btn { height: 40px; padding: 0 18px; font-size: 11px; }
.dt-keys { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 14px; font: 400 10.5px/2 var(--f-mono); opacity: .5; }
.dt-keys span { white-space: nowrap; }
.dt-keys kbd { margin-right: 4px; }
@media (pointer: coarse) { .dt-keys { display: none; } }

@keyframes dtBump { from { transform: scale(1.1); color: #E2B33C; } }
@keyframes dtSlot { from { transform: translateY(6px); background: rgba(226, 179, 60, .2); } }
@keyframes dtFade { from { opacity: 0; } }
@keyframes dtPop { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- Orta genişlik ---------- */
@media (max-width: 1100px) and (min-width: 861px) {
  .dt { grid-template-columns: minmax(0, 1fr) 290px; }
  .dt-big b { font-size: 2.8rem; }
}
@media (max-height: 720px) and (min-width: 861px) {
  .dt-title { display: none; }
  .dt-score { margin-top: 12px; }
  .dt-hist { max-height: 120px; }
}

/* ---------- Mobil: tahta üstte, skor altta (sayfa kayar) ---------- */
@media (max-width: 860px) {
  .dt {
    grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: start;
    gap: 14px; padding: 66px 12px 20px;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .dt-wall { position: fixed; }
  .dt-wall::after { background: radial-gradient(ellipse 90% 70% at 50% 34%, rgba(10, 6, 3, 0) 35%, rgba(10, 6, 3, .8) 100%); }
  .dt-stage {
    height: min(100vw, calc(100vh - 290px));
    height: min(100vw, calc(100dvh - 290px));
    min-height: 300px;
  }
  .dt .dt-panel { align-self: start; max-height: none; overflow: visible; border-width: 7px; }
  .dt-title { display: none; }
  .dt-score { margin-top: 12px; }
  .dt-big b { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .dt-slot b { font-size: 18px; }
  .dt-hist { max-height: none; }
}
