/* Tételvár – az izometrikus város felülete: pergamen-stílusú feliratok, minitérkép, nagy térkép, beállítások, telefonos irányító. */
:root { --v-wood: #6b4526; --v-wood2: #4a2e18; --v-parch: #f1e6cc; --v-ink: #3a2a1a; --hud-h: calc(max(10px, env(safe-area-inset-top)) + 54px); }

/* címképernyőn, menüben, Ruhatárban és feladatlapon a város saját felülete nem látszik */
body.in-title :is(#labels, #area, #mini, #say, #dlg, #joy, #tBtns, #toast, #set, #bigmap),
body.busy :is(#labels, #mini, #say, #dlg, #joy, #tBtns, #set, #bigmap) { display: none !important; }

#dlg { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; display: none; min-width: 280px; max-width: 92vw; width: 420px; color: var(--v-ink);
  background: var(--v-parch); border: 4px solid var(--v-wood2); border-radius: 8px; box-shadow: 0 6px 0 #0006; padding: 14px 18px; text-align: center; font-size: 22px; }
#dlg h2 { margin: 0 0 4px; font-weight: 400; font-size: 30px; }
#dlg p { margin: 0 0 12px; opacity: 0.85; line-height: 1.1; }
#dlgS { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
#dlgS[hidden] { display: none; }
#dlgS label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 20px; }
#dlgS select { font: inherit; font-size: 19px; max-width: 70%; color: var(--v-ink); background: #fff8e4; border: 2px solid var(--v-wood2); border-radius: 4px; padding: 0 6px; }
#dlg button { font: inherit; font-size: 24px; margin: 0 8px; padding: 4px 22px 6px; border: 3px solid var(--v-wood2); border-radius: 6px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; vertical-align: top; }
#dlg button[hidden] { display: none; }
#dlg button kbd { font-family: inherit; font-size: 20px; line-height: 1; min-width: 30px; padding: 3px 8px 4px; border-radius: 5px; background: #f8ecd0; color: #3a2a1a; border: 2px solid #3e2414; box-shadow: 0 3px 0 #3e2414; }
.touch #dlg button kbd { display: none; }
#dlg .yes { background: #4a8a3a; color: #fff; } #dlg .no { background: #d8c8a4; color: var(--v-ink); }
#say { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 52px); transform: translateX(-50%); z-index: 7; display: none; width: min(560px, 92vw); color: var(--v-ink);
  background: var(--v-parch); border: 4px solid var(--v-wood2); border-radius: 8px; box-shadow: 0 5px 0 #0006; padding: 8px 14px; font-size: 21px; line-height: 1.15; }
#say b { display: block; font-weight: 400; font-size: 18px; color: #7a4a20; } #say small { display: block; opacity: 0.6; font-size: 15px; margin-top: 2px; }
#tutSkip { display: none; margin-top: 4px; font: inherit; font-size: 16px; background: none; border: none; color: #7a4a20; text-decoration: underline; cursor: pointer; padding: 0; }
#labels { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; color: #fff; font-size: 21px; line-height: 1; text-align: center; text-shadow: 2px 0 0 #1c140c, -2px 0 0 #1c140c, 0 2px 0 #1c140c, 0 -2px 0 #1c140c, 2px 2px 0 #1c140c, -2px 2px 0 #1c140c, 2px -2px 0 #1c140c, -2px -2px 0 #1c140c; }
.lbl small { display: block; color: #ffd870; font-size: 16px; margin-top: 2px; }
/* telefonon: a kiválasztott lakó / épület fölötti buborékra koppintva lehet beszélgetni vagy belépni */
.lbl.tap { pointer-events: auto; cursor: pointer; text-shadow: none; color: #3a2a1a; background: var(--v-parch); border: 3px solid var(--v-wood2); border-radius: 10px; padding: 4px 12px 6px; box-shadow: 0 4px 0 #0006; }
.lbl.tap::after { content: ''; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: var(--v-wood2); }
.lbl.tap small { display: block; margin: 4px auto 0; width: max-content; background: #4a8a3a; color: #fff; border: 2px solid #2a4a1e; border-radius: 6px; padding: 2px 10px; font-size: 18px; }
/* 1C: belépési felirat */
#area { position: fixed; left: 0; right: 0; top: calc(var(--hud-h) + 30px); z-index: 2; text-align: center; pointer-events: none; opacity: 0; color: #fff; text-shadow: 2px 0 0 #1c140c, -2px 0 0 #1c140c, 0 2px 0 #1c140c, 0 -2px 0 #1c140c, 2px 2px 0 #1c140c, -2px 2px 0 #1c140c, 2px -2px 0 #1c140c, -2px -2px 0 #1c140c; }
#area b { display: block; font-weight: 400; font-size: 46px; letter-spacing: 1px; }
#area span { display: block; font-size: 22px; color: #f0dfa0; margin-top: -4px; }
#area.show { animation: areaIn 3.2s ease forwards; }
@keyframes areaIn { 0% { opacity: 0; transform: translateY(-8px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
/* 3A + 2C: kerek pergamen minitérkép, alatta a negyed neve */
#mini { position: fixed; right: max(12px, env(safe-area-inset-right)); top: calc(var(--hud-h) + 8px); z-index: 2; width: 156px; text-align: center; }
#miniC { width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--v-wood); box-shadow: 0 0 0 2px #3e2414, inset 0 0 0 3px #c9b48a; background: #e8dcc0; image-rendering: pixelated; cursor: pointer; display: block; margin: 0 auto; }
#miniQ { display: inline-block; margin-top: -10px; position: relative; background: #7a5030; color: #f8ecd0; border: 2px solid #3e2414; border-radius: 4px; padding: 0 12px; font-size: 19px; }
#miniQ:empty { display: none; }
/* nagy térkép: felül fekvő, nagy térkép, alatta oszlopokban a negyedek és épületek listája */
#bigmap { position: fixed; inset: 0; z-index: 20; display: none; background: rgba(20,14,8,0.62); align-items: center; justify-content: center; padding: 12px; }
#bigmap.on { display: flex; }
#bmBox { display: flex; flex-direction: column; gap: 10px; width: min(1280px, 100%); height: min(900px, 100%); background: var(--v-parch); border: 5px solid var(--v-wood); box-shadow: 0 0 0 3px #3e2414, 0 8px 0 #0008; border-radius: 8px; padding: 12px; position: relative; color: var(--v-ink); }
#bmMap { flex: none; height: 60%; min-height: 0; position: relative; background: #e2d4b2; border: 3px solid #a08860; border-radius: 4px; }
#bmMap canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: pointer; }
#bmList { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; align-content: start; }
#bmList h3 { margin-top: 0; }
#bmList h3 { margin: 10px 0 4px; font-weight: 400; font-size: 26px; color: #fff; text-shadow: 2px 0 0 #1c140c, -2px 0 0 #1c140c, 0 2px 0 #1c140c, 0 -2px 0 #1c140c; padding: 0 8px; border-radius: 4px; }
#bmList h3 small { font-size: 17px; color: #fff0c0; margin-left: 6px; }
.bmI { display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 8px; align-items: start; padding: 5px 6px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.bmI:hover, .bmI.sel { background: #fff5d8; border-color: #c9a66c; }
.bmI i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 17px; border: 2px solid #2a1a10; }
.bmI b { font-weight: 400; font-size: 21px; line-height: 1.05; color: #3a2a1a; }
.bmI span { grid-column: 2 / 4; font-size: 16px; line-height: 1.1; color: #6a5236; }
.bmI button { font: inherit; font-size: 16px; background: #4a8a3a; color: #fff; border: 2px solid #2a4a1e; border-radius: 4px; padding: 0 8px; cursor: pointer; visibility: hidden; }
.bmI.sel button, .bmI:hover button, .touch .bmI button { visibility: visible; }
#bmClose { position: absolute; right: -14px; top: -14px; width: 34px; height: 34px; border-radius: 50%; background: #7a5030; color: #f8ecd0; border: 3px solid #3e2414; font: inherit; font-size: 22px; cursor: pointer; line-height: 1; }
#bmHelp { position: absolute; left: 14px; bottom: -30px; color: #f1e6cc; font-size: 17px; text-shadow: 1px 1px 0 #000; }
.touch #bmHelp { display: none; }
@media (max-width: 760px) { #bmBox { height: 100%; } #bmMap { height: 46%; } #bmClose { right: -6px; top: -6px; } }
/* beállítások */
#btn-set { font-size: 20px; min-width: 44px; }
#set { position: fixed; z-index: 21; right: max(12px, env(safe-area-inset-right)); top: calc(var(--hud-h) + 8px); display: none; width: min(340px, 92vw); max-height: calc(100dvh - var(--hud-h) - 20px); overflow-y: auto; color: var(--v-ink);
  background: var(--v-parch); border: 4px solid var(--v-wood2); border-radius: 8px; padding: 10px 14px; font-size: 20px; box-shadow: 0 5px 0 #0006; }
#set.on { display: block; } #set h2 { margin: 0 0 6px; font-weight: 400; font-size: 26px; }
#set label { display: flex; align-items: center; gap: 8px; margin: 4px 0; cursor: pointer; } #set input[type=checkbox] { width: 20px; height: 20px; accent-color: #4a8a3a; }
#set input[type=range] { flex: 1; accent-color: #7a5030; }
#set select, #set button { font: inherit; font-size: 18px; color: var(--v-ink); }
#set details { font-size: 16px; margin-top: 6px; } #set summary { cursor: pointer; } #set details p { margin: 4px 0; }
#fade { position: fixed; inset: 0; z-index: 30; background: #0d0a08; opacity: 0; pointer-events: none; transition: opacity .22s; }
#fade.on { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 60px); transform: translateX(-50%); z-index: 9; background: #3a2a1aee; color: #f8ecd0; padding: 6px 16px; border-radius: 6px; font-size: 20px; display: none; max-width: 92vw; text-align: center; }
/* akadálymentesség: nagyobb betű, erős kontraszt, jól olvasható betű */
#say, #dlg, #hint, #mini, #bmBox, #area, #labels .lbl, #toast, #set { zoom: var(--ui, 1); }
.hc #labels .lbl { background: #000d; padding: 2px 6px; border-radius: 4px; }
.hc #say, .hc #dlg, .hc #bmBox { background: #fffdf6; border-color: #000; }
.hc #say span, .hc #dlgP, .hc .bmI span { color: #000; }
.rf #say span, .rf #dlgP, .rf .bmI span, .rf .bmI b, .rf #toast, .rf #set label, .rf .tasksheet, .rf .page .pg-body { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; }
.rf #say span, .rf #dlgP, .rf .bmI span, .rf .bmI b, .rf #toast, .rf #set label { font-size: 0.82em; }
/* telefon: virtuális joystick bal alul, Térkép gomb jobb alul (csak érintőképernyőn), a menüsáv fölött */
#joy, #tBtns { display: none; }
.touch #joy { display: block; position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: calc(var(--nav-h) + 18px); z-index: 2; width: 128px; height: 128px; border-radius: 50%; background: #f1e6cc55; border: 3px solid #4a2e18aa; touch-action: none; }
#joyK { position: absolute; left: 39px; top: 39px; width: 50px; height: 50px; border-radius: 50%; background: var(--v-parch); border: 3px solid var(--v-wood2); box-shadow: 0 3px 0 #0005; }
.touch #tBtns { display: flex; position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--nav-h) + 22px); z-index: 2; flex-direction: column; align-items: center; gap: 12px; }
#tBtns button { font: inherit; border: 3px solid #3e2414; box-shadow: 0 4px 0 #0006; cursor: pointer; touch-action: manipulation; }
#bMap { width: 64px; height: 50px; border-radius: 10px; background: var(--v-parch); color: var(--v-ink); font-size: 19px; }
.touch #say { bottom: calc(var(--nav-h) + 160px); } .touch #toast { bottom: calc(var(--nav-h) + 160px); }
@media (max-width: 600px) { #miniC { width: 104px; height: 104px; border-width: 4px; } #mini { width: 112px; } #miniQ { font-size: 16px; } #area b { font-size: 32px; } #area span { font-size: 18px; } }
/* keskeny telefonon a felső sor ne törjön két sorba: a címer mellől a felirat, a fiókgombról a név lekerül (a Profilban megvan) */
@media (max-width: 420px) { body:not(.in-title) .brand > div, #btn-account span { display: none; } body:not(.in-title) .brand { padding: 6px 8px 8px; } }
/* ---------- beállítások: lapok (Hang · Megjelenés · Irányítás) ---------- */
#set .set-h { display: flex; align-items: center; justify-content: space-between; } #sClose { background: none; border: none; cursor: pointer; font-size: 22px; padding: 0 4px; }
.set-tabs { display: flex; gap: 4px; margin: 2px 0 10px; border-bottom: 3px solid var(--v-wood2); }
.set-tabs button { flex: 1; font: inherit; font-size: 17px; padding: 5px 4px 6px; cursor: pointer; background: #e2d2ac; color: var(--v-ink); border: 3px solid var(--v-wood2); border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -3px; }
.set-tabs button.on { background: var(--v-parch); position: relative; z-index: 1; padding-bottom: 9px; }
#set section { display: flex; flex-direction: column; gap: 6px; } #set section[hidden] { display: none; }
#set .set-sl { gap: 10px; } #set .set-sl output { min-width: 46px; text-align: right; font-size: 18px; color: #7a5030; }
#set .set-row { display: none; }   /* a betűméret a gombokkal állítható; a rejtett választó a régi kódnak kell */
.set-seg { display: flex; gap: 6px; } .set-seg button { flex: 1; cursor: pointer; font: inherit; color: var(--v-ink); background: #e2d2ac; border: 3px solid var(--v-wood2); border-radius: 6px; padding: 2px 0 4px; }
.set-seg button:nth-child(1) { font-size: 17px; } .set-seg button:nth-child(2) { font-size: 22px; } .set-seg button:nth-child(3) { font-size: 28px; }
.set-seg button.on { background: #4a8a3a; color: #fff; border-color: #2a4a1e; }
.set-prev { margin: 0; font-size: 16px; color: #7a5030; } .set-prev span { display: block; color: var(--v-ink); font-size: 19px; background: #fff8e4; border: 2px dashed #c9a66c; border-radius: 6px; padding: 4px 8px; margin-top: 2px; }
.rf .set-prev span { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; font-size: 16px; }
.set-note { margin: 2px 0; font-size: 16px; color: #7a5030; }
.set-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; font-size: 17px; align-items: center; } .set-keys dd { margin: 0; }
.set-keys kbd { font-family: inherit; font-size: 15px; padding: 0 6px 1px; margin-right: 2px; border: 2px solid var(--v-wood2); border-bottom-width: 4px; border-radius: 4px; background: #fff8e4; }
.set-btn { font: inherit; font-size: 18px; cursor: pointer; align-self: flex-start; background: #e2d2ac; border: 3px solid var(--v-wood2); border-radius: 6px; padding: 3px 12px 5px; }
