/* InnoSiedel – Oberfläche */
:root {
  --wood: #3b2614; --wood2: #57391d; --wood3: #6d4824;
  --parch: #efe2c2; --parch2: #e2d0a6; --ink: #2b1d0e; --ink2: #5a4327;
  --gold: #d9a53b; --gold2: #f3cf6b; --red: #a8352a; --green: #4f7a2c; --blue: #2f5e9e;
  --shadow: 0 6px 22px rgba(0, 0, 0, .45);
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #120c06; color: var(--parch); font-family: var(--font); overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; overflow: hidden; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; outline: none; }
#c.road { cursor: crosshair; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ------------------------------------------------ Laden */
#boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at 50% 40%, #3a2814 0%, #120c06 70%); z-index: 100; }
#boot img { width: min(420px, 74vw); filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.boot-bar { width: min(340px, 70vw); height: 10px; border-radius: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(217,165,59,.4); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b07c2a, var(--gold2)); transition: width .2s; }
#boot p { margin: 0; color: #d8c49a; font-size: 15px; letter-spacing: .03em; }

/* ------------------------------------------------ Bildschirme (Menüs) */
#ui { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
#ui > * { pointer-events: auto; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; background: radial-gradient(ellipse at 50% 30%, rgba(40,26,10,.55), rgba(10,6,2,.9)); }
.screen.bg { background: #120c06 url() center/cover no-repeat; }
.screen .backdrop { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(1.05) brightness(.62); z-index: -1; }
.panel { position: relative; width: min(560px, 100%); max-height: calc(100% - 8px); overflow: auto; background: linear-gradient(#f3e7c9, #e6d4ab); color: var(--ink); border-radius: 10px; padding: 22px 24px; box-shadow: var(--shadow), inset 0 0 0 3px #b8955a, inset 0 0 0 5px #f6ebd0, inset 0 0 40px rgba(120,80,30,.25); }
.panel.wide { width: min(860px, 100%); }
.panel h1, .panel h2 { margin: 0 0 12px; font-weight: 700; color: #4a2d10; letter-spacing: .02em; }
.panel h2 { font-size: 24px; }
.panel h3 { margin: 16px 0 8px; font-size: 17px; color: #5b3a16; }
.panel p { line-height: 1.5; margin: 8px 0; }
.title-box { width: min(440px, 100%); text-align: center; background: linear-gradient(rgba(36,22,8,.82), rgba(24,14,4,.88)); color: var(--parch); box-shadow: var(--shadow), inset 0 0 0 2px rgba(217,165,59,.55); }
.title-box .logo { width: 100%; max-width: 360px; margin: -4px auto 6px; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }
.title-box .sub { color: #cdb88f; font-size: 14px; margin: 0 0 14px; }
.menu-list { display: flex; flex-direction: column; gap: 9px; margin: 10px 0 6px; }
.btn { appearance: none; border: 0; cursor: pointer; font-size: 16px; padding: 10px 16px; border-radius: 7px; color: #fff8e6; background: linear-gradient(#7a5126, #57361a); box-shadow: inset 0 1px 0 rgba(255,230,180,.35), 0 2px 0 #2b1a0b, 0 3px 8px rgba(0,0,0,.35); text-shadow: 0 1px 0 rgba(0,0,0,.5); transition: transform .06s, filter .1s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.5); }
.btn.big { font-size: 19px; padding: 13px 18px; }
.btn.gold { background: linear-gradient(#e6b44c, #b47c22); color: #2b1803; text-shadow: 0 1px 0 rgba(255,240,200,.5); }
.btn.red { background: linear-gradient(#b8463a, #842a20); }
.btn.green { background: linear-gradient(#6c9a3c, #47701f); }
.btn.flat { background: rgba(80,50,20,.12); color: var(--ink); box-shadow: none; text-shadow: none; }
.btn.sm { font-size: 13px; padding: 6px 10px; }
.btn.on { background: linear-gradient(#e6b44c, #b47c22); color: #2b1803; text-shadow: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: #7a6442; font-size: 14px; }
.title-box .muted { color: #b7a27a; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink2); }
select, input[type=text], input[type=number] { font: inherit; font-size: 15px; padding: 7px 9px; border-radius: 6px; border: 1px solid #b8955a; background: #fbf4e2; color: var(--ink); }
input[type=range] { width: 100%; accent-color: #9a6a26; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.pl-row { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }

/* Kampagne */
.missions { display: grid; gap: 10px; margin-top: 10px; }
.mission { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: rgba(120,80,30,.1); border: 1px solid rgba(120,80,30,.25); }
.mission .num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #8a5d27; color: #fff3d8; }
.mission.done .num { background: var(--green); }
.mission.locked { opacity: .5; }
.mission .t { font-weight: 700; }
.mission .d { font-size: 13px; color: var(--ink2); }
.story { font-size: 17px; line-height: 1.6; white-space: pre-line; }
.goals { margin: 10px 0; padding-left: 20px; }
.goals li { margin: 4px 0; }
.goals li.ok { color: var(--green); }
.goals li.ok::marker { content: '✔ '; }

/* ------------------------------------------------ Spiel-Oberfläche */
#hud { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; gap: 6px; align-items: center; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); pointer-events: none; }
#hud > * { pointer-events: auto; }
.res-bar { display: flex; gap: 2px; background: linear-gradient(rgba(40,25,10,.88), rgba(28,17,6,.88)); border-radius: 8px; padding: 3px 6px; box-shadow: 0 2px 8px rgba(0,0,0,.4), inset 0 0 0 1px rgba(217,165,59,.35); overflow: hidden; }
.res { display: flex; align-items: center; gap: 3px; font-size: 14px; color: #f3e3bd; padding: 0 5px; white-space: nowrap; }
.res .ico { width: 22px; height: 22px; object-fit: contain; }
.hud-spacer { flex: 1; }
.hud-btn { appearance: none; border: 0; cursor: pointer; width: 38px; height: 38px; border-radius: 8px; font-size: 18px; color: #f3e3bd; background: linear-gradient(rgba(70,45,20,.92), rgba(40,25,10,.92)); box-shadow: 0 2px 8px rgba(0,0,0,.4), inset 0 0 0 1px rgba(217,165,59,.4); display: grid; place-items: center; }
.hud-btn.on { background: linear-gradient(#e6b44c, #b47c22); color: #2b1803; }
.speed { font-size: 13px; width: auto; padding: 0 9px; }
#toolbar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20; display: flex; gap: 4px; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(58,38,18,.95), rgba(32,20,8,.95)); border-radius: 12px 12px 0 0; box-shadow: 0 -2px 14px rgba(0,0,0,.45), inset 0 0 0 1px rgba(217,165,59,.4); max-width: 100%; overflow-x: auto; }
.tb { appearance: none; border: 0; cursor: pointer; min-width: 52px; height: 52px; border-radius: 8px; color: #f3e3bd; background: linear-gradient(#6a4520, #46290f); box-shadow: inset 0 1px 0 rgba(255,220,160,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; padding: 2px 6px; }
.tb .i { font-size: 21px; line-height: 1; }
.tb .ico { width: 28px; height: 28px; object-fit: contain; }
.tb.on { background: linear-gradient(#e6b44c, #b47c22); color: #2b1803; }
.tb:hover { filter: brightness(1.12); }
#sitelegend { position: absolute; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 19; display: flex; gap: 12px; align-items: flex-end; padding: 5px 12px; border-radius: 10px; background: rgba(30,18,6,.95); color: #fbe8bf; font-size: 12px; line-height: 1.1; box-shadow: var(--shadow), inset 0 0 0 1px rgba(217,165,59,.45); pointer-events: none; white-space: nowrap; }
#sitelegend > span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
#sitelegend .ico { width: auto; height: calc(var(--h) * 1px); object-fit: contain; }
@media (max-width: 640px) { #sitelegend { bottom: calc(60px + env(safe-area-inset-bottom)); gap: 8px; padding: 4px 8px; font-size: 11px; } #sitelegend .ico { height: calc(var(--h) * 0.8px); } }
#banner { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); z-index: 25; background: rgba(30,18,6,.92); color: #fbe8bf; padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(217,165,59,.5); display: flex; gap: 10px; align-items: center; font-size: 15px; max-width: calc(100% - 20px); }
#msgs { position: absolute; right: 8px; top: 54px; z-index: 22; display: flex; flex-direction: column; gap: 6px; width: min(320px, 70vw); pointer-events: none; }
.msg { pointer-events: auto; cursor: pointer; background: linear-gradient(rgba(243,231,201,.96), rgba(226,208,166,.96)); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 14px; box-shadow: 0 3px 12px rgba(0,0,0,.4); border-left: 5px solid #8a5d27; animation: msgIn .25s ease-out; display: flex; gap: 8px; align-items: center; }
.msg.warn { border-left-color: var(--red); }
.msg.good { border-left-color: var(--green); }
.msg .ico { width: 28px; height: 28px; object-fit: contain; flex: none; }
@keyframes msgIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#minimap { position: absolute; left: 8px; bottom: 74px; z-index: 21; border-radius: 8px; box-shadow: var(--shadow), 0 0 0 2px #8a5d27, 0 0 0 4px rgba(30,18,6,.9); background: #000; cursor: pointer; touch-action: none; }

/* ------------------------------------------------ Fenster */
#wins { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.win { position: absolute; pointer-events: auto; background: linear-gradient(#f3e7c9, #e4d1a8); color: var(--ink); border-radius: 9px; box-shadow: var(--shadow), inset 0 0 0 2px #b8955a; max-height: calc(100% - 140px); display: flex; flex-direction: column; overflow: hidden; }
.win-head { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; background: linear-gradient(#6a4520, #46290f); color: #fbe8bf; cursor: move; touch-action: none; }
.win-title { flex: 1; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-x { width: 30px; height: 30px; padding: 0; font-size: 15px; background: rgba(0,0,0,.25); box-shadow: none; }
.win-body { padding: 10px 12px 12px; overflow: auto; font-size: 14px; }
.win-mobile { left: 6px !important; right: 6px; bottom: 74px; top: auto !important; width: auto !important; max-height: 58%; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tab { appearance: none; border: 0; cursor: pointer; padding: 6px 10px; border-radius: 6px; background: rgba(120,80,30,.15); color: var(--ink); font-size: 14px; }
.tab.on { background: #8a5d27; color: #fff3d8; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.bcell { appearance: none; border: 1px solid rgba(120,80,30,.3); background: rgba(255,250,235,.55); border-radius: 7px; cursor: pointer; padding: 5px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink); font-size: 12px; text-align: center; }
.bcell:hover { background: #fff6dc; border-color: #b8955a; }
.bcell .ico { width: 64px; height: 50px; object-fit: contain; }
.bcell .cost { font-size: 11px; color: var(--ink2); display: flex; gap: 6px; align-items: center; }
.bcell .cost .ico { width: 15px; height: 15px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0; }
.kv b { font-weight: 600; color: var(--ink2); }
.bar { height: 10px; border-radius: 5px; background: rgba(0,0,0,.12); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #6c9a3c, #a7cf5a); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
.wcell { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 5px; background: rgba(255,250,235,.5); font-size: 13px; }
.wcell .ico { width: 24px; height: 24px; object-fit: contain; flex: none; }
.wcell.zero { opacity: .45; }
.soldiers { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.sold { width: 40px; display: flex; flex-direction: column; align-items: center; font-size: 11px; }
.sold .ico { width: 34px; height: 40px; object-fit: contain; }
.hp { width: 32px; height: 4px; background: #7a2a20; border-radius: 2px; overflow: hidden; }
.hp i { display: block; height: 100%; background: #6cc04a; }
.slider-row { display: grid; grid-template-columns: 34px 1fr 28px; gap: 8px; align-items: center; margin: 4px 0; }
.slider-row .ico { width: 28px; height: 28px; object-fit: contain; }
.slider-row span { font-size: 12px; text-align: right; }
.prio-list { display: flex; flex-direction: column; gap: 2px; }
.prio-item { display: flex; gap: 6px; align-items: center; padding: 2px 4px; border-radius: 5px; background: rgba(255,250,235,.5); font-size: 13px; }
.prio-item .ico { width: 22px; height: 22px; object-fit: contain; }
.prio-item .btn { padding: 2px 8px; font-size: 12px; }
canvas.chart { width: 100%; height: 180px; background: rgba(255,250,235,.6); border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-top: 4px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 3px; vertical-align: -2px; }

/* Ende */
.endbox { text-align: center; }
.endbox .big { font-size: 34px; margin: 4px 0 8px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.stats-table td, .stats-table th { padding: 4px 6px; border-bottom: 1px solid rgba(120,80,30,.2); text-align: right; }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; }

/* Hilfe */
.help h3 { margin-top: 14px; }
.help ul { padding-left: 18px; }
.help li { margin: 4px 0; line-height: 1.45; }
kbd { background: #fff6dc; border: 1px solid #b8955a; border-radius: 4px; padding: 0 5px; font-size: 13px; }

/* Lobby */
.rooms { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 300px; overflow: auto; }
.room { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 7px; background: rgba(120,80,30,.1); }
.chat { height: 140px; overflow: auto; background: rgba(255,250,235,.6); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.chat p { margin: 2px 0; }

/* Navigation der Webseite in den Menüs */
.title-box .s05-dock, .panel .s05-dock { margin-top: 14px; }

@media (max-width: 640px) {
  .tb { min-width: 44px; height: 46px; font-size: 10px; padding: 2px 4px; }
  .tb .i { font-size: 19px; }
  .res { font-size: 12px; padding: 0 3px; }
  .res .ico { width: 18px; height: 18px; }
  .res.opt { display: none; }
  #minimap { bottom: 64px; }
  .panel { padding: 16px; }
}
