@import url("https://fonts.googleapis.com/css2?family=Gochi+Hand&family=Patrick+Hand&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f0eee9;
  font-family: "Patrick Hand", system-ui, sans-serif;
  font-size: 18px;
  color: #222;
}

a {
  color: #2a78d6;
}

.card {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid #222;
  border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.card.wide {
  max-width: 720px;
}

.panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.h1 {
  font: 700 34px/1.1 "Gochi Hand", cursive;
  text-align: center;
  margin: 0;
}

.sub {
  font: 17px/1.4 "Patrick Hand", sans-serif;
  color: #666;
  text-align: center;
  margin: 0;
}

.gears {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.gear {
  width: 34px;
  height: 34px;
  border: 2px solid #222;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 18px "Gochi Hand", cursive;
  background: #ffd84d;
}

.gear.alt {
  background: #fff;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border: 2px solid #222;
  border-radius: 999px;
  padding: 4px 12px;
  font: 16px "Patrick Hand", sans-serif;
  background: #fff;
}

.chip.highlight {
  background: #ffd84d;
  font-weight: 700;
}

.btn {
  border: 2px solid #222;
  border-radius: 999px;
  background: #ffd84d;
  font: 700 19px "Gochi Hand", cursive;
  padding: 10px 22px;
  text-align: center;
  box-shadow: 2px 2px 0 #222;
  cursor: pointer;
  color: #222;
  text-decoration: none;
  display: inline-block;
}

.btn.secondary {
  background: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inp {
  border: 2px solid #222;
  border-radius: 8px;
  background: #fff;
  padding: 10px 14px;
  font: 17px "Patrick Hand", sans-serif;
  color: #222;
  width: 100%;
}

.inp::placeholder {
  color: #999;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ans {
  border: 2px solid #222;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font: 18px "Patrick Hand", sans-serif;
  background: #fff;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.ans:hover:not(:disabled) {
  background: #fffbe6;
}

.ans:disabled {
  cursor: default;
  opacity: 0.85;
}

.ans.selected {
  background: #ffd84d;
  font-weight: 700;
}

.ans.correct {
  background: #b7e4a7;
}

.ans.wrong {
  background: #f2a9a0;
}

.question-box {
  border: 2px solid #222;
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  font: 21px/1.35 "Patrick Hand", sans-serif;
  background: #fafafa;
}

.timer-bar {
  height: 6px;
  border: 2px solid #222;
  border-radius: 99px;
  overflow: hidden;
}

.timer-bar > div {
  height: 100%;
  background: #ffd84d;
  transition: width 0.2s linear;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.factory-art {
  border: 2px solid #222;
  border-radius: 8px;
  background: #fafafa;
  padding: 8px;
  display: flex;
  justify-content: center;
}

.how-to {
  border-top: 2px dashed #ccc;
  padding-top: 10px;
}

.how-to .sub {
  text-align: left;
}

.how-to .sub.title {
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}

.lobby-icon {
  width: 70px;
  height: 70px;
  border: 3px dashed #222;
  border-radius: 50%;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 28px "Gochi Hand", cursive;
  background: #fafafa;
}

.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.feedback-icon {
  width: 64px;
  height: 64px;
  border: 3px solid #222;
  border-radius: 50%;
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 38px "Gochi Hand", cursive;
}

.feedback-icon.ok {
  background: #b7e4a7;
}

.feedback-icon.bad {
  background: #f2a9a0;
  font-size: 34px;
}

.podium {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.podium-col {
  flex: 1;
  text-align: center;
}

.podium-bar {
  border: 2px solid #222;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: 700 18px "Gochi Hand", cursive;
}

.podium-bar.first {
  height: 86px;
  background: #ffd84d;
  font-size: 22px;
}

.podium-bar.second {
  height: 58px;
  background: #eee;
}

.podium-bar.third {
  height: 42px;
  background: #eee;
}

.podium-footer {
  border-top: 2px solid #222;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  color: #666;
}

.countdown-num {
  width: 80px;
  height: 80px;
  border: 3px solid #222;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 40px "Gochi Hand", cursive;
  background: #ffd84d;
}

.host-timer {
  width: 58px;
  height: 58px;
  border: 3px solid #222;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 22px "Gochi Hand", cursive;
  background: #ffd84d;
}

.leaderboard {
  border-left: 2px dashed #ccc;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
}

.host-layout {
  display: flex;
  flex-direction: row;
  gap: 18px;
}

.host-layout > .main {
  flex: 1.2;
}

.host-layout > .side {
  flex: 1;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.page-shell {
  padding: 16px;
}

@media (min-width: 640px) {
  .card.wide .panel.row-layout {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .card.wide .panel.row-layout .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .h1.left {
    text-align: left;
    font-size: 32px;
  }

  .sub.left {
    text-align: left;
  }
}
