* { box-sizing: border-box; }

body {
  margin: 0;
  color: #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.35;
  background-color: #000;

  /* Тот же фон, что на главной. Поменяли картинку там — поменяйте и здесь. */
  background-image: url("/background4.jpg");
  background-size: cover;
  background-position: center;
}

a:link { color: #0000ee; }
a:visited { color: #551a8b; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.layout { max-width: 760px; margin: 4em auto 3em; padding: 0 12px; }
.win { background: #f1f1ea; border: 2px solid #7b3fbf; box-shadow: 0 0 0 1px #000; }
.bar {
  background: linear-gradient(#b07ae8, #6a2fb0);
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  line-height: 1;
  padding: 4px 5px;
  text-shadow: 1px 1px 0 #3f1670;
}
.content { padding: 6px 8px 12px; }

.main h1 { font-size: 2em; margin: 0.4em 0; }
.main h2 { font-size: 1.25em; margin: 0.2em 0 0.5em; }
.main h3 { font-size: 1em; margin: 1em 0 0.2em; }
hr.sep { border: 0; border-top: 1px solid #8a8a84; border-bottom: 1px solid #fff; margin: 0.9em 0; }

.menu { margin: 0.3em 0; }
.hint { font-size: 0.9em; color: #333; }
.warn { color: #a00000; }
.scroll { overflow-x: auto; }
table { width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 4px 6px; }
td code { word-break: break-all; }
td form { margin: 0; }
form.inline { display: inline; }

input, select, button { font: inherit; }
input:not([type=checkbox]), select {
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 2px 4px;
  max-width: 100%;
}
button {
  background: #d4d0c8;
  color: #000;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 2px 12px;
  cursor: pointer;
}
button:active { border-color: #404040 #fff #fff #404040; }
button.link {
  background: none;
  border: 0;
  padding: 0;
  color: #0000ee;
  text-decoration: underline;
}
button.danger { color: #a00000; font-weight: bold; }

.flash { padding: 0.4em 0.6em; border: 1px solid; margin: 0.6em 0; }
.flash.ok { background: #e4f4e4; border-color: #2a7a2a; }
.flash.error { background: #fbe4e4; border-color: #a02020; }

.rules { background: #f0e6fb; border: 1px dashed #7b3fbf; padding: 0.4em 0.8em; margin: 1em 0; }
.rules ul { padding-left: 1.3em; margin: 0.4em 0; }
.rules li { margin-bottom: 0.3em; }

.qr { display: inline-block; background: #fff; padding: 10px; border: 1px solid #999; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret code { font-size: 1.15em; word-break: break-all; }
pre.codes {
  background: #fff;
  border: 1px solid #999;
  padding: 0.6em 0.9em;
  font-size: 1.1em;
  line-height: 1.6;
  display: inline-block;
}

.cat-filter { line-height: 1.7; }
table.sites td:first-child { white-space: nowrap; }
fieldset.cats { border: 1px solid #8a8a84; margin: 0 0 1em; padding: 0.3em 0.6em 0.5em; }
fieldset.cats label { display: inline-block; min-width: 14em; margin: 0.15em 0; }

/* ---------- окошки справа, как на главной ---------- */
.layout.with-side {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  max-width: 990px;
}
.layout.with-side > .main { flex: 0 1 760px; min-width: 0; }
.side { flex: none; width: 170px; }
.tile { display: block; text-decoration: none; }
.tile:link, .tile:visited { color: #000; }
.tile + .tile { margin-top: 14px; }
.tile-body { padding: 16px 8px 14px; text-align: center; }
.tile-body img { display: block; width: 48px; height: 48px; margin: 0 auto 10px; }
.tile-body span { color: #0000ee; font-weight: bold; text-decoration: underline; }
.tile:hover .tile-body, .tile.current .tile-body { background: #e6dcf5; }
.tile.current .tile-body span { color: #000; text-decoration: none; }
.tile:focus-visible { outline: 2px dotted #fff; outline-offset: 3px; }
form.tile { margin-bottom: 0; }
.tile-btn {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  color: #000;
  cursor: pointer;
}
.tile-btn > span { display: block; }
.tile-btn:focus-visible { outline: 2px dotted #fff; outline-offset: 3px; }

/* узкие экраны: окошки встают над основным окном в несколько колонок */
@media (max-width: 980px) {
  .layout.with-side { flex-direction: column; align-items: stretch; max-width: 784px; }
  .layout.with-side > .main { flex: none; }
  .side {
    order: -1;
    width: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }
  .tile + .tile { margin-top: 0; }
  .tile-body, .tile-btn > .tile-body { display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-align: left; }
  .tile-body img { width: 32px; height: 32px; margin: 0; }
}

/* личный кабинет: окошки слева и справа от основного окна, плотнее */
.layout.with-side.wide { max-width: 1164px; }
.layout.wide .side { width: 150px; }
.layout.wide .tile + .tile { margin-top: 8px; }
.layout.wide .tile-body { padding: 8px 6px; }
.layout.wide .tile-body img { width: 40px; height: 40px; margin-bottom: 6px; }

/* когда окошки не помещаются по бокам, они встают над основным окном */
@media (max-width: 1160px) {
  .layout.with-side.wide { flex-direction: column; align-items: stretch; max-width: 784px; }
  .layout.with-side.wide > .main { flex: none; }
  .layout.wide .side {
    order: -1;
    width: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }
  .layout.wide .tile + .tile { margin-top: 0; }
  .layout.wide .tile-body,
  .layout.wide .tile-btn > .tile-body { display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-align: left; }
  .layout.wide .tile-body img { width: 32px; height: 32px; margin: 0; }
}

@media (max-width: 760px) {
  .layout { margin-top: 1.5em; }
}
