/* Karadiyar: a classic browser-RPG page (banner, menus, framed panels, side column) in dark stone and bronze.
   Art drops in later through img/index.json; until then gradients carry the mood. */
@font-face { font-family: 'Alegreya Sans'; font-weight: 500; font-display: swap; src: url(/fonts/alegreya-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Alegreya Sans'; font-weight: 500; font-display: swap; src: url(/fonts/alegreya-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: 'Alegreya Sans'; font-weight: 700; font-display: swap; src: url(/fonts/alegreya-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Alegreya Sans'; font-weight: 700; font-display: swap; src: url(/fonts/alegreya-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: 'Alegreya SC'; font-weight: 700; font-display: swap; src: url(/fonts/alegreya-sc-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Alegreya SC'; font-weight: 700; font-display: swap; src: url(/fonts/alegreya-sc-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

:root {
  --bg: #0b0a09; --stone: #2a2724; --stone2: #34302c; --stone3: #1d1b19; --edge: #4d463e; --edge-hi: #6d6253;
  --bronze: #b08a4e; --gold: #d8b062; --text: #e4ddd0; --dim: #a59c8c; --blood: #9b2228; --blood2: #c83a3f;
  --green: #79a85f; --holy: #e8d27a; --paper: #cdbfa8; --ink: #2a2119;
  --r: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/1.45 'Alegreya Sans', system-ui, sans-serif; }
body { background: #0b0a09 radial-gradient(ellipse at 50% 0, #2a1d1b 0%, transparent 60%) no-repeat; min-height: 100vh; }
h1, h2, h3, .logo { font-family: 'Alegreya SC', serif; font-weight: 700; margin: 0; }
a { color: var(--gold); }
button, input, textarea, select { font: inherit; }
[hidden] { display: none !important; }

/* ── Page: main column + side column ── */
.page { display: grid; grid-template-columns: minmax(0, 820px) 220px; gap: 10px; justify-content: center; padding: 10px; }
@media (max-width: 1060px) { .page { grid-template-columns: minmax(0, 820px); } }

/* Stone frame used everywhere */
.frame { background: linear-gradient(var(--stone2), var(--stone)); border: 3px solid var(--stone3); outline: 1px solid var(--edge); outline-offset: -4px;
  box-shadow: 0 0 0 1px #000, inset 0 0 24px #0008; border-radius: var(--r); }
.frame-title { position: relative; text-align: center; font-size: 1.05rem; color: var(--paper); padding: 6px 40px; margin: 6px 6px 0;
  background: linear-gradient(#3b352f, #23201d); border: 1px solid var(--edge); }
.frame-title::before, .frame-title::after { content: '❖'; position: absolute; top: 50%; transform: translateY(-50%); color: var(--bronze); font-size: .9rem; }
.frame-title::before { left: 12px; } .frame-title::after { right: 12px; }
.sub-title { text-align: center; font: 700 .95rem 'Alegreya SC', serif; color: var(--paper); padding: 4px; margin: 10px 0 6px;
  background: linear-gradient(#3b352f, #23201d); border: 1px solid var(--edge); }

/* Banner + menus */
.banner { height: 120px; display: grid; place-items: center; border: 3px solid var(--stone3); outline: 1px solid var(--edge); outline-offset: -4px;
  background: linear-gradient(#0006, #000a), radial-gradient(ellipse at 50% 120%, #7a2a1a 0%, #2a1512 45%, #0e0b0a 80%); background-size: cover; background-position: center; }
.banner .logo, .gate .logo { font-size: 3rem; color: #e9d3a0; letter-spacing: .06em; text-shadow: 0 0 18px #c8603088, 0 3px 4px #000; }
.menu, .submenu { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; padding: 5px 8px; background: linear-gradient(#2e2a26, #1b1917); border: 1px solid #000; border-top: none; }
.menu button, .submenu button { background: none; border: none; color: var(--paper); font: 700 1.02rem 'Alegreya SC', serif; padding: 2px 8px; cursor: pointer; position: relative; }
.submenu button { font-size: .95rem; color: var(--dim); }
.menu button:hover, .submenu button:hover, .menu button.on, .submenu button.on { color: var(--gold); text-shadow: 0 0 8px #d8b06266; }
.submenu:empty { display: none; }
.badge { background: var(--blood2); color: #fff; border-radius: 999px; font: 700 .68rem 'Alegreya Sans', sans-serif; padding: 0 .45em; margin-left: 3px; vertical-align: top; }

/* Resource strip */
.strip { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 4px 12px; padding: 7px 10px; margin: 6px 0;
  background: linear-gradient(#36312b, #221f1c); border: 2px solid var(--stone3); outline: 1px solid var(--edge); outline-offset: -3px; }
.strip span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.strip i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0006; border: 1px solid var(--edge); font-size: .8rem; }
.strip .hp i { color: var(--blood2); } .strip .gold b { color: var(--gold); } .strip .kagat b { color: var(--holy); }

.content { padding-bottom: 10px; min-height: 520px; }
#view { padding: 8px 10px 0; }
.foot { text-align: center; color: var(--dim); font-size: .8rem; padding: 8px; }

/* Scene (city, region): big picture + text panel under it */
.scene { aspect-ratio: 16 / 7.5; border: 2px solid #000; outline: 1px solid var(--edge); background-size: cover; background-position: center;
  display: grid; place-items: center; color: #e9d3a0aa; font: 700 1.6rem 'Alegreya SC', serif; text-shadow: 0 2px 6px #000; }
.scene.has-art { color: transparent; text-shadow: none; }
.scene-text { margin-top: 8px; padding: 12px 14px; background: #0005; border: 1px solid var(--edge); }
.scene-text p { margin: 0 0 8px; } .scene-text p:last-child { margin: 0; }
.ph-sehir { background-image: linear-gradient(160deg, #3d3326, #1c1712 60%, #0d0b09); }
.ph-bolge { background-image: linear-gradient(160deg, #2d3527, #141a12 60%, #090b08); }
.ph-dag { background-image: linear-gradient(160deg, #47312a, #1d1411 60%, #0b0807); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { border: 1px solid var(--edge); padding: 6px 8px; }
.tbl th { background: #0004; color: var(--paper); font-weight: 700; font-size: .9rem; }
.tbl td.num, .tbl th.num { text-align: center; }
.tbl tr.me td { color: var(--gold); }
.tbl .link { color: var(--gold); cursor: pointer; background: none; border: none; padding: 0; text-decoration: underline; }

/* Buttons */
.btn { background: linear-gradient(#4a4239, #2a2520); color: var(--paper); border: 1px solid #000; outline: 1px solid var(--edge); outline-offset: -2px;
  font: 700 .95rem 'Alegreya SC', serif; padding: .3em 1em; cursor: pointer; border-radius: 2px; }
.btn:hover:not(:disabled) { color: var(--gold); outline-color: var(--bronze); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.red { background: linear-gradient(#8a2a2c, #4d1416); color: #f3dcd0; }
.btn.gold { background: linear-gradient(#5d4a22, #33280f); color: var(--holy); }
.btn.sm { font-size: .85rem; padding: .15em .6em; }
.btn.block { display: block; width: 100%; }
.center { text-align: center; }
.muted { color: var(--dim); font-size: .9rem; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt { margin-top: 12px; }

/* Character */
.char-top { display: grid; grid-template-columns: 180px 1fr 180px; gap: 8px; }
.char-bottom { display: grid; grid-template-columns: 180px 1fr; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .char-top, .char-bottom { grid-template-columns: 1fr; } }
.portrait { aspect-ratio: 3 / 4; border: 2px solid #000; outline: 1px solid var(--edge); background-size: cover; background-position: center top;
  display: grid; place-items: center; font: 700 3rem 'Alegreya SC', serif; color: #fff4; }
.portrait.has-art { color: transparent; }
.portrait.sq { aspect-ratio: 1; }
.p0 { background-image: linear-gradient(160deg, #4a3a32, #1a1310); } .p1 { background-image: linear-gradient(160deg, #343f4c, #12161b); }
.p2 { background-image: linear-gradient(160deg, #3a4632, #12170f); } .p3 { background-image: linear-gradient(160deg, #4a3448, #180f17); }
.p4 { background-image: linear-gradient(160deg, #4d4430, #1b170e); } .p5 { background-image: linear-gradient(160deg, #304848, #0e1717); }
.p6 { background-image: linear-gradient(160deg, #46303a, #170e12); } .p7 { background-image: linear-gradient(160deg, #303a52, #0e111a); }
.pm { background-image: linear-gradient(160deg, #5a2a22, #1a0c0a); }
.stat-row { display: grid; grid-template-columns: 100px 40px 1fr 32px 84px 84px; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 90px 36px 1fr 40px; } .stat-row .btn { grid-column: span 2; } }
.lbl { background: linear-gradient(#3b352f, #23201d); border: 1px solid var(--edge); text-align: center; padding: 4px; font-size: .92rem; }
.val { text-align: center; border: 1px solid var(--edge); padding: 4px; background: #0004; }
.gauge { height: 14px; background: #0b0a09; border: 1px solid var(--edge); position: relative; overflow: hidden; }
.gauge i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6d1a1d, var(--blood2)); }
.gauge.tp i { background: linear-gradient(90deg, #6d5420, var(--gold)); }
.gauge span { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 12px; text-shadow: 0 1px 2px #000; }

/* Inventory: paper doll around a silhouette */
.inv-top { display: grid; grid-template-columns: 330px 1fr; gap: 12px; }
@media (max-width: 700px) { .inv-top { grid-template-columns: 1fr; } }
.doll { display: grid; grid-template-columns: .8fr 1.4fr 2.4fr 1.4fr .8fr; grid-template-rows: 96px 150px 50px; gap: 6px; padding: 8px; border: 1px solid var(--edge); background: #0005; }
.slot { border: 1px solid var(--edge); background: #0007 center / 70% no-repeat; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; font-size: .74rem; padding: 3px; cursor: default; overflow: hidden; }
.slot.full { cursor: pointer; border-color: var(--bronze); background-color: #2a221a; }
.slot.holy { border-color: var(--holy); box-shadow: inset 0 0 10px #e8d27a55; }
.slot .k { color: var(--dim); font-size: .68rem; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.item { border: 1px solid var(--edge); background: #0005; padding: 6px 8px; display: grid; gap: 2px; font-size: .88rem; }
.item .name { font-weight: 700; color: var(--paper); } .item.holy .name { color: var(--holy); }
.item .eff { color: var(--dim); font-size: .82rem; }
.item .acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.price { color: var(--gold); font-size: .88rem; }
.filter { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 8px; }
.filter .btn.on { color: var(--gold); outline-color: var(--bronze); }

/* Raid / regions */
.clock { font: 700 2.6rem 'Alegreya SC', serif; color: var(--gold); text-align: center; margin: 6px 0; }
.danger { display: inline-flex; gap: 3px; vertical-align: middle; } .danger i { width: 12px; height: 6px; background: #0008; border: 1px solid var(--edge); }
.danger i.on { background: var(--blood2); }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.region-card { border: 1px solid var(--edge); background: #0005; cursor: pointer; }
.region-card .scene { aspect-ratio: 16 / 7; font-size: 1.1rem; }
.region-card .cap { padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; }

/* Fight report */
.rep-head { text-align: center; padding: 8px; }
.rep-head h3 { color: var(--paper); font-size: 1.1rem; }
.rep-head .win { color: var(--green); } .rep-head .loss { color: var(--blood2); }
.rep-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side { border: 1px solid var(--edge); background: #0004; }
.side-name { text-align: center; padding: 3px; background: linear-gradient(#3b352f, #23201d); border-bottom: 1px solid var(--edge); font-weight: 700; }
.side-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
.side.right .side-body { direction: rtl; } .side.right .side-body > * { direction: ltr; }
.sbox { border: 1px solid var(--edge); background: linear-gradient(#36312b, #221f1c); text-align: center; font-size: .78rem; padding: 1px; margin-bottom: 3px; }
.sbox b { display: block; font-size: .9rem; color: var(--paper); }
.side-foot { padding: 0 6px 6px; }
@media (max-width: 560px) { .side-body { grid-template-columns: 1fr; } }
.round { margin-top: 6px; }
.round p { margin: 4px 10px; font-size: .9rem; }
.round b { color: var(--paper); }
.round .crit { color: var(--gold); } .round .miss { color: var(--dim); }
.reward { color: var(--gold); }

/* Messages */
.folders td:first-child { font-weight: 700; color: var(--gold); cursor: pointer; }
.rep-list .rep { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--edge); cursor: pointer; }
.rep-list .rep.new { font-weight: 700; }
.win { color: var(--green); } .loss { color: var(--blood2); }

/* Side column */
.col-side { display: grid; gap: 10px; align-content: start; }
@media (max-width: 1060px) { .col-side { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .col-side { grid-template-columns: 1fr; } }
.side-status { padding: 10px; text-align: center; display: grid; gap: 6px; }
.side-status .who { font-weight: 700; color: var(--paper); }
.side-chat, .side-news { padding: 6px; display: grid; gap: 4px; align-content: start; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.tabs2 button { background: var(--paper); color: var(--ink); border: 1px solid #000; font-size: .85rem; padding: 2px; }
.tabs2 button.on { background: #e0a070; font-weight: 700; } .tabs2 button:disabled { opacity: .55; }
.paper { background: var(--paper); color: var(--ink); border: 1px solid #000; padding: 4px 6px; font-size: .85rem; }
.paper input { width: 100%; border: 1px solid #8a7a62; background: #efe6d6; padding: 2px 4px; }
.news-item { background: var(--paper); color: var(--ink); border: 1px solid #000; font-size: .82rem; }
.news-item .h { background: #b89a7a; font-weight: 700; padding: 1px 6px; color: #3a2416; }
.news-item .b { padding: 4px 6px; }

/* Gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-box { width: min(440px, 100%); padding: 22px; text-align: center; }
.gate-tabs { display: flex; gap: 6px; margin: 12px 0; } .gate-tabs .btn { flex: 1; } .gate-tabs .on { color: var(--gold); outline-color: var(--bronze); }
.gate-form { display: grid; gap: 10px; text-align: left; }
.gate-field { display: grid; gap: 4px; } .gate-field small { color: var(--dim); }
.gate-msg { color: var(--blood2); min-height: 1em; margin: 0; }
.gate-lobi { display: block; margin-top: 10px; font-size: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=search] { background: #0c0b0a; color: var(--text); border: 1px solid var(--edge); padding: .45em .6em; width: 100%; }
.gate-box.wide { width: min(780px, 100%); }
.gate-form.wide > .gate-field { max-width: 360px; width: 100%; justify-self: center; text-align: center; }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } /* four men, then four women */
.looks button { display: grid; gap: 5px; padding: 5px; border: 2px solid var(--edge); border-radius: var(--r); background: #0005; cursor: pointer;
  color: var(--dim); font: 700 .9rem 'Alegreya SC', serif; transition: border-color .15s, transform .15s, box-shadow .15s; }
.looks button:hover { border-color: var(--bronze); color: var(--paper); transform: translateY(-2px); }
.looks button.on { border-color: var(--gold); color: var(--holy); box-shadow: 0 0 14px #d8b06266; }
.looks .portrait { font-size: 2.4rem; width: 100%; }
@media (max-width: 560px) { .looks { grid-template-columns: repeat(2, 1fr); } }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: #000c; display: grid; place-items: center; z-index: 20; padding: 12px; }
.modal-box { width: min(760px, 100%); max-height: 92vh; overflow: auto; position: relative; padding: 8px 10px 12px; }
.modal-x { position: absolute; top: 10px; right: 12px; z-index: 1; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #2a1215; border: 1px solid var(--blood2); padding: .6em 1.1em; z-index: 40; max-width: calc(100% - 32px); }
#toast.ok { background: #18220f; border-color: var(--green); }
@media (max-width: 640px) { .char-top > .portrait, .side-body > .portrait { max-width: 180px; width: 100%; margin: 0 auto; } }
/* Uploaded picture (black when none) above the character portrait */
.avatar { aspect-ratio: 3 / 4; background: #000; border: 2px solid #000; outline: 1px solid var(--edge); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pics { display: grid; gap: 6px; align-content: start; }
.side-body .pics .avatar { aspect-ratio: 1; }
a.strip, .strip a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.strip a:hover b { text-decoration: underline; }
select { background: #0c0b0a; color: var(--text); border: 1px solid var(--edge); padding: .4em .5em; }
@media (max-width: 640px) { .char-top > div > .avatar, .char-bottom .portrait { max-width: 180px; margin: 0 auto; } }
/* Chat + messages */
.chat-lines { display: grid; gap: 3px; max-height: 420px; overflow-y: auto; }
.news-item .h { display: flex; justify-content: space-between; gap: 6px; }
.news-item.mine .h { background: #c9a77f; }
.news-item .b { word-break: break-word; }
.compose { display: grid; gap: 8px; }
.compose label { display: grid; gap: 3px; }
textarea { background: #0c0b0a; color: var(--text); border: 1px solid var(--edge); padding: .45em .6em; width: 100%; font: inherit; resize: vertical; }
.msg-body { white-space: pre-wrap; word-break: break-word; margin-top: 10px; padding: 12px; background: #0005; border: 1px solid var(--edge); }
.tbl tr.unread td { font-weight: 700; color: var(--paper); }
.news-item.click { cursor: pointer; }
.tbl td.loss { color: var(--blood2); }
/* Öğretici: a floating guide box (bottom right, moves left when it would cover the target) + pointer */
.tutorial { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 340px; max-width: calc(100% - 32px); padding: 10px 14px 12px;
  border-color: var(--bronze); background: linear-gradient(#3a2f22, #241d16); box-shadow: 0 0 0 1px #000, 0 10px 30px #000c, 0 0 18px #d8b06233, inset 0 0 20px #0008;
  animation: tut-in .25s ease-out; }
.tutorial.left { right: auto; left: 18px; }
.tutorial .tut-head { display: flex; align-items: center; gap: 8px; color: var(--holy); font-family: 'Alegreya SC', serif; }
.tutorial .tut-head b { flex: 1; font-size: 1.05rem; }
.tut-step { font: 700 .75rem 'Alegreya Sans', sans-serif; color: #1b1308; background: var(--gold); border-radius: 10px; padding: 0 7px; }
.tut-fold { background: #0005; border: 1px solid var(--edge); color: var(--paper); width: 24px; height: 22px; line-height: 1; cursor: pointer; border-radius: 3px; }
.tut-fold:hover { color: var(--gold); border-color: var(--bronze); }
.tut-dots { display: flex; gap: 4px; margin: 6px 0 2px; }
.tut-dots i { flex: 1; height: 4px; border-radius: 2px; background: #0007; }
.tut-dots i.done { background: var(--bronze); } .tut-dots i.now { background: var(--holy); box-shadow: 0 0 6px var(--holy); }
.tutorial p { margin: 8px 0 10px; font-size: .92rem; line-height: 1.45; }
.tut-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tut-acts .link { margin-right: auto; }
.tutorial .link { color: var(--dim); cursor: pointer; background: none; border: none; padding: 0; text-decoration: underline; font-size: .82rem; }
.tutorial.small { width: auto; padding: 6px 10px; cursor: pointer; }
.tutorial.small .tut-head b { font-size: .95rem; }
@keyframes tut-in { from { opacity: 0; transform: translateY(12px); } }
#tut-ring { position: fixed; z-index: 29; pointer-events: none; border: 2px solid var(--holy); border-radius: 6px;
  box-shadow: 0 0 0 2px #0009, 0 0 14px var(--holy); animation: tut-pulse 1.2s ease-in-out infinite; transition: all .2s; }
#tut-hand { position: fixed; z-index: 31; pointer-events: none; width: 46px; height: 46px; transition: left .2s, top .2s;
  filter: drop-shadow(0 2px 3px #000); animation: tut-bob .9s ease-in-out infinite; }
#tut-hand svg { width: 100%; height: 100%; display: block; }
@keyframes tut-pulse { 50% { box-shadow: 0 0 0 2px #0009, 0 0 26px 4px var(--holy); border-color: #fff6c9; } }
@keyframes tut-bob { 0%, 100% { transform: translate(4px, 4px); } 50% { transform: translate(14px, 14px); } }
@media (max-width: 640px) { .tutorial, .tutorial.left { left: 16px; right: 16px; bottom: 10px; width: auto; max-width: none; } }
.city-map { position: relative; border: 2px solid #000; outline: 1px solid var(--edge); line-height: 0; }
.city-map img { width: 100%; height: auto; display: block; }
.city-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.city-map polygon { fill: transparent; stroke: transparent; stroke-width: 3; cursor: pointer; transition: fill .15s, stroke .15s; }
.city-map a:hover polygon, .city-map a:focus polygon { fill: #ffd98a22; stroke: #e9c46acc; }
.city-label { position: absolute; transform: translate(-50%, -50%); pointer-events: none; line-height: 1.2; white-space: nowrap;
  background: #1a1410e6; color: #f0d79a; border: 1px solid var(--bronze); padding: 4px 10px; font-family: 'Alegreya SC', serif; font-weight: 700; font-size: .95rem; box-shadow: 0 2px 8px #000a; }
.gauge.quarters b { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #000c; box-shadow: 0 0 0 1px #e9c46a55; }
.gauge.quarters b.done { background: #fff6; }
.war-head { display: grid; grid-template-columns: 150px 1fr 150px; gap: 8px; align-items: center; margin-bottom: 8px; }
.war-head > .center { border: 1px solid var(--edge); background: #0004; padding: 10px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.war-head p { margin: 4px 0; }
.clan-emblem { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #000; outline: 1px solid var(--edge);
  background: radial-gradient(circle at 50% 40%, #4a2a1e, #140d0a 75%); font-family: 'Alegreya SC', serif; font-size: 3.4rem; color: #e9c46a99; }
.gold-t { color: var(--gold); }
.war-tbl th { font-weight: 400; } .war-tbl th, .war-tbl td { width: 33%; text-align: center; }
.war-fight { margin-top: 10px; }
.war-fight .round p { margin: 4px 0; }
@media (max-width: 640px) { .war-head { grid-template-columns: 70px 1fr 70px; } .clan-emblem { font-size: 2rem; } }
.gods { display: grid; grid-template-columns: 1fr 70px 1fr; gap: 8px; align-items: center; margin: 8px 0; }
.gods .vs { text-align: center; color: var(--dim); font-family: 'Alegreya SC', serif; }
.god { border: 1px solid var(--edge); background: #0004; padding: 10px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.god.mine { border-color: var(--gold); box-shadow: inset 0 0 12px #e9c46a33; }
.god-pic { width: 100%; max-width: 220px; aspect-ratio: 3 / 4; display: grid; place-items: center; border: 2px solid #000; background: radial-gradient(circle at 50% 35%, #4a2a1e, #140d0a 75%) center / cover;
  font-family: 'Alegreya SC', serif; font-size: 4rem; color: #e9c46a88; }
.god-pic.has-art { color: transparent; }
.god-name { color: var(--paper); }
@media (max-width: 640px) { .gods { grid-template-columns: 1fr; } }
.item-art { width: 64px; height: 64px; object-fit: contain; float: right; margin: 0 0 4px 6px; }
.slot.has-art { background-size: contain; background-origin: content-box; background-repeat: no-repeat; background-position: center; padding: 10px; }
.slot.has-art .k, .slot.has-art span { display: none; } /* the picture says it; the name is in the tooltip */
/* Page background picture (img/arkaplan.webp, else the banner): darkened and soft so the panels stay readable. */
body.has-bg::before { content: ''; position: fixed; inset: -20px; z-index: -1; background: var(--page-bg) center / cover no-repeat; filter: blur(var(--page-blur, 0px)) brightness(.38) saturate(.9); }
body.has-bg { background: transparent; } /* the root keeps the dark colour; the picture sits between them */
.clan-emblem.has-art { background-size: cover; background-position: center top; background-repeat: no-repeat; color: transparent; }
.clan-emblem.god-emblem { aspect-ratio: 3 / 4; }
/* Shop (Tagoria-style cards) */
.shop-tabs { display: flex; justify-content: center; gap: 2px; background: #0004; border: 1px solid var(--edge); padding: 4px; margin-bottom: 4px; }
.shop-tabs button { background: none; border: none; color: var(--text); font: inherit; font-size: .92rem; padding: 2px 12px; cursor: pointer; }
.shop-tabs button.on, .shop-tabs button:hover { color: var(--gold); }
.shop-tabs.kinds { margin-bottom: 8px; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 640px) { .shop-grid { grid-template-columns: 1fr; } }
.shop-card { border: 1px solid var(--edge); background: #0003; }
.shop-card.holy { border-color: var(--holy); box-shadow: inset 0 0 12px #e8d27a33; }
.shop-card-t { text-align: center; font-weight: 700; color: var(--paper); padding: 6px; border-bottom: 1px solid var(--edge); background: #0004; }
.shop-card.holy .shop-card-t { color: var(--gold); }
.shop-card-b { display: grid; grid-template-columns: 44% 1fr; }
.shop-card-pic { display: grid; place-items: center; min-height: 230px; padding: 12px; border-right: 1px solid var(--edge); background: radial-gradient(ellipse at 50% 45%, #3a332c, #15120f 75%); color: var(--dim); }
.shop-card-pic img { max-width: 100%; max-height: 210px; object-fit: contain; filter: drop-shadow(0 6px 8px #000a); }
.shop-card-info { display: grid; grid-auto-rows: 1fr; }
.shop-card-info > div { display: flex; align-items: center; justify-content: center; padding: 6px; border-bottom: 1px solid var(--edge); font-size: .9rem; text-align: center; }
.shop-card-info > div:last-child { border-bottom: none; }
.shop-card-info .two { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
.shop-card-info .two span { padding: 6px; display: flex; align-items: center; justify-content: center; }
.shop-card-info .two span + span { border-left: 1px solid var(--edge); color: var(--dim); }
.shop-card-info .dash { color: var(--dim); }
.shop-card-info .price { color: var(--gold); font-weight: 700; }
.report-x { background: none; border: none; padding: 0 0 0 6px; cursor: pointer; color: #8a6a4a; font-size: .75rem; }
.report-x:hover { color: var(--blood2); }
/* Arena: search box on the arena picture, then the rival's page */
.arena-ground { min-height: 420px; display: grid; place-items: center; padding: 20px 10px; background: radial-gradient(ellipse at 50% 60%, #3a2f26, #120e0b 75%) center / cover; border: 1px solid var(--edge); }
.arena-search { width: min(440px, 100%); padding: 10px 14px 14px; }
.arena-search .row { justify-content: center; margin: 8px 0; }
.arena-search input[type=text] { flex: 1; min-width: 180px; }
.foe-top { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.foe-top .pics { display: grid; grid-template-columns: 1fr; gap: 4px; }
.foe-top .pics .avatar { aspect-ratio: 1; }
.foe-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.foe-bottom { display: grid; grid-template-columns: 180px 1fr; gap: 10px; margin-top: 10px; align-items: start; }
.foe-bottom .sbox { padding: 2px 6px; }
@media (max-width: 640px) { .foe-top, .foe-bottom { grid-template-columns: 1fr; } }
.btn.red:disabled { background: #2a2622; border-color: #3a3530; color: #777; opacity: 1; }
.portrait.petpic.has-art { background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #1a1612; box-shadow: inset 0 0 40px #000; }

/* ── Strip emblems from art (ikon_*.webp, transparent) ── */
.strip i.art { background: none; border: none; width: 28px; height: 28px; }
.strip i img, .kg-coin img, .ask-price i img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 1px 2px #000); }

/* ── The game's own confirm box (ask) ── */
.ask { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: #000b; backdrop-filter: blur(2px); animation: ask-in .12s ease-out; }
.ask-box { width: min(420px, 100%); padding-bottom: 4px; box-shadow: 0 0 0 1px #000, 0 12px 40px #000c, inset 0 0 24px #0008; }
.ask-body { padding: 14px 18px 12px; text-align: center; }
.ask-body > p { margin: 0 0 12px; color: var(--text); }
.ask-price { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 0 auto 14px; padding: 7px 12px; width: fit-content;
  background: #0006; border: 1px solid var(--bronze); border-radius: var(--r); }
.ask-price i { font-style: normal; width: 22px; height: 22px; display: inline-grid; place-items: center; color: var(--holy); }
.ask-price b { color: var(--holy); font-size: 1.05rem; } .ask-price small { color: var(--dim); flex-basis: 100%; }
.ask-acts { display: flex; justify-content: center; gap: 10px; }
.ask-acts .btn { min-width: 110px; }
@keyframes ask-in { from { opacity: 0; } }

/* ── Mağaza ── */
.shop { display: grid; gap: 12px; padding: 4px 2px; }
.kg-coin { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--holy); flex: none; }
.shop-vault { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px;
  background: linear-gradient(90deg, #3a2e17cc, #1d1a16cc); border: 1px solid var(--bronze); border-radius: var(--r); box-shadow: inset 0 0 18px #0009; }
.sv-bal { display: flex; align-items: center; gap: 10px; }
.sv-bal .kg-coin { width: 38px; height: 38px; font-size: 1.5rem; border-radius: 50%; background: radial-gradient(#5d4a22, #241c0c); border: 1px solid var(--gold); }
.sv-bal:has(img) .kg-coin { background: none; border: none; }
.sv-bal small { display: block; color: var(--dim); font-size: .8rem; line-height: 1; }
.sv-bal b { font: 700 1.6rem 'Alegreya SC', serif; color: var(--holy); line-height: 1.1; }
.shop-vault .btn { text-decoration: none; }

.shop-premium { position: relative; display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 14px; overflow: hidden; border-radius: var(--r);
  background: radial-gradient(ellipse at 0 0, #6b4f1d55, transparent 60%), linear-gradient(#2f2822, #1a1714);
  border: 1px solid var(--gold); box-shadow: 0 0 0 1px #000, 0 0 22px #d8b06222, inset 0 0 30px #000a; }
.shop-premium::before { content: ''; position: absolute; inset: 4px; border: 1px solid #d8b06233; pointer-events: none; border-radius: 2px; }
.shop-art { display: grid; place-items: center; background: #0007 center / cover no-repeat; border: 1px solid var(--edge); border-radius: var(--r);
  color: var(--bronze); font-size: 2.6rem; aspect-ratio: 1; }
.shop-art.has-art, .shop-premium .shop-art.has-art, .kg-card .shop-art.has-art { font-size: 0; color: transparent; text-shadow: none; }
.shop-premium .shop-art { align-self: start; border-color: var(--bronze); font-size: 4rem; color: var(--gold); text-shadow: 0 0 18px #d8b06288; }
.sp-head { display: flex; align-items: center; gap: 10px; }
.sp-head h3 { font-size: 1.4rem; color: var(--holy); text-shadow: 0 1px 0 #000, 0 0 12px #e8d27a44; }
.sp-tag { font: 700 .72rem 'Alegreya SC', serif; letter-spacing: .04em; padding: 1px 8px; border-radius: 10px; background: var(--blood); color: #fff; border: 1px solid #000; }
.shop-premium.active .sp-tag { background: #3d5a2c; }
.sp-body > p { margin: 4px 0 8px; font-size: .88rem; }
.sp-perks { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sp-perks th { font: 700 .8rem 'Alegreya SC', serif; color: var(--dim); text-align: center; padding: 2px 6px; border-bottom: 1px solid var(--edge); }
.sp-perks td { padding: 3px 6px; border-bottom: 1px solid #ffffff0d; }
.sp-perks td + td { text-align: center; color: var(--dim); width: 78px; }
.sp-perks td:last-child { color: var(--holy); font-weight: 700; background: #d8b06211; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sp-period { color: var(--dim); } .sp-period b { color: var(--holy); font: 700 1.3rem 'Alegreya SC', serif; }

.shop-buy { display: inline-flex; align-items: center; gap: 10px; padding-right: 8px; }
.shop-price { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-left: 1px solid #0008; box-shadow: -1px 0 0 #ffffff14; }
.shop-price .kg-coin { width: 16px; height: 16px; }

.kg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kg-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r);
  background: linear-gradient(#2c2824, #1c1a17); border: 1px solid var(--edge); box-shadow: inset 0 0 16px #0008; transition: border-color .15s, transform .15s; }
.kg-card:hover { border-color: var(--bronze); transform: translateY(-1px); }
.kg-card .shop-art { width: 72px; margin: 0 auto; font-size: 2rem; }
.kg-card h4 { margin: 0; text-align: center; font: 700 1.02rem 'Alegreya SC', serif; color: var(--paper); }
.kg-card p { margin: 0; text-align: center; font-size: .84rem; flex: 1; }
.sc-foot { display: grid; justify-items: center; }
.sc-rename { display: grid; gap: 6px; width: 100%; justify-items: center; }
.sc-rename input { width: 100%; }
.shop-note { display: flex; align-items: center; gap: 6px; justify-self: start; color: var(--dim); font-size: .8rem; margin-top: 4px; }
.shop-note .kg-coin { width: 16px; height: 16px; font-size: .8rem; }
@media (max-width: 560px) {
  .shop-premium { grid-template-columns: 1fr; }
  .shop-premium .shop-art { width: 110px; justify-self: center; }
}

/* ── Görünüş (Kagat): portre çerçeveleri, unvan, renkli ad ── */
.portrait.framed { outline: none; }
.portrait.frame-tunc  { border: 4px solid #8a5a2b; box-shadow: 0 0 0 1px #000, 0 0 0 3px #c08a4a, inset 0 0 14px #000a; }
.portrait.frame-altin { border: 4px solid #b8892c; box-shadow: 0 0 0 1px #000, 0 0 0 3px #f0c75e, 0 0 16px #f0c75e66, inset 0 0 14px #000a; }
.portrait.frame-kan   { border: 4px solid #6e1015; box-shadow: 0 0 0 1px #000, 0 0 0 3px #c8303a, 0 0 18px #c8303a77, inset 0 0 18px #4a000699; }
.portrait.frame-golge { border: 4px solid #141118; box-shadow: 0 0 0 1px #5b4a73, 0 0 0 4px #000, 0 0 22px 4px #6b4fa088, inset 0 0 22px #000; }
.portrait.frame-buz   { border: 4px solid #6fb7d8; box-shadow: 0 0 0 1px #0b2633, 0 0 0 3px #d9f4ff, 0 0 18px #74cdf588, inset 0 0 16px #0d3a5288; }
.portrait.frame-ejder { border: 4px solid #a8361b; box-shadow: 0 0 0 1px #000, 0 0 0 3px #f39a2c, 0 0 22px #ff7a1e99, inset 0 0 18px #5a100088; animation: ejder-ates 2.4s ease-in-out infinite; }
@keyframes ejder-ates { 50% { box-shadow: 0 0 0 1px #000, 0 0 0 3px #ffd06a, 0 0 32px 6px #ff7a1ecc, inset 0 0 18px #5a100088; } }
@media (prefers-reduced-motion: reduce) { .portrait.frame-ejder { animation: none; } }
.title-tag { display: inline-block; font: 700 .78rem 'Alegreya SC', serif; letter-spacing: .03em; color: var(--holy); text-shadow: 0 0 8px #e8d27a55; }
.title-tag.center { display: block; text-align: center; margin-bottom: 6px; }
.sub-title .title-tag { display: block; font-size: .78rem; }
.side-chat .h .colored { font-weight: 700; background: #1d1916; padding: 0 6px; border-radius: 3px; }
.tbl .title-tag { display: block; }

.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.look-card { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r); background: linear-gradient(#2c2824, #1c1a17);
  border: 1px solid var(--edge); text-align: center; font-size: .82rem; }
.look-card.on { border-color: var(--gold); box-shadow: 0 0 12px #d8b06244; }
.look-card .look-pic { width: 76px; font-size: 1.6rem; }
.look-card b { color: var(--paper); font: 700 .86rem 'Alegreya SC', serif; }
.kg-card.wide { grid-column: 1 / -1; }
.kg-card.wide h4, .kg-card.wide > p { text-align: center; }
.swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0; }
.swatch { padding: 4px 10px; border-radius: var(--r); border: 1px solid var(--edge); background: #0009; cursor: pointer; font: 700 .9rem 'Alegreya Sans', sans-serif; }
.swatch span { color: inherit; }
.swatch.on { border-color: currentColor; box-shadow: 0 0 10px currentColor; }
.sc-foot.row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-top: 6px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border: 1px solid var(--edge); border-radius: var(--r); background: #0005; }
.title-row.on { border-color: var(--gold); }
.title-row .title-tag { font-size: .9rem; }
.btn.pet-heal, div.pet-heal { grid-column: span 2; }
div.pet-heal { text-align: center; font-size: .82rem; }
.btn .btn-ic { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin: -4px 6px -4px -2px; filter: drop-shadow(0 1px 2px #000); }

/* Şifalı otlar: çantada tür başına bir kart, kaç tane olduğu rozetle */
.herb-card { border-color: #3f5a33; background: linear-gradient(#232a1f, #171b15); }
.herb-head { display: flex; align-items: center; gap: 6px; }
.herb-head .name { flex: 1; }
.herb-pic { width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--green); font-size: 1.1rem; }
.herb-pic img { width: 100%; height: 100%; object-fit: contain; }
.herb-n { font: 700 .9rem 'Alegreya SC', serif; color: #1b1308; background: var(--green); border-radius: 10px; padding: 0 8px; }
.herb-qty { width: 64px; background: #0c0b0a; color: var(--text); border: 1px solid var(--edge); padding: .25em .4em; }
/* Eşya resmi yuvada bir <img> (boyalı yedek resim filtre alabilsin diye arka plan değil) */
.slot { position: relative; }
.slot .slot-art { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; pointer-events: none; }
.herb-pic.big { width: 56px; height: 56px; font-size: 1.8rem; }
.herb-shop .herb-head { margin-bottom: 4px; }

/* ── Kutsal eşya: tanrının renginde nefes alan parıltı (resim bir çerçevenin içinde; yedek resmin boyası img'de kalır) ── */
.holy-fx { display: inline-block; }
.holy-fx > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item-art.holy-fx { width: 84px; height: 84px; }
.holy-savas { animation: holy-savas 1.6s ease-in-out infinite; }   /* Savaş: kızıl alev, titrek */
.holy-olum  { animation: holy-olum 3s ease-in-out infinite; }      /* Ölüm: mor-kara, ağır */
.holy-yasam { animation: holy-yasam 2.6s ease-in-out infinite; }   /* Yaşam: yeşil, nefes gibi */
.holy-isik  { animation: holy-isik 2.2s ease-in-out infinite; }    /* Işık: altın-beyaz, pırıltı */
/* --k: tier strength (I = 1 … VI = 3), set on the element; every radius grows with it */
@keyframes holy-savas {
  0%, 100% { filter: drop-shadow(0 0 calc(3px * var(--k, 1)) #ff4a1c) drop-shadow(0 0 calc(6px * var(--k, 1)) #ff7a1e88); }
  20% { filter: drop-shadow(0 0 calc(7px * var(--k, 1)) #ff3a10) drop-shadow(0 -3px calc(10px * var(--k, 1)) #ffb020aa); }
  45% { filter: drop-shadow(0 0 calc(4px * var(--k, 1)) #ff4a1c) drop-shadow(0 -2px calc(7px * var(--k, 1)) #ff7a1e99); }
  70% { filter: drop-shadow(0 0 calc(9px * var(--k, 1)) #ff2a00) drop-shadow(0 -4px calc(14px * var(--k, 1)) #ffc040bb); }
}
@keyframes holy-olum {
  0%, 100% { filter: drop-shadow(0 0 calc(3px * var(--k, 1)) #6a2bd0) drop-shadow(0 0 2px #000); }
  50% { filter: drop-shadow(0 0 calc(10px * var(--k, 1)) #8a3cff) drop-shadow(0 0 calc(16px * var(--k, 1)) #2a0a50cc); }
}
@keyframes holy-yasam {
  0%, 100% { filter: drop-shadow(0 0 calc(3px * var(--k, 1)) #4fd27a88); }
  50% { filter: drop-shadow(0 0 calc(10px * var(--k, 1)) #5fe38a) drop-shadow(0 0 calc(18px * var(--k, 1)) #9dffb766); }
}
@keyframes holy-isik {
  0%, 100% { filter: drop-shadow(0 0 calc(4px * var(--k, 1)) #ffe69a) brightness(1); }
  50% { filter: drop-shadow(0 0 calc(12px * var(--k, 1)) #fff2c0) drop-shadow(0 0 calc(20px * var(--k, 1)) #ffd76a99) brightness(1.15); }
}
.holy-fx { position: relative; }
.holy-tier { position: absolute; right: -4px; bottom: -4px; min-width: 20px; padding: 0 4px; border-radius: 9px; text-align: center;
  font: 700 .7rem/1.35 'Alegreya SC', serif; color: #1b1308; background: linear-gradient(#f3d98a, #c99a3e); border: 1px solid #000; box-shadow: 0 1px 3px #000; filter: none; }
.slot .holy-fx { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); pointer-events: none; }
/* Holy pictures carry an aura margin of their own: drawn a little larger so they fill the box like normal gear */
.holy-fx > img { transform: scale(1.15); }
.slot .holy-tier { right: 3px; bottom: 3px; }
.shop-card-pic .holy-fx { width: 100%; height: 100%; }
.holy-power { color: var(--holy); font-size: .82rem; }
@media (prefers-reduced-motion: reduce) { .holy-fx { animation: none; } }

/* Açılış sayacı (Erken Erişim öncesi) */
.countdown { display: flex; justify-content: center; gap: 10px; margin: 14px 0 6px; }
.countdown div { display: grid; justify-items: center; min-width: 64px; padding: 8px 6px; background: #0007; border: 1px solid var(--bronze); border-radius: var(--r); }
.countdown b { font: 700 1.9rem 'Alegreya SC', serif; color: var(--holy); line-height: 1; }
.countdown span { font-size: .7rem; color: var(--dim); letter-spacing: .08em; margin-top: 4px; }
.gate-about { color: var(--dim); font-size: .92rem; margin: 4px 0 10px; }
