:root {
  --bg: #0b0907;
  --panel: #17120c;
  --panel-2: #1f1810;
  --line: #5a431f;
  --gold: #d8961e;
  --gold-hi: #ffc24a;
  --text: #e6d9bf;
  --muted: #9a8a6c;
  --red: #c9432d;
  --green: #86c96a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(ellipse at 50% 30%, #1a130a 0%, var(--bg) 70%);
  color: var(--text);
  font: 14px/1.4 Tahoma, Verdana, "DejaVu Sans", sans-serif;
  overflow: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0; font-weight: normal; }
button, input { font: inherit; }
button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 4px 10px; cursor: pointer; border-radius: 2px;
}
button:hover { border-color: var(--gold); color: var(--gold-hi); }
button.primary { background: #4a1408; border-color: var(--gold); color: var(--gold-hi); padding: 8px 14px; width: 100%; font-size: 15px; }
button.primary:hover { background: #63200f; }
button:disabled { opacity: .5; cursor: default; }
input {
  background: #0d0a06; color: var(--text); border: 1px solid var(--line); padding: 6px 8px; width: 100%; border-radius: 2px;
}
input:focus, button:focus-visible, canvas:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: 1px; }
kbd {
  display: inline-block; min-width: 1.6em; text-align: center; padding: 1px 5px; margin: 0 1px;
  background: #0d0a06; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; font: 12px monospace; color: var(--gold-hi);
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 4, 3, .82); padding: 16px;
}
.panel {
  background: var(--panel); border: 2px solid var(--gold); outline: 1px solid #000; box-shadow: 0 0 0 4px #2a1f0f, 0 12px 40px #000;
  padding: 22px 26px; width: 100%; max-width: 380px; text-align: center;
}
.auth-panel h1 { color: var(--gold-hi); font-size: 40px; letter-spacing: 2px; text-shadow: 0 2px 0 #000; }
.auth-panel h2 { color: var(--green); font-size: 15px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { flex: 1; padding: 6px; }
.tab.active { background: #4a1408; border-color: var(--gold); color: var(--gold-hi); }
form label { display: block; text-align: left; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
form label input { margin-top: 3px; font-size: 14px; }
.error { color: #ff8d78; min-height: 1.4em; margin-bottom: 8px; font-size: 13px; }
.hint a { color: var(--gold); }
.hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.bar { height: 12px; border: 1px solid var(--gold); background: #0d0a06; margin-top: 14px; }
.bar > div { height: 100%; width: 0; background: var(--gold); transition: width .15s; }
.help-panel { max-width: 560px; text-align: left; }
.help-panel h2 { text-align: center; color: var(--gold-hi); margin-bottom: 12px; }
.help-panel table { width: 100%; border-collapse: collapse; }
.help-panel td { padding: 5px 4px; border-bottom: 1px solid #2a1f0f; vertical-align: middle; }
.help-panel td:first-child { white-space: nowrap; padding-right: 14px; }
.help-panel button { margin-top: 16px; }

/* ---------- game layout ---------- */
#app { display: flex; flex-direction: column; height: 100%; }
header {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden;
}
.brand { font-family: Georgia, serif; color: var(--gold-hi); font-size: 16px; }
.brand { white-space: nowrap; }
/* connection state, written as part of the title: "Gothic 3: The Beginning - Online" */
.status { color: var(--muted); }
.status.online { color: var(--green); }
.status.reconnecting { color: #ffb347; }
.spacer { flex: 1; }
.vol { display: flex; align-items: center; gap: 6px; color: var(--gold); }
.vol input { width: 90px; padding: 0; accent-color: var(--gold); }
main { flex: 1 1 auto; display: flex; min-height: 0; }
#stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; background: #000; padding: 6px; }
#screen {
  image-rendering: pixelated; image-rendering: crisp-edges;
  background: #000; flex: 0 0 auto;      /* its size is set by the page (fitCanvas) */
  border: 1px solid var(--line);
}
aside {
  flex: 0 0 280px; display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); border-left: 1px solid var(--line);
}
aside h3 { color: var(--gold); font-size: 14px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
aside h3 span { color: var(--muted); font-family: Tahoma, sans-serif; font-size: 12px; }
.players { flex: 0 0 auto; }
/* five rows, then the list scrolls on its own */
#players { list-style: none; margin: 0; padding: 4px 0; max-height: 138px; overflow-y: auto; }
#players li { display: flex; align-items: center; gap: 8px; padding: 3px 10px; font-size: 13px; height: 26px; }
#players-toggle {
  all: unset; display: block; width: 100%; box-sizing: border-box; cursor: pointer;
  font: inherit; color: inherit; padding: 6px 10px;
}
#players-toggle::after { content: "\25BE"; float: right; color: var(--muted); }
#players-toggle[aria-expanded="false"]::after { content: "\25B8"; }
#players-toggle:hover, #players-toggle:focus-visible { color: var(--gold-hi); }
#players-toggle:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: -2px; }
.players h3 { padding: 0; }
#players li.me .pname { color: var(--green); }
#players .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; color: var(--gold-hi); }
#players .pmap { color: var(--muted); font-size: 11px; }
#players .pquest { color: var(--gold); font-size: 11px; }
#players .php { width: 46px; height: 6px; background: #2a0d08; border: 1px solid #5c2218; }
#players .php i { display: block; height: 100%; background: var(--red); }
.chat { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
#chat-log { flex: 1 1 auto; overflow-y: auto; padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; }
#chat-log p { margin: 0 0 3px; }
#chat-log time { color: #6f6350; font-size: 11px; font-variant-numeric: tabular-nums; }
#chat-log .who { color: var(--gold-hi); }
#chat-log .me .who { color: var(--green); }
#chat-log .sys { color: var(--muted); font-style: italic; }
#chat-log .sys .nick { color: #e3bf6b; }
#chat-form { flex: 0 0 auto; padding: 6px; border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  body:not(.mobile) main { flex-direction: column; }
  body:not(.mobile) aside { flex: 0 0 34%; border-left: 0; border-top: 1px solid var(--line); }
  body:not(.mobile) .players { display: none; }
  body:not(.mobile) .vol { display: none; }
}
}

/* ---------- dialogs ---------- */
.online-count { color: var(--muted); font-size: 12px; margin: -10px 0 16px; }
.dialog-panel { max-width: 420px; }
.dialog-panel p { font-family: Georgia, "Times New Roman", serif; font-size: 17px; color: var(--gold-hi); margin: 6px 0 20px; }
.dialog-buttons { display: flex; gap: 10px; }
button.primary.plain { background: var(--panel-2); border-color: var(--line); color: var(--text); }
button.primary.plain:hover { border-color: var(--gold); color: var(--gold-hi); background: var(--panel-2); }
.ornament { height: 2px; margin: 0 auto 14px; width: 60%; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* ---------- scrollbars of the side panel ---------- */
#players, #chat-log { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#players::-webkit-scrollbar, #chat-log::-webkit-scrollbar { width: 8px; }
#players::-webkit-scrollbar-thumb, #chat-log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
#players::-webkit-scrollbar-thumb:hover, #chat-log::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ---------- ranking ---------- */
.rank-panel { max-width: 560px; display: flex; flex-direction: column; max-height: 90vh; }
.rank-panel h2 { color: var(--gold-hi); margin-bottom: 10px; }
.rank-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 80px; border: 1px solid var(--line); background: #0d0a06; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rank-scroll::-webkit-scrollbar { width: 8px; }
.rank-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.rank-panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-panel th {
  position: sticky; top: 0; background: #4a1408; color: var(--gold-hi); font-family: Georgia, serif; font-weight: normal;
  padding: 6px 8px; border-bottom: 1px solid var(--gold); text-align: right;
}
.rank-panel td { padding: 5px 8px; border-bottom: 1px solid #2a1f0f; text-align: right; font-variant-numeric: tabular-nums; }
.rank-panel th:nth-child(2), .rank-panel td:nth-child(2) { text-align: left; }
.rank-panel th:first-child, .rank-panel td:first-child { text-align: center; width: 2.6em; color: var(--muted); }
.rank-panel td:nth-child(2) { color: var(--gold-hi); overflow-wrap: anywhere; }
.rank-panel tr.me td { background: #1f2a14; }
.rank-panel tr.me td:nth-child(2) { color: var(--green); }
.rank-panel tr.top td:first-child { color: var(--gold-hi); font-weight: bold; }
.rank-panel tr.idle td { color: var(--muted); }
.rank-panel .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: 6px; vertical-align: middle; }
.rank-panel .hint { margin: 12px; }
.rank-panel > button { margin-top: 14px; flex: 0 0 auto; }

/* ranking pages */
.rank-scroll { position: relative; }
.rank-panel tr.filler td { border-bottom-color: transparent; }
.rank-panel #rank-empty { position: absolute; left: 0; right: 0; top: 45%; margin: 0; }
.rank-pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.rank-pager button { flex: 0 0 118px; padding: 6px 8px; font-family: Georgia, "Times New Roman", serif; color: var(--gold-hi); }
.rank-pager button span { font-size: 10px; color: var(--gold); }
.rank-pager button:disabled { opacity: .35; }
.rank-pager button:disabled:hover { border-color: var(--line); color: var(--gold-hi); }
.rank-pos { flex: 1; display: flex; flex-direction: column; align-items: center; font-family: Georgia, "Times New Roman", serif; color: var(--gold-hi); font-size: 15px; }
.rank-pos small { font-family: Tahoma, Verdana, sans-serif; color: var(--muted); font-size: 11px; margin-top: 1px; }

/* ---------- start page: map of the game world behind the login window ---------- */
#auth, #loading { background: var(--bg); overflow: hidden; }
#auth::before, #loading::before {
  content: ""; position: absolute; inset: -24px;            /* larger than the page: blurred edges stay outside */
  background: url("../tlo.webp") center / cover no-repeat;
  filter: blur(4px) brightness(.6) saturate(.9);
}
#auth::after, #loading::after {                              /* darker towards the edges, keeps the window readable */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(11, 9, 7, .25) 0%, rgba(11, 9, 7, .78) 100%);
}
#auth > .panel, #loading > .panel { position: relative; z-index: 1; }

/* ====================================================================================
   View mode "mobile": screen on top, touch controls below (or at the sides in landscape)
   ==================================================================================== */
.only-mobile { display: none; }
#tools { display: contents; }
.touch-row { display: none; }
.badge {
  display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 16px; text-align: center;
}

body.mobile {
  position: fixed; inset: 0; overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
body.mobile #app { height: 100%; }
body.mobile .only-mobile { display: inline-block; }
body.mobile .touch-row { display: table-row; }
body.mobile .brand { font-size: 0; }
body.mobile .brand .status { font-size: 16px; }
body.mobile .brand-dash { display: none; }
body.mobile header {
  position: relative; z-index: 9; gap: 6px; overflow: visible;
  padding: max(5px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 5px max(8px, env(safe-area-inset-left));
}
body.mobile header > button { padding: 6px 12px; font-size: 14px; }
body.mobile input { font-size: 16px; }               /* smaller text makes phones zoom in on focus */
body.mobile #chat-log, body.mobile #players { -webkit-user-select: text; user-select: text; }

/* header buttons become a drop-down menu */
body.mobile #tools {
  display: none; position: absolute; right: 6px; top: 100%; z-index: 9; min-width: 190px;
  flex-direction: column; gap: 6px; padding: 10px;
  background: var(--panel); border: 2px solid var(--gold); box-shadow: 0 0 0 3px #2a1f0f, 0 10px 30px #000;
}
body.mobile #tools.open { display: flex; }
body.mobile #tools button { padding: 9px 12px; font-size: 15px; text-align: left; }
body.mobile #tools .vol { display: flex; padding: 4px 2px; }
body.mobile #tools .vol input { flex: 1; width: auto; }

body.mobile main { flex-direction: column; position: relative; }
body.mobile #stage { flex: 0 0 auto; padding: 0; }
body.mobile #screen { border: 0; border-bottom: 1px solid var(--line); touch-action: none; }

/* chat + players slide over the game */
body.mobile aside { display: none; position: absolute; inset: 0; z-index: 8; border: 0; flex: none; }
body.mobile.chat-open aside { display: flex; }
body.mobile .players { display: block; }
body.mobile #chat-close { float: right; padding: 2px 10px; font: 13px Tahoma, Verdana, sans-serif; }
body.mobile #chat-form { padding-bottom: max(6px, env(safe-area-inset-bottom)); }

/* ---------- touch controls ---------- */
#touch {
  flex: 1 1 auto; min-height: 0; display: flex; justify-content: space-between; align-items: stretch; gap: 10px;
  padding: 8px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #1c150d 0%, var(--bg) 100%);
  touch-action: none;
}
.tk-side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tk-left { align-items: flex-start; }
.tk-right { align-items: flex-end; }
.tk {
  touch-action: none; -webkit-user-select: none; user-select: none; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif; color: var(--gold-hi);
  background: radial-gradient(circle at 50% 35%, #33261a 0%, #17120c 75%);
  border: 2px solid var(--line); box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 194, 74, .12);
  padding: 0;
}
.tk.down, .tk:active {
  border-color: var(--gold-hi); background: radial-gradient(circle at 50% 50%, #6a2410 0%, #2b150b 80%);
  box-shadow: 0 0 12px rgba(255, 194, 74, .45); transform: translateY(1px);
}
.tk-soft { width: 92px; height: 40px; border-radius: 6px; font-size: 17px; letter-spacing: 1px; flex: 0 0 auto; }
.tk-left .tk-soft { border-top-left-radius: 2px; }
.tk-right .tk-soft { border-top-right-radius: 2px; }

.dpad {
  --size: min(44vw, 176px, calc(100% - 4px));
  position: relative; width: var(--size); height: var(--size); margin: auto 0; flex: 0 0 auto;
  border-radius: 50%; touch-action: none;
  background: radial-gradient(circle at 50% 50%, #2a1f14 0%, #17120c 62%, #0f0b07 100%);
  border: 2px solid var(--line); box-shadow: 0 3px 0 #000, inset 0 0 0 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 194, 74, .12);
}
.dpad span { position: absolute; color: #7d6233; font-size: 22px; line-height: 1; pointer-events: none; }
.dpad .d-u { top: 9%; left: 50%; transform: translateX(-50%); }
.dpad .d-d { bottom: 9%; left: 50%; transform: translateX(-50%); }
.dpad .d-l { left: 9%; top: 50%; transform: translateY(-50%); }
.dpad .d-r { right: 9%; top: 50%; transform: translateY(-50%); }
.dpad .d-knob {
  left: 50%; top: 50%; width: 34%; height: 34%; margin: -17% 0 0 -17%; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #4a3520 0%, #1c150d 80%); border: 1px solid var(--line);
  transition: transform .06s;
}
.dpad[data-dir] { border-color: var(--gold); }
.dpad[data-dir~="u"] .d-u, .dpad[data-dir~="d"] .d-d, .dpad[data-dir~="l"] .d-l, .dpad[data-dir~="r"] .d-r {
  color: var(--gold-hi); text-shadow: 0 0 8px rgba(255, 194, 74, .8);
}
.dpad[data-dir="u"] .d-knob { transform: translateY(-38%); }
.dpad[data-dir="d"] .d-knob { transform: translateY(38%); }
.dpad[data-dir="l"] .d-knob { transform: translateX(-38%); }
.dpad[data-dir="r"] .d-knob { transform: translateX(38%); }
.dpad[data-dir="u l"] .d-knob { transform: translate(-28%, -28%); }
.dpad[data-dir="u r"] .d-knob { transform: translate(28%, -28%); }
.dpad[data-dir="d l"] .d-knob { transform: translate(-28%, 28%); }
.dpad[data-dir="d r"] .d-knob { transform: translate(28%, 28%); }

.tk-cluster {
  --size: min(44vw, 176px, calc(100% - 4px));
  position: relative; width: var(--size); height: var(--size); margin: auto 0; flex: 0 0 auto;
}
.tk-fire {
  position: absolute; right: 0; bottom: 0; width: 66%; height: 66%; border-radius: 50%;
  font-size: 17px; border-color: var(--gold);
  background: radial-gradient(circle at 50% 35%, #7a2a12 0%, #3a160a 75%);
}
.tk-small { position: absolute; width: 31%; height: 31%; border-radius: 50%; font-size: 14px; }
.tk-num { left: 0; top: 0; font-size: 12px; }
.tk-star { right: 4%; top: 0; }
.tk-hash { left: 0; bottom: 4%; }

#tk-numpad {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: var(--panel); border-top: 2px solid var(--gold); box-shadow: 0 -8px 24px #000;
}
.tk-digit { height: 46px; border-radius: 6px; font-size: 20px; }
#tk-num-close { grid-column: 1 / -1; width: 100%; padding: 8px; }

/* phone held sideways: pad left, screen in the middle, buttons right */
@media (orientation: landscape) {
  body.mobile main { flex-direction: row; }
  body.mobile #touch { display: contents; }
  body.mobile #stage { order: 1; flex: 1 1 auto; align-items: center; justify-content: center; min-width: 0; }
  body.mobile #screen { border: 1px solid var(--line); }
  body.mobile .tk-side {
    flex: 0 0 clamp(120px, 22vw, 190px); padding: 6px; touch-action: none;
    background: linear-gradient(180deg, #1c150d 0%, var(--bg) 100%);
  }
  body.mobile .tk-left { order: 0; align-items: center; padding-left: max(6px, env(safe-area-inset-left)); }
  body.mobile .tk-right { order: 2; align-items: center; padding-right: max(6px, env(safe-area-inset-right)); }
  body.mobile .dpad, body.mobile .tk-cluster { --size: min(100%, 60vh, 176px); }
  body.mobile .tk-soft { width: 100%; height: 34px; }
  body.mobile #tk-numpad { left: auto; width: min(100%, 300px); border-left: 2px solid var(--gold); }
  body.mobile header { padding-top: 3px; padding-bottom: 3px; }
  body.mobile header > button { padding: 3px 12px; }
}

/* ---------- waiting for the server ---------- */
#wait { z-index: 11; }
.wait-bar { overflow: hidden; margin: 0 0 14px; }
.wait-bar > div { width: 35%; transition: none; animation: wait-slide 1.4s ease-in-out infinite alternate; }
@keyframes wait-slide { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .wait-bar > div { animation: none; width: 100%; opacity: .5; } }

/* ---------- every window fits the screen it is shown on ----------
   Windows never grow beyond the visible area: their content scrolls inside and the button that
   closes them stays in view. (100dvh = the height that is really visible on phones, where the
   browser's own bars come and go.) */
.overlay {
  overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; margin: auto; }
.help-panel, .rank-panel { display: flex; flex-direction: column; overflow: hidden; }
.help-panel h2, .help-panel > button, .rank-panel h2, .rank-pager, .rank-panel > button { flex: 0 0 auto; }
.help-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.help-scroll:focus-visible { outline: 1px solid var(--gold-hi); }
.rank-panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.rank-scroll { min-height: 60px; }

body.mobile .panel { padding: 16px; }
body.mobile .key-row { display: none; }               /* a phone has no keyboard: show the touch controls only */
body.mobile .help-panel td:first-child { white-space: normal; padding-right: 10px; }
body.mobile .help-panel td { padding: 7px 4px; }
body.mobile .rank-panel table { font-size: 12px; }
body.mobile .rank-panel th, body.mobile .rank-panel td { padding: 5px 5px; }
body.mobile .rank-pager button { flex: 0 0 auto; padding: 8px 10px; }
body.mobile .dialog-buttons button, body.mobile .panel > button.primary { padding: 11px 14px; }
@media (max-height: 520px) {                              /* small screens and phones held sideways */
  .auth-panel h1 { font-size: 28px; }
  .auth-panel h2 { margin-bottom: 8px; }
  .online-count { margin: -4px 0 8px; }
  .panel { padding: 12px 16px; }
  form label { margin-bottom: 6px; }
  .help-panel h2, .rank-panel h2 { margin-bottom: 6px; font-size: 18px; }
  .help-panel > button, .rank-panel > button { margin-top: 8px; }
  .rank-pager { margin-top: 6px; }
}
@media (max-height: 520px) and (min-width: 560px) {       /* sideways phone: the form uses the width instead of the height */
  .auth-panel { max-width: 580px; }
  #auth-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
  #auth-form .error, #auth-submit { grid-column: 1 / -1; }
  #auth-form .error { min-height: 1.2em; margin-bottom: 4px; }
  .tabs { margin-bottom: 8px; }
}
@media (max-height: 400px) {
  .auth-panel h1 { font-size: 24px; }
  .auth-panel h2 { font-size: 12px; margin-bottom: 4px; }
  .panel { padding: 8px 16px 12px; }
}
