body.phone {
  --g: 24px;
  --mx: 30px;
}
body.phone main {
  position: relative;
  z-index: 1;
  padding: 16px 14px 40px 46px;
  max-width: 560px;
}

#net {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 6px 12px;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 18px;
}

.phone .title {
  font-size: 44px;
}
.dateline {
  margin: 10px 0 0;
  color: var(--soft);
}
.hand {
  margin: 4px 0 10px;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
}
.note {
  margin: 12px 0 0;
  color: var(--soft);
}
.err {
  margin: 6px 0;
  color: var(--red);
  font-size: 22px;
}

/* join */
.field {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 14px;
}
.field span {
  font-size: 28px;
}
.field input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 32px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 3px solid var(--pencil);
  border-radius: 0;
  padding: 2px 2px 4px;
  outline: 0;
}
.field input:focus {
  border-bottom-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
#joinForm .btn {
  margin-top: 10px;
  width: 100%;
  font-size: 26px;
}

/* drawing pad */
.padwrap {
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 8px 0 16px;
  border: 3px solid var(--pencil);
  border-radius: 10px;
  background-color: var(--paper);
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 4px 4px 0 var(--pencil);
  touch-action: none;
}
#pad {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.swatches,
.toolrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.sw {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--pencil);
  cursor: pointer;
}
.sw.on {
  box-shadow: 0 0 0 2px var(--pencil), 0 0 0 6px var(--hi);
}
.tool {
  font: inherit;
  font-size: 20px;
  color: var(--pencil);
  background: var(--paper);
  border: 2px solid var(--pencil);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.tool.on {
  background: var(--hi);
}
#readyBtn {
  width: 100%;
  font-size: 26px;
}

/* play */
.hud {
  margin: 0 0 14px;
  padding: 8px 10px 6px;
  background: rgba(251, 252, 248, 0.94);
  border: 2px solid var(--pencil);
  border-radius: 8px;
}
.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 22px;
}
.hud-row strong {
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lane {
  display: grid;
  grid-template-columns: 74px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  font-size: 17px;
}
.lane .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lane .n {
  text-align: right;
}
.track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--pencil);
  border-radius: 3px;
  background: repeating-linear-gradient(to right, transparent 0 calc(4% - 1px), var(--grid) calc(4% - 1px) 4%);
}
.track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--ink);
  transition: width 0.35s ease;
}
.lane.lead .track i {
  background: var(--red);
}
.legend {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--soft);
}
.leading {
  margin: 4px 0 0;
  font-size: 18px;
  color: var(--green);
}

.qnum {
  margin: 0;
  min-height: 24px;
  font-size: 20px;
  color: var(--soft);
}
.qnum.banner {
  font-family: var(--marker);
  font-size: clamp(34px, 11vw, 52px);
  line-height: 1.1;
  color: var(--ink);
  min-height: 60px;
  margin-bottom: 6px;
}
.qrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 2px 0 12px;
}
.qtext {
  font-size: clamp(40px, 13vw, 60px);
  line-height: 1.1;
  white-space: nowrap;
}
.qrow input {
  flex: 1;
  min-width: 0;
  width: 100%;
  font: inherit;
  font-size: clamp(40px, 13vw, 60px);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 4px solid var(--pencil);
  border-radius: 0;
  padding: 0 4px;
  outline: 0;
  caret-color: var(--red);
}
.qrow input:focus {
  border-bottom-color: var(--ink);
}
.qrow input::placeholder {
  color: #b4b9c9;
}
.go {
  width: 100%;
  font-size: 28px;
}

/* The Go button and the RIGHT/WRONG mark share one spot, so the number pad never hides the mark. */
.slot {
  position: relative;
  min-height: 100px;
}
.slot.showing .go {
  visibility: hidden;
}
.verdict {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none; /* never block taps on Go */
}
.verdict svg {
  width: 52px;
  height: 52px;
  flex: none;
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.verdict path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 0.3s ease-out forwards;
}
.verdict path:nth-child(2) {
  animation-delay: 0.15s;
}
.verdict.right svg {
  stroke: var(--green);
}
.verdict.wrong svg {
  stroke: var(--red);
}
.verdict .word {
  display: block;
  font-family: var(--marker);
  font-size: 46px;
  line-height: 1;
  transform: rotate(-4deg);
  transform-origin: left center;
}
.verdict.right .word {
  color: var(--green);
}
.verdict.wrong .word {
  color: var(--red);
}
.verdict .sub {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.linkish {
  display: block;
  margin: 8px 0 0;
  padding: 6px 0;
  font: inherit;
  font-size: 20px;
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* done and final */
.center {
  text-align: left;
}
#s-done .stamp,
#s-over .stamp {
  margin: 18px 0 12px;
}
.big {
  margin: 8px 0 14px;
  font-size: 34px;
  line-height: 1.15;
}
.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0 0 14px;
  font-size: 26px;
}
.facts dt {
  color: var(--soft);
}
.facts dd {
  margin: 0;
  color: var(--ink);
}
.place {
  margin: 4px 0;
  font-family: var(--marker);
  font-size: 96px;
  line-height: 1.05;
  color: var(--ink);
}
