/* SAMURAI WORLD — oyun arayüzü. Lake siyahı paneller, ince altın çerçeve, kağıt beyazı metin. */
:root {
  --ink: #0f0b0b;
  --lacquer: #1a1211;
  --panel: rgba(22, 15, 14, 0.97);
  --gold: #e3b45a;
  --gold-dim: rgba(227, 180, 90, 0.42);
  --paper: #f1e6cf;
  --muted: #bcae97;
  --red: #c8302c;
  --jade: #4fae8c;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Times New Roman", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--paper); font: 14px/1.45 var(--sans); }
body { touch-action: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; border: 1px solid var(--gold-dim);
  background: #2a1d1a; color: var(--paper); font-weight: 600; text-decoration: none;
}
.btn:hover { border-color: var(--gold); background: #33231f; }
.btn--kick { background: #53fc18; border-color: #53fc18; color: #071a02; font-size: 16px; padding: 13px 22px; }
.btn--kick:hover { background: #6bff38; border-color: #6bff38; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #1b1208; }
.btn--gold:hover { background: #f0c46c; }
.muted { color: var(--muted); }
.msg { padding: 9px 12px; border-radius: 8px; background: #3a1714; border: 1px solid #6a2622; color: #ffc9c0; }

/* ── giriş ve karakter ekranları ── */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(180deg, rgba(15, 11, 11, 0.35), rgba(15, 11, 11, 0.86) 70%); z-index: 20; }
.login { width: min(560px, 100%); text-align: center; padding: 34px 28px; border-radius: 18px; background: radial-gradient(ellipse at center, rgba(12, 8, 8, 0.86), rgba(12, 8, 8, 0.6) 70%, rgba(12, 8, 8, 0)); }
.login__kanji { margin: 0; font: 900 72px/1 var(--serif); color: var(--red); text-shadow: 0 0 30px rgba(200, 48, 44, 0.45); }
.login__title { margin: 6px 0 10px; font: 900 clamp(44px, 9vw, 76px)/0.95 var(--serif); letter-spacing: 0.02em; color: var(--paper); text-shadow: 0 3px 0 #000; }
.login__lede { margin: 0 auto 22px; max-width: 42ch; color: var(--muted); font-size: 16px; text-wrap: balance; }
.login__foot { margin-top: 22px; font-size: 13px; color: var(--muted); }
.login .msg { margin: 0 auto 14px; max-width: 42ch; }
.dev { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.dev input { padding: 10px; border-radius: 8px; border: 1px solid var(--gold-dim); background: #1a1211; color: var(--paper); }

.create { display: grid; grid-template-columns: 200px minmax(0, 340px); gap: 28px; align-items: center; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 14px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.create__preview { display: grid; place-items: center; height: 240px; border-radius: 10px; background: radial-gradient(circle at 50% 70%, #3a2a1c, #160f0e 70%); }
#create-canvas { image-rendering: pixelated; }
.create h1 { margin: 0 0 6px; font: 800 26px/1.15 var(--serif); }
.create .muted { margin: 0 0 16px; }
.pick { display: grid; grid-template-columns: 1fr 34px 108px 34px; align-items: center; gap: 6px; margin-bottom: 8px; }
.pick span { color: var(--muted); }
.pick button { height: 34px; border-radius: 8px; border: 1px solid var(--gold-dim); background: #241815; font-size: 18px; }
.pick output { text-align: center; font-weight: 600; }
#create-go { width: 100%; margin-top: 12px; }

/* ── HUD ── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.plate { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); display: flex; gap: 10px; align-items: center; padding: 10px 14px 10px 10px; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 12px; min-width: 250px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.plate img { border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.plate__body { flex: 1; min-width: 0; }
.plate__name { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate__name b { font-family: var(--serif); font-size: 16px; }
.lvl { color: var(--gold); font-weight: 700; font-size: 13px; }
.bar { position: relative; height: 14px; border-radius: 4px; background: #0b0807; border: 1px solid #3a2c22; overflow: hidden; margin-bottom: 4px; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; transition: width 0.35s ease; }
.bar--hp i { background: linear-gradient(180deg, #e2574c, #a5221d); }
.bar--xp i { background: linear-gradient(180deg, #f0c46c, #b4842e); }
.bar span { position: relative; display: block; text-align: center; font-size: 10.5px; line-height: 13px; font-weight: 700; text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.plate__gold { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #ffd98a; font-variant-numeric: tabular-nums; }
.coin { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b8, #e3b45a 45%, #9c6f22); box-shadow: 0 0 0 1px #6b4a16; }

.region { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); width: 172px; padding: 8px; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 12px; text-align: center; }
.region p { margin: 0 0 6px; font: 700 14px/1.2 var(--serif); }
#minimap { width: 156px; height: 107px; border-radius: 6px; image-rendering: pixelated; background: #000; display: block; margin: 0 auto; }
.net { margin-top: 6px !important; font: 600 11px var(--sans) !important; color: #ffb4a8; }

.feed { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: 86px; width: min(470px, calc(100vw - 24px)); margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; pointer-events: none !important; }
.feed li { pointer-events: auto; padding: 8px 12px; border-radius: 9px; background: rgba(18, 12, 11, 0.9); border: 1px solid rgba(227, 180, 90, 0.22); border-left: 3px solid var(--gold-dim); font-size: 13px; line-height: 1.4; animation: in 0.25s ease-out; overflow-wrap: anywhere; }
.feed li.fade { opacity: 0; transition: opacity 0.8s; }
.feed li.chat { border-left-color: #53fc18; }
.feed li.bad { border-left-color: var(--red); }
.feed li button { margin-left: 8px; padding: 2px 10px; border-radius: 6px; border: 1px solid var(--gold); background: #33231f; }
@keyframes in { from { transform: translateY(6px); opacity: 0; } }

.hotbar { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.hotbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px; padding: 7px 8px 6px; border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 12.5px; font-weight: 600; }
.hotbar button:hover, .hotbar button[aria-pressed="true"] { background: #2c1f1b; border-color: var(--gold-dim); }
.hotbar kbd { font: 700 10px var(--sans); color: var(--gold); }

.ko { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); padding: 14px 22px; border-radius: 12px; background: rgba(40, 10, 10, 0.92); border: 1px solid var(--red); text-align: center; }
.ko b { display: block; font: 800 22px var(--serif); }

.tip { position: absolute; padding: 6px 10px; border-radius: 8px; background: rgba(12, 8, 8, 0.95); border: 1px solid var(--gold-dim); font-size: 12.5px; pointer-events: none !important; white-space: nowrap; transform: translate(14px, 14px); }
.tip b { font-family: var(--serif); }
.ctx { position: absolute; display: flex; flex-direction: column; min-width: 150px; padding: 6px; border-radius: 10px; background: var(--panel); border: 1px solid var(--gold); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
.ctx p { margin: 2px 6px 6px; font: 700 13px var(--serif); }
.ctx button { text-align: left; padding: 8px 10px; border-radius: 7px; border: 0; background: transparent; font-weight: 600; }
.ctx button:hover { background: #2c1f1b; }

.banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); padding: 12px 28px; text-align: center; pointer-events: none !important; }
.banner b { display: block; font: 900 clamp(26px, 5vw, 44px)/1 var(--serif); letter-spacing: 0.02em; text-shadow: 0 3px 0 #000, 0 0 30px currentColor; }
.banner span { display: block; margin-top: 6px; font-weight: 600; text-shadow: 0 2px 0 #000; }
.banner.show { animation: banner 2.6s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ── paneller ── */
.panel { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 150px; bottom: 90px; width: min(560px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); overscroll-behavior: contain; }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px 16px; border-bottom: 1px solid rgba(227, 180, 90, 0.2); }
.panel__head h2 { margin: 0; font: 800 19px var(--serif); }
.x { width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 22px; line-height: 1; }
.x:hover { border-color: var(--gold-dim); }
.panel__body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; overscroll-behavior: contain; }
.panel h3 { margin: 16px 0 8px; font: 700 14px var(--sans); color: var(--muted); }
.panel h3:first-child { margin-top: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 8px; background: #120c0b; border: 1px solid #33261f; display: grid; place-items: center; padding: 0; }
.slot canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.slot .q { position: absolute; right: 3px; bottom: 1px; font: 700 11px var(--sans); text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.slot .lbl { position: absolute; left: 0; right: 0; bottom: 2px; font-size: 9.5px; color: var(--muted); text-align: center; }
.slot.empty { opacity: 0.55; }
.slot[aria-pressed="true"] { outline: 2px solid var(--gold); }
.slot.drop { outline: 2px dashed var(--gold); }
.r0 { border-color: #5a5f66; } .r1 { border-color: #3c9a5e; box-shadow: inset 0 0 10px rgba(91, 227, 138, 0.15); } .r2 { border-color: #3a7fc2; box-shadow: inset 0 0 10px rgba(74, 168, 255, 0.2); }
.r3 { border-color: #8a4fd0; box-shadow: inset 0 0 12px rgba(177, 107, 255, 0.28); } .r4 { border-color: #d98a26; box-shadow: inset 0 0 14px rgba(255, 174, 59, 0.32); } .r5 { border-color: #e0304f; box-shadow: inset 0 0 16px rgba(255, 59, 92, 0.38); }
.c0 { color: #cfd6de; } .c1 { color: #5be38a; } .c2 { color: #4aa8ff; } .c3 { color: #b16bff; } .c4 { color: #ffae3b; } .c5 { color: #ff3b5c; }
.detail { margin-top: 12px; padding: 12px; border-radius: 10px; background: #160f0e; border: 1px solid #33261f; }
.detail h4 { margin: 0 0 2px; font: 800 16px var(--serif); }
.detail p { margin: 4px 0; color: var(--muted); }
.detail .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail .acts button, .row button, .shop button { padding: 7px 12px; border-radius: 7px; border: 1px solid var(--gold-dim); background: #2a1d1a; font-weight: 600; }
.detail .acts button:hover, .row button:hover, .shop button:hover { border-color: var(--gold); }
.detail .acts .danger { border-color: #6a2622; }

.doll { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { padding: 8px; border-radius: 8px; background: #160f0e; border: 1px solid #2a201b; }
.stat small { display: block; color: var(--muted); font-size: 11.5px; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.profs { display: grid; gap: 6px; }
.prof { display: grid; grid-template-columns: 130px 44px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.prof .bar { margin: 0; height: 8px; }

.rows { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: #160f0e; border: 1px solid #2a201b; }
.row.cur { border-color: var(--gold); }
.row.lock { opacity: 0.6; }
.row small { display: block; color: var(--muted); }
.shop .row { grid-template-columns: 36px 1fr auto auto; }
.cmdbox { display: flex; gap: 8px; }
.cmdbox input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--gold-dim); background: #120c0b; color: var(--paper); font: 15px var(--sans); }
.cmdlog { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.cmdlog li { padding: 8px 10px; border-radius: 8px; background: #160f0e; overflow-wrap: anywhere; }
.cmdlog li.you { color: var(--gold); background: transparent; padding: 2px 10px; }
.hint { font-size: 12.5px; color: var(--muted); }

@media (max-width: 700px) {
  .plate { min-width: 0; right: 130px; padding: 8px; }
  .plate img { display: none; }
  .region { width: 112px; padding: 6px; }
  #minimap { width: 100px; height: 69px; }
  .hotbar { left: 8px; right: 8px; transform: none; justify-content: space-between; gap: 2px; padding: 4px; }
  .hotbar button { min-width: 0; flex: 1; padding: 6px 2px; font-size: 11px; }
  .panel { left: 8px; right: 8px; width: auto; top: 76px; bottom: 74px; }
  .feed { bottom: 74px; }
  .create { grid-template-columns: 1fr; padding: 18px; }
  .create__preview { height: 200px; }
  .prof { grid-template-columns: 110px 40px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
