@import url("/css/window-profile.css");
@import url("/css/chat.css");
@import url("/css/mail.css");

:root {
  --bg-deep: #2d2015;
  --bg-mid: #5a3f2a;
  --accent-a: #d7b37a;
  --accent-b: #8c3d1f;
  --panel: rgba(31, 20, 12, 0.86);
  --text: #f3e1c2;
  --muted: #d8bf93;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Alegreya", serif;
  color: var(--text);
  cursor: url('/res/ui/hand1.cur'), url('/res/ui/hand1.gif'), auto;
  background: #362517 url("/res/startseite/full_bg.jpg") center/cover no-repeat fixed;
  overflow: hidden;
}

body.game-active {
  background-image: url("/res/bg/gameborder/defaultBorder_de.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.game-active .bg-shape {
  display: none;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
  opacity: 0.4;
}

body:not(.game-active) .bg-shape {
  display: none;
}

.shape-a {
  width: 260px;
  height: 260px;
  background: #d95c4a;
  top: -60px;
  right: 20px;
  animation: driftA 12s ease-in-out infinite;
}

.shape-b {
  width: 220px;
  height: 220px;
  background: #f2c572;
  bottom: 40px;
  left: -50px;
  animation: driftB 14s ease-in-out infinite;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1120px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(242, 197, 114, 0.2);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  animation: riseIn 0.65s ease both;
}

.hero {
  grid-column: span 12;
  display: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.auth {
  grid-column: span 12;
}

.game {
  grid-column: span 8;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-xp {
  grid-column: span 4;
}

.admin-panel-toggle {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 7;
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 214, 171, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(50, 30, 18, 0.92), rgba(24, 14, 8, 0.94));
  color: #f8e7cb;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.admin-xp h2 {
  margin-bottom: 10px;
}

.admin-panel-copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.admin-xp-field {
  display: grid;
  gap: 5px;
  font-size: 14px;
  color: var(--muted);
}

.admin-xp-field span {
  font-weight: 700;
  color: var(--text);
}

.admin-xp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-quest-panel-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.admin-panel-section {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.admin-panel-section > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border-radius: 8px;
}

.admin-panel-section > summary::-webkit-details-marker {
  display: none;
}

.admin-panel-section > summary::after {
  content: "+";
  font-size: 14px;
  line-height: 1;
  color: #f8e7cb;
}

.admin-panel-section[open] > summary::after {
  content: "-";
}

.admin-panel-section[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.admin-panel-section > form,
.admin-panel-section > div {
  padding: 10px 12px 12px;
}

.admin-quest-form textarea,
.admin-quest-form select,
.admin-quest-form input[type="text"],
.admin-quest-form input[type="number"] {
  width: 100%;
}

.admin-quest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-quest-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.admin-quest-status {
  min-height: 20px;
  margin: 0;
  color: #cfe7c0;
}

.admin-quest-status.is-error {
  color: #ffb1b1;
}

.admin-quest-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-quest-list-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-quest-list-item header,
.admin-quest-list-item footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-quest-list-item p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-quest-list-item footer {
  color: var(--muted);
  font-size: 12px;
}

.admin-quest-list-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-quest-list-actions button {
  flex: 1;
}

.admin-quest-list-empty {
  margin: 0;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: "Cinzel", serif;
  margin: 0;
  letter-spacing: 0.03em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  color: var(--accent-a);
}

.subtitle {
  color: var(--muted);
  max-width: 60ch;
}

.stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.auth-hero {
  display: none;
}

.travianer-sign {
  width: min(760px, 96vw);
  min-height: 110px;
  padding: 14px 24px 8px;
  border: 4px solid #4d2f1a;
  border-radius: 14px;
  background: linear-gradient(180deg, #e9cf9f 0%, #cba06a 100%);
  box-shadow:
    0 4px 0 #2a190d,
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255, 244, 223, 0.7);
  text-align: center;
}

.auth-integrated-sign {
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.travianer-sign-title {
  margin: 0;
  color: #4a2d18;
  font-family: "Cinzel", serif;
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  text-shadow: 0 1px 0 rgba(255, 236, 201, 0.8);
}

.travianer-sign-sub {
  margin: 4px 0 0;
  color: #5f3a20;
  font-size: clamp(0.74rem, 1vw, 0.94rem);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.travianer-auth {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  min-height: 100vh;
}

.travianer-auth-shell {
  position: relative;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
}

.travianer-auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px solid #4f321d;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 243, 214, 0.3) 0%, rgba(255, 243, 214, 0) 34%),
    linear-gradient(180deg, rgba(225, 194, 145, 0.98) 0%, rgba(188, 149, 92, 0.98) 100%),
    url("/res/startseite/middle_bg.jpg") center/cover no-repeat;
  box-shadow:
    0 6px 0 #2b190e,
    0 22px 42px rgba(0, 0, 0, 0.46),
    inset 0 2px 0 rgba(255, 246, 227, 0.76);
  z-index: 0;
}

.travianer-auth-shell::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  border: 2px solid rgba(104, 63, 30, 0.55);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 197, 0.42);
  z-index: 1;
  pointer-events: none;
}

.travianer-auth-header,
.travianer-auth-body {
  position: relative;
  z-index: 2;
}

.travianer-auth-header {
  display: flex;
  justify-content: center;
  padding: 20px 28px 8px;
  border-bottom: 1px solid rgba(110, 70, 36, 0.28);
}

.travianer-auth-body {
  min-height: 0;
  height: 100%;
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
}

.auth-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: min(940px, 100%);
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  align-items: start;
}

.auth-card {
  margin-top: 0;
  padding: 22px 22px 20px;
  border: 2px solid #7b4e2b;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(244, 226, 187, 0.93) 0%, rgba(219, 188, 139, 0.93) 100%),
    url("/res/startseite/stripe.jpg") center/cover no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 221, 0.7),
    inset 0 -2px 0 rgba(96, 58, 26, 0.24),
    0 5px 14px rgba(43, 23, 10, 0.22);
}

.auth-card.stack {
  gap: 12px;
  align-content: start;
}

.auth-card h2 {
  color: #4b2c18;
  font-size: 1.82rem;
  text-align: center;
}

.auth-card-copy {
  margin: 0;
  text-align: center;
  color: #644027;
  font-size: 1.05rem;
  font-weight: 700;
}

.auth-label {
  color: #5a3921;
  font-weight: 700;
  font-size: 0.96rem;
}

.travianer-auth input,
.travianer-auth select {
  color: #3f2514;
  background: #f7edd9;
  border: 2px solid #91633e;
  border-radius: 8px;
  min-height: 48px;
  padding: 10px 12px;
  font-weight: 500;
  font-size: 1rem;
}

.travianer-auth input::placeholder {
  color: #8a6a4a;
}

.travianer-auth button {
  border: 2px solid #5f2f18;
  border-radius: 9px;
  background: linear-gradient(180deg, #b4552b 0%, #7f2f16 100%);
  color: #f9e7cb;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 #3a1a0c;
  min-height: 50px;
}

.travianer-auth button.secondary {
  background: linear-gradient(180deg, #be5d31 0%, #8e3418 100%);
}

.travianer-auth button:hover {
  filter: brightness(1.08);
}

.auth-race-preview {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  min-height: 92px;
  margin-top: 2px;
}

.auth-race-preview img {
  width: auto;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(34, 18, 10, 0.35));
}

.travianer-auth .message {
  margin: 12px auto 0;
  min-height: 22px;
  width: min(940px, 100%);
  color: #4c220f;
  font-weight: 700;
  text-align: center;
}

.auth-origin-fieldset {
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid rgba(103, 62, 29, 0.36);
  border-radius: 10px;
  background: rgba(248, 234, 202, 0.55);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.auth-origin-fieldset .auth-label {
  grid-column: 1 / -1;
}

.auth-origin-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 124px;
  padding: 12px 8px 10px;
  border: 1px solid #93653d;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(253, 242, 216, 0.92) 0%, rgba(225, 194, 145, 0.92) 100%);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.auth-origin-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-origin-art {
  width: 100%;
  min-height: 70px;
  display: grid;
  place-items: center;
}

.auth-origin-art img {
  max-height: 62px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 0 rgba(34, 18, 10, 0.3));
}

.auth-origin-name {
  font-family: "Cinzel", serif;
  color: #522f1a;
  width: 100%;
  font-size: 0.76rem;
  font-weight: 700;
  align-self: start;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-origin-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.auth-origin-card.is-selected {
  border-color: #6a3017;
  background: linear-gradient(180deg, #fef2d8 0%, #e0aa61 100%);
  box-shadow: 0 0 0 2px rgba(111, 49, 21, 0.45), 0 4px 8px rgba(54, 28, 13, 0.28);
}

input,
select,
button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

input,
select {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

button {
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent-b), var(--accent-a));
  color: #20190f;
  font-weight: 700;
}

button.secondary {
  background: linear-gradient(90deg, #5cb9bb, #9de0d0);
}

.message {
  min-height: 20px;
  color: #ffd8ce;
}

body.game-active #auth-message {
  position: fixed;
  left: 50%;
  bottom: max(102px, calc(var(--map-top, 12.4vh) + var(--map-height, 73.2vh) - 28px));
  transform: translateX(-50%);
  z-index: 19;
  min-height: 0;
  margin: 0;
  padding: 3px 10px;
  border: 1px solid #80511f;
  border-radius: 2px;
  background: linear-gradient(180deg, #f9efdc 0%, #e9d1a4 100%);
  color: #4b2d0d;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 242, 204, 0.75);
  box-shadow: 0 1px 0 rgba(53, 29, 8, 0.62), inset 0 1px 0 rgba(255, 247, 228, 0.8);
  pointer-events: none;
  white-space: nowrap;
  max-width: min(75vw, 760px);
  overflow: hidden;
  text-overflow: ellipsis;
}

body.game-active #auth-message:empty {
  display: none;
}

.map-calibration-layer {
  position: fixed;
  left: var(--map-left, 6.2vw);
  top: var(--map-top, 12.4vh);
  width: var(--map-width, 66.8vw);
  height: var(--map-height, 73.2vh);
  overflow: visible;
  border-radius: 0;
  z-index: 3;
  background: transparent;
}

.admin-window-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.admin-window-actions button.is-active {
  box-shadow: 0 0 0 2px rgba(255, 223, 128, 0.5) inset;
}


#game-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: #04090b;
}

.game-hover-tooltip {
  position: fixed;
  transform: translate(0, -100%);
  z-index: 30;
  display: none;
  max-width: min(70vw, 520px);
  padding: 3px 8px;
  border: 1px solid #80511f;
  border-radius: 2px;
  background: linear-gradient(180deg, #f9efdc 0%, #e9d1a4 100%);
  color: #4b2d0d;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 242, 204, 0.75);
  box-shadow: 0 1px 0 rgba(53, 29, 8, 0.62), inset 0 1px 0 rgba(255, 247, 228, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.game-hover-tooltip.is-visible {
  display: block;
}

/* Phaser DOM overlay container — must not intercept pointer events */
#game-map > div {
  pointer-events: none !important;
}

/* Interactive NPC dialogue must stay clickable inside Phaser DOM overlay. */
#game-map > div .npc-dialogue-senkel,
#game-map > div .npc-dialogue-senkel * {
  pointer-events: auto !important;
}

.house-editor-html-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(242, 212, 147, 0.85);
  border-radius: 50%;
  background: rgba(42, 23, 9, 0.58) url("/res/buttons/Icon_editor.gif") center/20px no-repeat;
  cursor: pointer;
  z-index: 20;
  pointer-events: all;
  box-shadow: 0 0 4px rgba(242, 212, 147, 0.5);
  transition: filter 0.1s;
}
.house-editor-html-btn img {
  display: none;
}
.house-editor-html-btn:hover {
  filter: brightness(1.15);
}
.house-editor-html-btn.is-active {
  border-color: #f2d493;
  box-shadow: 0 0 6px rgba(242, 212, 147, 0.9);
}

/* ── Möbel-Editor HTML Panel ───────────────────────── */
.house-editor-panel {
  position: absolute;
  top: 45px;
  right: 0;
  width: 290px;
  min-height: 580px;
  z-index: 20;
  background-image: url("/res/ui/interface_editor_right1.gif"), url("/res/ui/interface_editor_right2.gif");
  background-repeat: no-repeat, no-repeat;
  background-position: right top, 16px 95px;
  font-family: "Trebuchet MS", sans-serif;
  user-select: none;
  box-shadow: none;
  pointer-events: all;
}

.hep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px 42px;
  background: transparent;
  border-bottom: none;
  cursor: grab;
  border-radius: 0;
}
.hep-header:active {
  cursor: grabbing;
}

.hep-title {
  color: #f3e1b2;
  font-size: 16px;
  font-weight: 700;
  text-shadow: -1px -1px 0 #5c3310, 1px -1px 0 #5c3310, -1px 1px 0 #5c3310, 1px 1px 0 #5c3310;
}

.hep-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hep-sell {
  border: 1px solid #9f6f2f;
  background: rgba(243, 223, 188, 0.9);
  color: #5b3817;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
  line-height: 1.4;
}

.hep-sell:hover {
  filter: brightness(1.08);
}

.hep-sell.is-active {
  background: #b74a2d;
  border-color: #7f2c18;
  color: #fff4e8;
}

.hep-close {
  background: none;
  border: none;
  color: #7d4a1b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  text-shadow: 0 0 1px #f1ddb8;
}
.hep-close:hover {
  color: #5b2f0f;
}

.hep-tabs-row {
  display: flex;
  padding: 0 34px 0 34px;
  gap: 3px;
  background: transparent;
  border-bottom: none;
}

.hep-tabs-row + .hep-tabs-row {
  margin-top: 1px;
}

.hep-tab {
  flex: 1;
  padding: 2px 3px;
  font-size: 9px;
  font-weight: 600;
  color: #c4946a;
  background: #c8a470;
  border: 1px solid #aa8450;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hep-tab.is-active {
  background: #f3dfbc;
  color: #5b3817;
  font-weight: 700;
  border-color: #9b6d2f;
}

.hep-content {
  background: transparent;
  border-top: none;
  min-height: 420px;
}

.hep-section {
  padding: 36px 20px 0 36px;
}

.hep-section-bar {
  background: #cf9b4f;
  border: 1px solid #9f6f2f;
  color: #f8edd2;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  margin-bottom: 4px;
}

.hep-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hep-list-item {
  text-align: left;
  background: none;
  border: none;
  color: #4f3618;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 2px;
  font-family: "Trebuchet MS", sans-serif;
}
.hep-list-item:hover,
.hep-list-item.is-active {
  color: #2f7a38;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.07);
}

.hep-fussboden-tools {
  padding: 2px 0;
}

/* ── Generic item row (floor tiles, furniture, etc.) ── */
.hep-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  cursor: pointer;
  border-bottom: 1px solid rgba(120, 80, 30, 0.25);
  transition: background 0.1s;
}
.hep-item-row:first-child {
  border-top: 1px solid rgba(120, 80, 30, 0.25);
}
.hep-item-row:hover {
  background: rgba(200, 160, 80, 0.18);
}
.hep-item-row.is-active {
  background: rgba(100, 160, 80, 0.22);
  outline: 1px solid #2f7a38;
  outline-offset: -1px;
}

.hep-item-thumb {
  image-rendering: pixelated;
  flex-shrink: 0;
  max-height: 40px;
  max-width: 64px;
  width: auto;
  height: auto;
}

.hep-item-name {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  color: #3b2208;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hep-item-price {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #3b2208;
  white-space: nowrap;
  flex-shrink: 0;
}

.hep-sp-icon {
  height: 12px;
  width: auto;
  vertical-align: middle;
  image-rendering: pixelated;
}

.hep-placeholder {
  color: #9a7a5a;
  font-size: 11px;
  text-align: center;
  padding: 10px;
  margin: 0;
}

.hep-shape-editor {
  margin: 8px 54px 10px 36px;
  border: 1px solid rgba(120, 80, 30, 0.45);
  border-radius: 4px;
  background: rgba(248, 232, 202, 0.72);
}

.hep-shape-editor > summary {
  cursor: pointer;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #4f3618;
  user-select: none;
}

.hep-shape-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
}

.hep-shape-editor-info {
  margin: 0;
  padding: 4px 7px 0;
  font-size: 10px;
  font-weight: 700;
  color: #5b3817;
}

.hep-shape-editor-actions button {
  border: 1px solid #9f6f2f;
  border-radius: 3px;
  background: rgba(243, 223, 188, 0.92);
  color: #5b3817;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 4px;
  line-height: 1.2;
}

.hep-shape-editor-actions button:hover {
  filter: brightness(1.05);
}

.hep-shape-editor-actions button.is-active {
  background: #2f7a38;
  border-color: #245d2b;
  color: #fff5db;
}

.hep-shape-editor-row {
  display: flex;
  gap: 6px;
  padding: 4px 7px;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #5b3817;
}

.hep-location-btn {
  border: 1px solid #9f6f2f;
  border-radius: 3px;
  background: rgba(243, 223, 188, 0.92);
  color: #5b3817;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  min-width: 28px;
}

.hep-location-btn:hover {
  filter: brightness(1.05);
}

.hep-location-btn.is-active {
  background: #d4a574;
  border-color: #9f6f2f;
  color: #fff5db;
}

#game-map canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  image-rendering: crisp-edges;
}

.ui-interface-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 255px;
  height: 115px;
  z-index: 8;
  pointer-events: none;
  image-rendering: pixelated;
}

.ui-bottom-player {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 255px;
  height: 115px;
  z-index: 9;
  pointer-events: none;
}

.ui-player-profile-pic {
  position: absolute;
  bottom: 38px;
  left: 11px;
  width: 75px;
  height: 75px;
  border: 2px solid rgba(242, 197, 114, 0.4);
  border-radius: 4px;
  image-rendering: pixelated;
  object-fit: cover;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.ui-player-profile-pic:hover {
  filter: drop-shadow(0 0 4px rgba(255, 219, 120, 0.6));
}

.ui-bottom-wallet {
  position: absolute;
  bottom: 60px;
  left: 75px;
  width: 160px;
  height: 22px;
  z-index: 8;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

.ui-bottom-shortcuts {
  position: absolute;
  bottom: 83px;
  left: 101px;
  width: 158px;
  height: 30px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  pointer-events: none;
  overflow: visible;
}

.ui-bottom-cogbar {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: transform 240ms ease, opacity 170ms ease, visibility 0s linear;
  pointer-events: none;
  z-index: 8;
}

.ui-bottom-cogbar-left {
  bottom: 103px;
  transform: translateY(140px);
}

.ui-bottom-cogbar-1 {
  left: 101px;
}

.ui-bottom-cogbar-2 {
  left: 135px;
}

.ui-bottom-cogbar-3 {
  left: 169px;
}

.ui-bottom-cogbar-left.is-open {
  bottom: 100px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.ui-bottom-cogbar-image {
  display: block;
  width: 30px;
  height: auto;
  image-rendering: pixelated;
}

.ui-bottom-cogbar-actions {
  position: absolute;
  top: 2px;
  left: 0;
  width: 30px;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: auto;
}

.ui-bottom-cogbar-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: url("/res/ui/elements/button30.gif") no-repeat 0 0;
  background-size: 30px 150px;
  background-position: 0 0;
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

.ui-bottom-cogbar-btn-icon {
  width: 30px;
  height: 30px;
  display: block;
  image-rendering: pixelated;
}

.ui-bottom-cogbar-btn:hover,
.ui-bottom-cogbar-btn:focus-visible {
  background-position: 0 -30px;
}

.ui-bottom-cogbar-btn:active {
  background-position: 0 -60px;
}

.ui-bottom-cogbar-btn.is-selected {
  background-position: 0 -60px;
}

.ui-bottom-cogbar-btn.is-inactive,
.ui-bottom-cogbar-btn[aria-disabled="true"] {
  background-position: 0 -120px;
}

.ui-bottom-side-shortcuts {
  position: absolute;
  left: 246px;
  bottom: 0;
  width: 20px;
  height: 80px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  pointer-events: none;
  overflow: visible;
}

.ui-bottom-side-shortcut-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: url("/res/ui/elements/robutton20a.gif") no-repeat 0 0;
  background-size: 20px 100px;
  background-position: 0 0;
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

.ui-bottom-side-shortcut-icon {
  width: 20px;
  height: 20px;
  display: block;
  image-rendering: pixelated;
}

.ui-bottom-side-shortcut-btn:hover,
.ui-bottom-side-shortcut-btn:focus-visible {
  background-position: 0 -20px;
}

.ui-bottom-side-shortcut-btn:active {
  background-position: 0 -40px;
}

.ui-bottom-side-shortcut-btn.is-selected {
  background-position: 0 -40px;
}

.ui-bottom-side-shortcut-btn.is-inactive,
.ui-bottom-side-shortcut-btn[aria-disabled="true"] {
  background-position: 0 -80px;
}

.ui-bottom-cogbar-right {
  left: 246px;
  transform: translateX(-95px);
}

.ui-bottom-cogbar-right-1 {
  bottom: 60px;
}

.ui-bottom-cogbar-right-2 {
  bottom: 40px;
}

.ui-bottom-cogbar-right-3 {
  bottom: 20px;
}

.ui-bottom-cogbar-right-4 {
  bottom: 0;
}

.ui-bottom-cogbar-right.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.ui-bottom-cogbar-right-image {
  display: block;
  width: 115px;
  height: auto;
  image-rendering: pixelated;
}

.need-bar-track {
  position: absolute;
  top: 50%;
  left: 43px;
  right: 5px;
  height: 6px;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
}

.need-bar-fill {
  height: 6px;
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 1px;
  background-repeat: repeat-x;
  background-size: 1px 6px;
  image-rendering: pixelated;
}

.ui-bottom-shortcut-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: url("/res/ui/elements/robutton30a.gif") no-repeat 0 0;
  background-size: 30px 150px;
  background-position: 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
}

.ui-bottom-shortcut-icon {
  width: 30px;
  height: 30px;
  display: block;
  image-rendering: pixelated;
}

.ui-bottom-shortcut-btn:hover,
.ui-bottom-shortcut-btn:focus-visible {
  background-position: 0 -30px;
}

.ui-bottom-shortcut-btn:active {
  background-position: 0 -60px;
}

.ui-bottom-shortcut-btn.is-selected {
  background-position: 0 -60px;
}

.ui-bottom-shortcut-btn.is-inactive,
.ui-bottom-shortcut-btn[aria-disabled="true"] {
  background-position: 0 -120px;
}

.attribute-notifier {
  position: absolute;
  left: 18px;
  bottom: 140px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: url("/res/ui/elements/button40.gif") no-repeat 0 0;
  background-size: 40px 200px;
  background-position: 0 0;
  cursor: pointer;
  z-index: 17;
  overflow: visible;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-140px) translateY(6px) scale(0.84);
  transform-origin: center left;
}

.attribute-notifier-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  display: block;
  image-rendering: pixelated;
}

.attribute-notifier-badge {
  position: absolute;
  right: -3px;
  top: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff7e7;
  background: linear-gradient(180deg, #c44d18, #7f2810);
  border: 1px solid #f4d7ab;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.32);
}

.attribute-notifier.has-points {
  animation: attribute-notifier-idle 1.3s ease-in-out infinite;
}

.attribute-notifier.is-flying {
  opacity: 1;
  visibility: visible;
  animation: attribute-notifier-fly-in 640ms cubic-bezier(0.2, 0.8, 0.2, 1) 1;
  animation-fill-mode: both;
}

.attribute-notifier:not([hidden]):not(.is-flying) {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) translateY(0) scale(1);
}

.attribute-notifier:hover,
.attribute-notifier:focus-visible {
  background-position: 0 -40px;
}

.attribute-notifier:active {
  background-position: 0 -80px;
}

@keyframes attribute-notifier-fly-in {
  0% {
    transform: translateX(-140px) translateY(6px) scale(0.84);
    opacity: 0;
  }
  68% {
    transform: translateX(8px) translateY(0) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes attribute-notifier-idle {
  0%,
  100% {
    transform: translateX(0) translateY(0) scale(1);
  }
  50% {
    transform: translateX(0) translateY(-3px) scale(1.02);
  }
}

.ui-wallet-entry {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ui-wallet-value {
  min-width: 16px;
  text-align: right;
  color: #f5f5f5;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.ui-wallet-icon {
  width: 13px;
  height: 11px;
  image-rendering: pixelated;
}

.ui-bottom-points {
  position: absolute;
  bottom: 32px;
  left: 105px;
  width: 196px;
  height: 22px;
  z-index: 9;
  pointer-events: none;
  
}

.ui-bottom-bp-clock {
  position: absolute;
  left: -28px;
  top: -15px;
  width: 28px;
  height: 41px;
  image-rendering: pixelated;
  pointer-events: auto;
  cursor: help;
  z-index: 10;
}

.ui-bottom-bp-clock:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 204, 89, 0.75);
  white-space: nowrap;
  pointer-events: none;
}

.ui-bottom-point-value {
  position: absolute;
  top: 0;
  width: 58px;
  text-align: right;
  color: #f5f5f5;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 18px;
  font-weight: 300;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.ui-bottom-bp {
  left: 0;
}

.ui-bottom-ap {
  left: 70px;
}

.ui-bottom-social {
  left: 70px;
  top: 28px;
  font-size: 16px;
  color: #f7de82;
}

.ui-interface-left-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 115px;
  height: 48px;
  z-index: 8;
  pointer-events: none;
}

.ui-interface-left-top img {
  width: 115px;
  height: 48px;
  display: block;
  image-rendering: pixelated;
}


.ui-clock {
  position: absolute;
  top: 25%;
  right: 10px;
  transform: translateY(-50%);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  pointer-events: none;
  white-space: nowrap;
}

.ui-interface-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 38px;
  z-index: 8;
  pointer-events: none;
}

.ui-interface-top > img:first-child {
  width: 400px;
  height: 38px;
  display: block;
  image-rendering: pixelated;
}

.ui-interface-right-top-res {
  position: absolute;
  top: 0;
  right: 0;
  width: 270px;
  height: 176px;
  z-index: 8;
  pointer-events: none;
}

.ui-interface-right-top-res > img:first-child {
  width: 270px;
  height: 176px;
  display: block;
  image-rendering: pixelated;
}

.ui-storage-container {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 8px;
  pointer-events: none;
}

.ui-storage-capacity {
  position: absolute;
  top: 5px;
  left: 18px;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 12px;
  white-space: nowrap;
}

.ui-storage-capacity-label {
  color: #6a3d12;
}

.ui-storage-capacity-value {
  color: #000000;
}

.ui-storage-value {
  position: absolute;
  width: 70px;
  text-align: right;
  color: #000000;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 13px;
  text-shadow: none;
  white-space: nowrap;
}

.ui-storage-wood {
  right: 150px;
  top: 25px;
}

.ui-storage-kohler {
  right: 22px;
  top: 25px;
}

.ui-storage-clay {
  right: 150px;
  top: 52px;
}

.ui-storage-boards {
  right: 22px;
  top: 52px;
}

.ui-storage-iron-ore {
  right: 150px;
  top: 79px;
}

.ui-storage-bricks {
  right: 22px;
  top: 79px;
}

.ui-storage-crop {
  right: 150px;
  top: 106px;
}

.ui-storage-iron {
  right: 22px;
  top: 106px;
}

.ui-storage-flour {
  right: 150px;
  top: 133px;
}

.ui-storage-bread {
  right: 22px;
  top: 133px;
}

.ui-top-player-name,
.ui-top-level,
.ui-top-age {
  position: absolute;
  color: #fff;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.ui-top-name-row {
  position: absolute;
  top: 6px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ui-top-generation-icon {
  position: static;
  width: 23px;
  height: 12px;
  image-rendering: pixelated;
  pointer-events: none;
}

.ui-top-player-name {
  position: static;
  font-size: 12px;
}

.ui-top-level {
  top: 20px;
  right: 22px;
  font-size: 11px;
}

.ui-top-age {
  top: 6px;
  right: 22px;
  font-size: 11px;
  z-index: 1;
}

.ui-top-age-bar {
  position: absolute;
  top: 9px;
  left: 200px;
  right: 64px;
  height: 5px;
  overflow: visible;
  pointer-events: auto;
}

.ui-top-age-fill {
  width: 0%;
  height: 100%;
  background-image: url('/res/ui/elements/bars/agebar.gif');
  background-repeat: repeat-x;
  background-size: auto 5px;
  image-rendering: pixelated;
}

.ui-top-xp {
  position: absolute;
  top: 23px;
  left: 8px;
  right: 64px;
  height: 5px;
  overflow: visible;
  pointer-events: auto;
}

.ui-top-xp-fill {
  width: 0%;
  height: 100%;
  background-image: url('/res/ui/elements/bars/levelbar.gif');
  background-repeat: repeat-x;
  background-size: auto 5px;
  image-rendering: pixelated;
}

.ui-bottom-bp-clock:hover::after,
.ui-top-age-bar:hover::after,
.ui-top-xp:hover::after {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  z-index: 35;
  padding: 3px 8px;
  border: 1px solid #80511f;
  border-radius: 2px;
  color: #4b2d0d;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 242, 204, 0.75);
  background: linear-gradient(180deg, #f9efdc 0%, #e9d1a4 100%);
  box-shadow: 0 1px 0 rgba(53, 29, 8, 0.6), inset 0 1px 0 rgba(255, 247, 228, 0.8);
  white-space: nowrap;
  pointer-events: none;
}

.ui-bottom-bp-clock:hover::after {
  content: attr(data-tooltip);
  bottom: 46px;
}

.ui-top-age-bar:hover::after {
  content: attr(data-age);
}

.ui-top-xp:hover::after {
  content: attr(data-xp);
}

.hidden {
  display: none;
}

.logout-btn {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 9;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("/res/exit.gif");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

body.game-active .layout {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  max-width: none;
  display: block;
}


body.game-active .admin-xp {
  position: fixed;
  left: 0;
  top: var(--admin-top, 120px);
  right: calc(100vw - var(--map-left, 320px));
  width: auto;
  min-width: 0;
  z-index: 4;
  border-radius: 0 10px 10px 0;
  max-height: var(--admin-max-height, 60vh);
  overflow-y: auto;
  overflow-x: hidden;
}

body.game-active .admin-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.game-active .admin-xp .stack {
  margin-top: 0;
}

body.game-active .logout-btn {
  display: inline-block;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-35px, 22px);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(28px, -14px);
  }
}

@media (max-width: 960px) {
  .auth-columns {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .travianer-auth {
    padding: 12px;
    min-height: 0;
  }

  .auth-race-preview img {
    height: 78px;
  }

  .auth-origin-fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-origin-art {
    min-height: 62px;
  }

  .auth-origin-art img {
    max-height: 62px;
  }
}

@media (max-width: 560px) {
  .travianer-sign {
    padding: 0 0 10px;
    min-height: 0;
  }

  .travianer-auth-shell {
    min-height: 100vh;
    margin-top: 0;
  }

  .travianer-auth-shell::before {
    inset: 0;
  }

  .travianer-auth-shell::after {
    top: 10px;
  }

  .auth-integrated-sign {
    width: min(92vw, 760px);
  }

  .travianer-auth-body {
    padding: 18px 14px 16px;
    min-height: 0;
  }

  .auth-card {
    padding: 12px;
  }
}

@media (max-width: 920px) {
  .hero,
  .auth,
  .game,
  .admin-xp {
    grid-column: span 12;
  }

  .layout {
    width: min(680px, 94vw);
    margin: 0 auto;
  }

  .auth-columns {
    min-height: auto;
  }

  body.game-active .admin-xp {
    left: 12px;
    right: 12px;
    top: 58px;
    width: auto;
    min-width: 0;
    max-height: 44vh;
  }

  body.game-active .admin-panel-toggle {
    left: 12px;
    top: 12px;
  }

}
