/* Can't decide? The chooser overlay for Home, the kids' app and the kitchen wall.
   The wall loads this too, so the Safari 10.3 rules apply: flexbox with -webkit-
   twins, margins not gap, three-value flex, nothing under 16px.
   wall/compat-check.py scans it. */

.hc-over {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9000;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  background: #231F54; color: #FFFFFF;
  font: 800 16px/1.3 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  padding: 12px 16px 16px;
  padding-top: 12px; padding-top: env(safe-area-inset-top, 12px);
  padding-bottom: 16px; padding-bottom: env(safe-area-inset-bottom, 16px);
  box-sizing: border-box;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-animation: hc-in 220ms ease-out; animation: hc-in 220ms ease-out;
}
.hc-over * { box-sizing: border-box; }
.hc-off { display: none !important; }

/* --------------------------------------------------------------- top bar */

.hc-top {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  padding-top: 8px;
}
.hc-tabs {
  display: -webkit-flex; display: flex;
  -webkit-flex: 1 1 0%; flex: 1 1 0%;
  padding: 5px; border-radius: 20px; background: rgba(0,0,0,0.28);
}
.hc-tab {
  -webkit-flex: 1 1 0%; flex: 1 1 0%;
  min-height: 48px; margin: 0; border: 0; border-radius: 16px;
  background: transparent; color: #CFCBEF;
  font: inherit; font-size: 18px; font-weight: 900; cursor: pointer;
}
.hc-tab + .hc-tab { margin-left: 5px; }
.hc-tab.on { background: #FFC928; color: #1B1640; box-shadow: 0 4px 0 #D99A00; }
.hc-x {
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  width: 54px; height: 54px; margin-left: 12px; border: 0; border-radius: 18px;
  background: rgba(255,255,255,0.14); color: #FFFFFF;
  font: inherit; font-size: 32px; line-height: 1; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.25);
}
.hc-x:active, .hc-chip:active, .hc-btn:active, .hc-now:active {
  -webkit-transform: translateY(4px); transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

/* ------------------------------------------------------------ the panes */

.hc-pane {
  -webkit-flex: 1 1 0%; flex: 1 1 0%;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  min-height: 0; margin-top: 14px; position: relative;
}
.hc-row {
  display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-justify-content: center; justify-content: center;
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  margin: 0 -4px;
}
.hc-scroll {
  -webkit-flex-wrap: nowrap; flex-wrap: nowrap;
  -webkit-justify-content: flex-start; justify-content: flex-start;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.hc-fingers .hc-row { margin-top: 12px; }
.hc-chip {
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  min-height: 48px; margin: 4px; padding: 8px 16px; border: 0; border-radius: 16px;
  background: rgba(255,255,255,0.14); color: #FFFFFF;
  font: inherit; font-size: 17px; font-weight: 900; white-space: nowrap; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.25);
}
.hc-chip.on { background: #FFFFFF; color: #1B1640; box-shadow: 0 5px 0 rgba(8,6,32,0.45); }

/* --------------------------------------------------------------- fingers */

.hc-stage {
  -webkit-flex: 1 1 0%; flex: 1 1 0%;
  position: relative; overflow: hidden; min-height: 200px;
  border-radius: 28px; background-color: #2E2868;
  border: 3px dashed rgba(255,255,255,0.22);
  touch-action: none; -webkit-touch-callout: none;
  -webkit-transition: background-color 300ms ease; transition: background-color 300ms ease;
}
.hc-stage.ready { border-color: rgba(255,201,40,0.7); }
.hc-stage.done { border-style: solid; border-color: transparent; }
.hc-hint {
  position: absolute; left: 16px; right: 16px; top: 50%; margin: -22px 0 0;
  text-align: center; font-size: 26px; font-weight: 900; color: #FFFFFF;
  text-shadow: 0 3px 0 rgba(0,0,0,0.3); pointer-events: none;
}
.hc-stage.ready .hc-hint, .hc-stage.done .hc-hint { top: 22px; margin-top: 0; }
.hc-now {
  position: absolute; left: 50%; bottom: 26px; width: 200px; margin-left: -100px;
  min-height: 52px; border: 0; border-radius: 18px;
  background: #FFC928; color: #1B1640; box-shadow: 0 5px 0 #D99A00;
  font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; z-index: 3;
}
.hc-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: rgba(0,0,0,0.2); }
.hc-bar i { display: block; height: 100%; width: 0%; background: #FFC928; }
.hc-bar i.fill { -webkit-transition: width 2500ms linear; transition: width 2500ms linear; }

.hc-dot {
  position: absolute; width: 0; height: 0; z-index: 2; pointer-events: auto;
}
.hc-dot-in {
  position: absolute; left: -50px; top: -50px; width: 100px; height: 100px; border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.9), 0 10px 24px rgba(0,0,0,0.35);
  -webkit-transition: -webkit-transform 260ms cubic-bezier(.2,1.4,.4,1), opacity 260ms ease;
  transition: transform 260ms cubic-bezier(.2,1.4,.4,1), opacity 260ms ease;
  -webkit-animation: hc-pop 240ms cubic-bezier(.2,1.4,.4,1); animation: hc-pop 240ms cubic-bezier(.2,1.4,.4,1);
}
.hc-dot-in b { font-size: 40px; font-weight: 900; line-height: 1; }
.hc-dot-in:after {
  content: ""; position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px;
  border-radius: 50%; border: 4px solid rgba(255,255,255,0.7);
  -webkit-animation: hc-ring 1.4s ease-out infinite; animation: hc-ring 1.4s ease-out infinite;
}
.hc-stage.ready .hc-dot-in:after { -webkit-animation-duration: 0.7s; animation-duration: 0.7s; }
.hc-dot.win .hc-dot-in { -webkit-transform: scale(1.6); transform: scale(1.6);
  box-shadow: 0 0 0 8px #FFFFFF, 0 0 0 18px rgba(255,255,255,0.35), 0 16px 32px rgba(0,0,0,0.4); }
.hc-dot.win .hc-dot-in b, .hc-dot.ranked .hc-dot-in b { position: relative; }
.hc-dot.lose .hc-dot-in { -webkit-transform: scale(0.6); transform: scale(0.6); opacity: 0.25; }
.hc-dot.win .hc-dot-in:after, .hc-dot.lose .hc-dot-in:after, .hc-dot.ranked .hc-dot-in:after {
  -webkit-animation: none; animation: none; opacity: 0;
}
.hc-dot.ranked .hc-dot-in { -webkit-transform: scale(1.15); transform: scale(1.15); }
.hc-dot.gone .hc-dot-in { -webkit-transform: scale(0.2); transform: scale(0.2); opacity: 0; }

/* The running order, in each person's colour, once it is decided. */
.hc-order {
  position: absolute; left: 12px; right: 12px; top: 70px; z-index: 1;
  text-align: center; pointer-events: none;
}
.hc-order span { display: inline-block; padding: 6px 8px; border-radius: 30px; background: rgba(27,22,64,0.45); }
.hc-order i {
  display: inline-block; width: 44px; height: 44px; margin: 4px; border-radius: 50%;
  font-style: normal; font-size: 20px; font-weight: 900; line-height: 44px; text-align: center;
  box-shadow: 0 0 0 4px #FFFFFF, 0 4px 0 4px rgba(8,6,32,0.3);
}

/* ----------------------------------------------------------------- wheel */

.hc-wheelbox {
  -webkit-flex: 1 1 0%; flex: 1 1 0%;
  position: relative; min-height: 220px; margin-top: 10px;
}
.hc-canvas {
  position: absolute; left: 50%; top: 50%; border-radius: 50%; cursor: pointer;
  box-shadow: 0 12px 0 rgba(8,6,32,0.45);
  touch-action: manipulation; -webkit-touch-callout: none;
}
.hc-pointer {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin-left: -18px; z-index: 2;
  border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 34px solid #FFC928;
  -webkit-filter: drop-shadow(0 3px 0 rgba(0,0,0,0.35)); filter: drop-shadow(0 3px 0 rgba(0,0,0,0.35));
  -webkit-transform-origin: 50% 0; transform-origin: 50% 0;
}
.hc-pointer.flick { -webkit-animation: hc-flick 120ms ease-out; animation: hc-flick 120ms ease-out; }
.hc-hub {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  border: 6px solid #FFFFFF; border-radius: 50%;
  background: #FFC928; color: #1B1640; box-shadow: 0 6px 0 #D99A00, 0 10px 20px rgba(0,0,0,0.3);
  font: inherit; font-size: 20px; font-weight: 900; text-transform: uppercase; cursor: pointer;
}
.hc-hub:active { -webkit-transform: translateY(3px); transform: translateY(3px); box-shadow: 0 2px 0 #D99A00; }
.hc-hub[disabled] { opacity: 0.5; }
.hc-empty {
  position: absolute; left: 16px; right: 16px; bottom: 8px; margin: 0;
  text-align: center; font-size: 18px; color: #CFCBEF;
}
.hc-result {
  position: absolute; left: 50%; bottom: 8px; width: 340px; margin-left: -170px; z-index: 4;
  padding: 16px 16px 18px; border-radius: 24px; text-align: center;
  background: #FFFFFF; color: #1B1640; box-shadow: 0 8px 0 rgba(8,6,32,0.45);
  -webkit-animation: hc-up 360ms cubic-bezier(.2,1.3,.4,1); animation: hc-up 360ms cubic-bezier(.2,1.3,.4,1);
}
.hc-result-say { margin: 0; font-size: 16px; color: #6B6790; text-transform: uppercase; letter-spacing: 1px; }
.hc-result-name {
  display: inline-block; margin: 6px 0 12px; padding: 6px 18px 8px; border-radius: 18px;
  font-size: 32px; font-weight: 900; line-height: 1.1; word-wrap: break-word;
  box-shadow: 0 4px 0 rgba(27,22,64,0.2);
}
.hc-result-btns {
  display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-justify-content: center; justify-content: center;
}
.hc-btn {
  min-height: 48px; margin: 4px; padding: 8px 16px; border: 0; border-radius: 16px;
  background: #ECE9FF; color: #1B1640; box-shadow: 0 5px 0 #C9C3EE;
  font: inherit; font-size: 17px; font-weight: 900; cursor: pointer;
}
.hc-btn.go { background: #FFC928; box-shadow: 0 5px 0 #D99A00; }
.hc-edit {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 16px; border-radius: 24px; background: #FFFFFF; color: #1B1640;
  box-shadow: 0 8px 0 rgba(8,6,32,0.45);
}
.hc-edit label { display: block; margin-bottom: 8px; font-size: 17px; }
.hc-edit textarea {
  display: block; width: 100%; padding: 12px; border: 2px solid #D9D4F5; border-radius: 14px;
  font: inherit; font-size: 18px; font-weight: 700; color: #1B1640; resize: none;
  -webkit-user-select: text; user-select: text;
}
.hc-link {
  -webkit-align-self: center; align-self: center;
  margin-top: 6px; padding: 8px 12px; border: 0; background: transparent;
  color: #CFCBEF; font: inherit; font-size: 16px; text-decoration: underline; cursor: pointer;
}

@media (max-width: 420px) {
  .hc-result { width: 300px; margin-left: -150px; }
  .hc-chip { padding: 8px 12px; font-size: 16px; }
  .hc-hint { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-over, .hc-dot-in, .hc-result, .hc-pointer.flick { -webkit-animation: none; animation: none; }
  .hc-dot-in:after { -webkit-animation: none; animation: none; }
}

@-webkit-keyframes hc-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hc-in { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes hc-pop { from { -webkit-transform: scale(0.3); } to { -webkit-transform: scale(1); } }
@keyframes hc-pop { from { transform: scale(0.3); } to { transform: scale(1); } }
@-webkit-keyframes hc-ring { from { -webkit-transform: scale(1); opacity: 0.8; } to { -webkit-transform: scale(1.5); opacity: 0; } }
@keyframes hc-ring { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.5); opacity: 0; } }
@-webkit-keyframes hc-flick { 0% { -webkit-transform: rotate(0deg); } 40% { -webkit-transform: rotate(-18deg); } 100% { -webkit-transform: rotate(0deg); } }
@keyframes hc-flick { 0% { transform: rotate(0deg); } 40% { transform: rotate(-18deg); } 100% { transform: rotate(0deg); } }
@-webkit-keyframes hc-up { from { -webkit-transform: translateY(30px) scale(0.9); opacity: 0; } to { -webkit-transform: none; opacity: 1; } }
@keyframes hc-up { from { transform: translateY(30px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* Go again sits on a board that may be any colour, so it is always white. */
.hc-now[data-hc-again] { background: #FFFFFF; color: #1B1640; box-shadow: 0 5px 0 rgba(8,6,32,0.35); }
