/* Phone view: one hand, standing, possibly bad mobile data. Big targets, no zoom on inputs. */

html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--ground);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom);
}
button { -webkit-user-select: none; user-select: none; touch-action: manipulation; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: linear-gradient(90deg, var(--fb-primary), var(--fb-deep));
  color: #fff;
}
.brand { font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: .03em; white-space: nowrap; }
.me { font-size: 14px; font-weight: 600; background: rgba(255, 255, 255, .14); padding: 5px 12px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.me:empty { display: none; }

#app { padding: 20px 16px 32px; max-width: 520px; margin: 0 auto; }
.view { animation: in .35s var(--ease-out) both; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }

.label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fb-accent); margin: 0 0 6px; }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 18px; }
h1.grad { font-size: 30px; }
p { font-size: 17px; line-height: 1.45; color: var(--ink-2); }

.card { background: var(--surface); border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

input[type=text], input[type=number] {
  width: 100%; font-size: 18px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--fb-tint); background: var(--surface);
}
input:focus { outline: none; border-color: var(--fb-accent); }

.btn {
  display: block; width: 100%; min-height: 54px; margin-top: 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--fb-primary); color: #fff; font-size: 18px; font-weight: 700;
  transition: transform .16s var(--ease-out), background .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }

.choices { display: grid; gap: 12px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; min-height: 60px; padding: 14px 18px; text-align: left;
  border-radius: var(--radius-sm); border: 2px solid var(--fb-tint); background: var(--surface);
  font-size: 18px; font-weight: 700; color: var(--ink);
  transition: transform .16s var(--ease-out), border-color .2s, background .2s;
}
.choice small { font-size: 14px; font-weight: 400; color: var(--grey-mid); }
.choice:active { transform: scale(.97); }
.choice.on { border-color: var(--fb-primary); background: var(--fb-primary); color: #fff; }
.choice.on small { color: rgba(255, 255, 255, .8); }
.choice.right { border-color: var(--good); background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); }
.choices.closed .choice { pointer-events: none; }

.quiz .choice { color: #fff; border: 0; min-height: 72px; font-size: 18px; }
.quiz .choice .l { font-size: 13px; opacity: .8; }
.quiz.closed .choice:not(.on):not(.right) { opacity: .35; }
.quiz .choice.on { box-shadow: 0 0 0 4px var(--ink); }

.timebar { height: 8px; border-radius: 99px; background: var(--fb-tint-accent); overflow: hidden; margin: 0 0 16px; }
.timebar i { display: block; height: 100%; background: linear-gradient(90deg, var(--fb-accent), var(--fb-primary)); transform-origin: left; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip { font-size: 16px; font-weight: 700; padding: 10px 14px; border-radius: 99px; border: 2px solid var(--fb-tint); background: var(--surface); color: var(--fb-primary); min-height: 44px; }
.chip.on { background: var(--fb-primary); border-color: var(--fb-primary); color: #fff; }

.result { text-align: center; padding: 26px 18px; }
.result .big { font-size: 46px; font-weight: 800; color: var(--fb-primary); line-height: 1.05; }
.result.good .big { color: var(--good); }
.result.bad .big { color: var(--bad); }
.result p { margin: 8px 0 0; }

.wait { text-align: center; padding: 40px 12px; }
.wait .eyes { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: linear-gradient(135deg, var(--fb-accent), var(--fb-primary)); position: relative; animation: bob 2.4s ease-in-out infinite; }
.wait .eyes::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #fff; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.rankline { font-size: 18px; font-weight: 700; color: var(--ink); }

.note { font-size: 15px; color: var(--grey-mid); text-align: center; margin-top: 14px; }
.err { color: var(--bad); font-weight: 600; font-size: 15px; margin-top: 10px; }

#net { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 99px; z-index: 5; }
#net[hidden] { display: none; }

@media (hover: hover) {
  .btn:hover { background: var(--fb-navy); }
  .choice:hover { border-color: var(--fb-mid); }
}
