/* Doodle Duel — howto.css: "How to play" torn-sheet overlay + lobby/match trigger buttons. */

/* ===== overlay & torn notebook sheet ===== */
.overlay.howto{
  z-index:56;
  align-items:flex-start;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:calc(16px + var(--sat)) 14px calc(18px + var(--sab));
  animation:fade-in var(--dur) ease-out both;
}
.overlay.howto.out{animation:fade-out var(--dur) ease-in both;pointer-events:none}
.howto-wrap{margin:auto;max-width:352px;transform:rotate(-.6deg)}
.howto-sheet{
  padding:26px 16px 22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-align:left;
  outline:none;
  clip-path:var(--torn);
  background-color:var(--paper);
  background-image:linear-gradient(transparent 27px,var(--rule) 27px,var(--rule) 28px,transparent 28px);
  background-size:100% 28px;
}
.howto-title{
  font-size:38px;
  line-height:1;
  text-align:center;
  color:var(--game);
  transform:rotate(-1.2deg);
}
.howto-goal{
  font-size:18px;
  line-height:1.25;
  text-align:center;
  color:var(--ink);
  max-width:30ch;
}

/* ===== vertical steps list ===== */
.howto-steps{
  list-style:none;
  width:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:4px 0 2px;
}
.howto-step{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 8px;
  border:2px dashed color-mix(in srgb,var(--game) 34%,transparent);
  border-radius:var(--sketch);
  background:rgba(255,255,255,.55);
}
.howto-step:nth-child(even){border-radius:var(--sketch-2)}
.howto-art{
  flex:none;
  width:114px;
  height:76px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--paper);
  border:1.5px solid var(--grid);
  border-radius:6px;
}
.howto-art svg{display:block;width:100%;height:100%;overflow:visible}
.howto-copy{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}
.howto-num{
  position:relative;
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:var(--font-title);
  font-size:20px;
  font-weight:700;
  line-height:1;
  color:var(--game);
}
.howto-circle{position:absolute;inset:0;width:100%;height:100%}
.howto-circle .pen{stroke:var(--game)}
.howto-text{
  font-size:17px;
  line-height:1.22;
  color:var(--ink);
}

/* ===== optional tip sticky note ===== */
.howto-tip{
  position:relative;
  width:100%;
  margin-top:4px;
  padding:11px 14px 10px;
  background:var(--sticky);
  color:#5b4a00;
  font-size:16px;
  line-height:1.25;
  text-align:center;
  transform:rotate(-1deg);
  box-shadow:var(--shadow-paper);
}
.howto-tip p{margin:0}
.howto-close{margin-top:6px}
.howto-sheet .btn.primary{background:var(--game);border-color:var(--game)}

/* ===== lobby & match buttons ===== */
.lobby-howto-row{
  display:flex;
  justify-content:center;
  margin-top:4px;
  position:relative;
  z-index:1;
}
.btn.howto-btn{
  padding:8px 16px;
  font-size:18px;
  color:var(--game);
  border-color:var(--game);
}
.howto-ico{flex:none;display:block}
.howto-ico .pen{stroke:currentColor}

.match-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:none;
}
.btn.howto-icon-btn{
  padding:4px 7px;
  min-width:34px;
  min-height:34px;
  line-height:1;
}
.btn.howto-icon-btn .howto-ico{width:20px;height:20px}

@media (max-width:360px){
  .howto-sheet{padding:22px 12px 18px;gap:8px}
  .howto-title{font-size:34px}
  .howto-goal{font-size:16px}
  .howto-art{width:102px;height:68px}
  .howto-text{font-size:16px}
  .match-top h2{font-size:26px}
}
