/* ==== Rift Anıları — Hextech tema ==== */
@font-face {
  font-family: 'Marcellus';
  src: url('assets/Marcellus.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #010a13;
  --panel: #0a1428;
  --panel2: #091428;
  --gold: #c8aa6e;
  --gold-bright: #f0e6d2;
  --gold-dim: #785a28;
  --cyan: #0ac8b9;
  --red: #e84057;
  --text: #a09b8c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

h1, h2 { font-family: 'Marcellus', 'Palatino Linotype', serif; color: var(--gold-bright); letter-spacing: 2px; }

/* ---- Harita ---- */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background:
    radial-gradient(ellipse at center, #06121f 0%, #010a13 75%);
}
#viewport.dragging { cursor: grabbing; }
#viewport.editing { cursor: crosshair; }

#world {
  position: absolute;
  width: 2048px;
  height: 2048px;
  transform-origin: 0 0;
  will-change: transform;
}
#mapimg {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#pinlayer { position: absolute; inset: 0; }

/* ---- Pin ---- */
.pin {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -50px 0 0 -22px; /* uç nokta tam koordinatta */
  transform-origin: 50% 114%;
  cursor: pointer;
  z-index: 2;
  transition: transform .12s ease-out;
}
.pin .drop {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1e2d50 0%, var(--panel) 60%);
  border: 2px solid var(--gold);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 12px rgba(0,0,0,.7), inset 0 0 8px rgba(200,170,110,.25);
}
.pin .drop::after {
  /* uç iğne noktası parlaması */
  content: '';
  position: absolute;
  left: -6px; bottom: -6px;
  width: 4px; height: 4px;
}
.pin .ico {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-2px);
}
.pin .ico .emoji {
  font-size: 22px;
  text-shadow: 0 2px 4px rgba(0,0,0,.8);
}
.pin .ico .champ {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  box-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.pin:hover .ico .champ { border-color: var(--cyan); }
.pin:hover { z-index: 5; }
.pin:hover .drop { border-color: var(--cyan); box-shadow: 0 0 16px rgba(10,200,185,.6); }
.pin .tip {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  color: var(--gold-bright);
  padding: 4px 10px;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.pin:hover .tip { opacity: 1; }
.pin.dragging-pin { transition: none; }

/* ---- Üst bar ---- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(1,10,19,.9), transparent);
}
#titlebox h1 { font-size: 30px; text-shadow: 0 0 20px rgba(200,170,110,.4); }
#titlebox p { font-size: 12px; letter-spacing: 1px; margin-top: 2px; opacity: .8; }
#controls { display: flex; gap: 10px; pointer-events: auto; }

/* ---- Hextech buton ---- */
.hexbtn {
  background: linear-gradient(to bottom, #1e2328, #10171f);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 16px;
  cursor: pointer;
  letter-spacing: .5px;
  transition: all .15s;
  box-shadow: inset 0 0 4px rgba(0,0,0,.6);
}
.hexbtn:hover { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 10px rgba(200,170,110,.35); }
.hexbtn.primary { border-color: var(--cyan); color: var(--cyan); }
.hexbtn.primary:hover { box-shadow: 0 0 12px rgba(10,200,185,.5); color: #fff; }
.hexbtn.danger { border-color: #6e2828; color: var(--red); }
.hexbtn.danger:hover { border-color: var(--red); box-shadow: 0 0 10px rgba(232,64,87,.4); }
.hexbtn.small { font-size: 12px; padding: 6px 12px; }
.hexbtn.active { border-color: var(--cyan); color: var(--cyan); }

/* ---- Edit banner ---- */
#editbanner {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  margin-top: 78px;
  background: rgba(10,20,40,.92);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 20;
  box-shadow: 0 0 20px rgba(10,200,185,.25);
}

/* ---- HUD ---- */
#hud {
  position: fixed;
  bottom: 14px; left: 20px;
  font-size: 12px;
  display: flex;
  gap: 18px;
  opacity: .7;
  pointer-events: none;
}
#pincount { color: var(--gold); }

/* ---- Modallar ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(1,6,12,.82);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.hidden { display: none !important; }

.panel {
  position: relative;
  background: linear-gradient(160deg, #0d1b31 0%, var(--panel2) 100%);
  border: 1px solid var(--gold-dim);
  outline: 1px solid rgba(200,170,110,.15);
  outline-offset: 4px;
  padding: 26px 30px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 60px rgba(0,0,0,.8), 0 0 40px rgba(200,170,110,.08);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

.viewpanel { width: 860px; }
.formpanel { width: 460px; }
.keypanel { width: 360px; }

.panel h2 { font-size: 22px; margin-bottom: 6px; padding-right: 30px; }
#vm-desc { font-size: 14px; margin-bottom: 14px; white-space: pre-wrap; }
#vm-video { background: #000; border: 1px solid #1e2d50; }
#vm-video video, #vm-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
#vm-actions { margin-top: 14px; }

.closex {
  position: absolute;
  top: 10px; right: 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.closex:hover { color: var(--gold-bright); }

/* ---- Form ---- */
label { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin: 14px 0 5px; }
.opt { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 12px; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  width: 100%;
  background: #050e18;
  border: 1px solid #1e2d50;
  color: var(--gold-bright);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold-dim); }
input[type=file] { width: 100%; color: var(--text); font-size: 13px; padding: 6px 0; }
input[type=file]::file-selector-button {
  background: #1e2328; border: 1px solid var(--gold-dim); color: var(--gold);
  padding: 7px 12px; margin-right: 10px; cursor: pointer; font-family: inherit;
}

#emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.iconopt {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: #050e18;
  border: 1px solid #1e2d50;
  cursor: pointer;
  transition: all .12s;
}
.iconopt:hover { border-color: var(--gold-dim); }
.iconopt.sel { border-color: var(--cyan); box-shadow: 0 0 8px rgba(10,200,185,.4); }

#champ-search { margin-top: 10px; }
#champ-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  background: #050e18;
  border: 1px solid #1e2d50;
  justify-content: center;
}
.champopt {
  width: 44px; height: 44px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .1s;
  background: #0a1420;
}
.champopt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.champopt:hover { border-color: var(--gold-dim); transform: scale(1.08); }
.champopt.sel { border-color: var(--cyan); box-shadow: 0 0 8px rgba(10,200,185,.5); }
.champ-empty { grid-column: 1/-1; text-align: center; color: var(--text); font-size: 13px; padding: 20px; }

.tabs { display: flex; gap: 0; margin-bottom: 10px; }
.tab {
  flex: 1;
  background: #050e18;
  border: 1px solid #1e2d50;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.tab.active { border-color: var(--gold-dim); color: var(--gold); background: #0d1b31; }

.row { display: flex; gap: 10px; margin-top: 20px; }
.error { color: var(--red); font-size: 13px; margin-top: 10px; }

#fm-existing-wrap { margin-top: 8px; }
#fm-existing { margin-top: 4px; }

/* Upload progress */
#upbar {
  position: relative;
  height: 22px;
  margin-top: 10px;
  background: #050e18;
  border: 1px solid #1e2d50;
}
#upfill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width .1s;
}
#uptext {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--gold-bright);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); }

@media (max-width: 700px) {
  #titlebox h1 { font-size: 20px; }
  #titlebox p { display: none; }
  .hint { display: none; }
  .viewpanel { width: 96vw; }
  .panel { padding: 18px; }
}
