:root {
  --font-bad: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive;
  --text: #000;
  --bg: #fff;
  --line: #000;
  --hot: #ff0;
  --pink: #ff66cc;
  --cyan: #77f7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-bad);
  font-size: 18px;
}

a {
  color: #0000ee;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 4px double var(--line);
  padding: 10px 16px;
}

.brand {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--line);
  padding: 4px 7px;
  background: var(--hot);
  font-size: 14px;
  font-weight: 900;
}

.language-switch a {
  color: var(--text);
  text-decoration: none;
}

.language-switch a.active {
  text-decoration: underline;
}

main {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
}

.hero {
  min-height: 48vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 24px 0;
}

.logo-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 900 clamp(48px, 13vw, 168px) var(--font-bad);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.logo-button.bounce {
  animation: tiny-bounce 260ms ease-out;
}

@keyframes tiny-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-10px) rotate(-1deg); }
  70% { transform: translateY(4px) rotate(1deg); }
}

.tagline {
  max-width: 680px;
  margin: 18px auto 0;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.15;
}

section {
  margin: 30px 0;
}

.examples {
  border: 3px dashed var(--line);
  padding: 18px;
  text-align: center;
  background: var(--hot);
}

.examples p {
  margin: 8px 0;
}

.counter-box {
  border: 5px solid var(--line);
  box-shadow: 8px 8px 0 var(--pink);
  padding: 20px;
  text-align: center;
  font-size: clamp(26px, 6vw, 48px);
  font-weight: 900;
}

.button-zone {
  display: grid;
  place-items: center;
  gap: 16px;
}

button,
.button {
  border: 3px solid var(--line);
  background: var(--cyan);
  color: var(--text);
  cursor: pointer;
  font: 900 20px var(--font-bad);
  padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--line);
}

button:hover,
.button:hover {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--line);
}

.chaos-button {
  min-width: min(100%, 360px);
  min-height: 86px;
  background: var(--pink);
  font-size: clamp(28px, 7vw, 56px);
}

.random-result {
  min-height: 42px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

.meter {
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  padding: 18px 0;
}

.meter h2,
.section-head h2 {
  margin: 0 0 10px;
}

.meter-track {
  height: 34px;
  border: 3px solid var(--line);
  background: repeating-linear-gradient(90deg, #fff, #fff 12px, #ddd 12px, #ddd 24px);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #4cff4c, #ff0, #ff0000);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  color: var(--text);
  text-decoration: none;
  border: 3px solid var(--line);
  background: #fff;
  padding: 8px;
  box-shadow: 5px 5px 0 #000;
}

.card:hover {
  transform: rotate(-0.5deg);
}

.card-media {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--line);
  margin-bottom: 8px;
  background: #eee;
}

.card img,
.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-card {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  background: #fff;
  overflow: hidden;
}

.card strong,
.card span {
  display: block;
}

.card span,
time {
  font-size: 14px;
}

.plain-head {
  text-align: center;
}

.plain-head h1,
.not-found h1,
.post h1 {
  font-size: clamp(40px, 10vw, 94px);
  margin: 28px 0 8px;
  overflow-wrap: anywhere;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.skinny {
  max-width: 360px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 3px solid var(--line);
  padding: 10px;
  font: 18px var(--font-bad);
}

textarea {
  resize: vertical;
}

.post {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.post-image {
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border: 4px solid var(--line);
}

.post-story {
  border: 4px solid var(--line);
  padding: 28px;
  font-size: clamp(24px, 4vw, 42px);
  background: var(--hot);
  white-space: pre-wrap;
}

.alive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  border-top: 4px double var(--line);
  padding-top: 18px;
}

.alive div {
  border: 2px solid var(--line);
  padding: 8px;
  background: #f8f8f8;
}

.pager {
  justify-content: center;
  margin: 28px 0;
}

.pager a {
  border: 3px solid var(--line);
  padding: 8px 14px;
  color: var(--text);
  background: var(--hot);
  text-decoration: none;
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border: 2px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 4px;
}

.inline-form input {
  width: auto;
}

.danger {
  background: #ff5b5b;
}

.empty,
.not-found {
  text-align: center;
}

footer {
  width: min(1100px, calc(100% - 24px));
  margin: 34px auto 20px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
  text-align: center;
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .topbar,
  .section-head {
    align-items: center;
    flex-direction: column;
  }

  .counter-box {
    box-shadow: 5px 5px 0 var(--pink);
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
