* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  min-height: 100vh;
  background: #f2efe4;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  overflow-x: hidden;
}

#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: #f2efe4;
  border-bottom: 1px dashed #b8b39f;
  z-index: 10;
}
#site-header h1 { margin: 0; font-size: 28px; color: #3a3a3a; letter-spacing: 1px; }

#ad-slot {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: #fff;
  border: 1px dashed #b8b39f;
  display: flex; align-items: center; justify-content: center;
  color: #b8b39f; font-size: 12px;
  z-index: 10;
}
#ad-slot:empty::before { content: "ad"; }

#board {
  position: fixed; inset: 0;
  z-index: 1;
}

#site-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #f2efe4;
  border-top: 1px dashed #b8b39f;
  padding: 6px 12px;
  font-size: 12px;
  color: #6a6a6a;
  display: flex; justify-content: space-between; gap: 1em;
  z-index: 10;
}
#site-footer a { color: #6a6a6a; }

.footer-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: #6a6a6a;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.sticky {
  position: absolute;
  width: 180px;
  min-height: 140px;
  background: #fff176;
  box-shadow: 2px 3px 6px rgba(0,0,0,0.2);
  padding: 10px 24px 22px 10px;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  z-index: 5;
  font-size: 14px;
  line-height: 1.3;
  color: #1f1f1f;
}
.sticky.own { border: 2px solid #c9a227; padding: 8px 22px 20px 8px; }
.sticky textarea {
  width: 100%; min-height: 90px;
  background: transparent;
  border: 0; outline: 0; resize: none;
  font: inherit; color: inherit;
}
.sticky textarea[readonly] { cursor: text; }
.sticky .del {
  position: absolute; top: 2px; right: 4px;
  background: transparent; border: 0;
  font-size: 18px; line-height: 1;
  cursor: pointer; color: #5a4a00;
}
.sticky .meta {
  position: absolute; left: 8px; bottom: 4px;
  font-size: 10px; color: #5a4a00; opacity: 0.7;
}
.sticky.error { background: #ffb4a2; }

#cookie-consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 42px;
  max-width: 520px;
  background: #fffdf3;
  border: 1px dashed #8f876f;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.2);
  padding: 12px;
  z-index: 30;
  color: #2f2f2f;
  font-size: 13px;
}

#cookie-consent h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

#cookie-consent p {
  margin: 0 0 10px;
  line-height: 1.35;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-actions button {
  border: 1px solid #8f876f;
  background: #f2efe4;
  padding: 7px 9px;
  font: inherit;
  cursor: pointer;
}

.cookie-actions button.primary {
  background: #fff176;
  border-color: #9b8500;
}

.cookie-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
}

.cookie-row input {
  margin-top: 3px;
}

.cookie-row span {
  display: grid;
  gap: 2px;
}

.cookie-row small {
  color: #666;
  line-height: 1.3;
}

@media (max-width: 640px) {
  #ad-slot { width: 240px; height: 240px; }
  .sticky { width: 150px; min-height: 120px; }
  #cookie-consent {
    left: 8px;
    right: 8px;
    bottom: 48px;
    max-width: none;
  }
}
